diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-07 00:45:30 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-08 00:29:26 +0100 |
commit | 36795a688fd1d5bb9f497970938d9fcb08cfc330 (patch) | |
tree | 24ffb2320c1f72c16b96c13fa4dddda4267065ee /src/Volume/Pkcs5Kdf.h | |
parent | 2dee49d3c8422aa1aa11c8630823aab3028cccd5 (diff) | |
download | VeraCrypt-36795a688fd1d5bb9f497970938d9fcb08cfc330.tar.gz VeraCrypt-36795a688fd1d5bb9f497970938d9fcb08cfc330.zip |
Implement support of Blake2s-256 hash algorithm and remove deprecated algorithms RIPEMD-160 and GOST89.
Diffstat (limited to 'src/Volume/Pkcs5Kdf.h')
-rw-r--r-- | src/Volume/Pkcs5Kdf.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Volume/Pkcs5Kdf.h b/src/Volume/Pkcs5Kdf.h index 76cc56a0..25ad76e8 100644 --- a/src/Volume/Pkcs5Kdf.h +++ b/src/Volume/Pkcs5Kdf.h @@ -51,38 +51,38 @@ namespace VeraCrypt Pkcs5Kdf &operator= (const Pkcs5Kdf &); }; - class Pkcs5HmacRipemd160 : public Pkcs5Kdf + class Pkcs5HmacBlake2s_Boot : public Pkcs5Kdf { public: - Pkcs5HmacRipemd160 (bool truecryptMode) : Pkcs5Kdf (truecryptMode) { } - virtual ~Pkcs5HmacRipemd160 () { } + Pkcs5HmacBlake2s_Boot () : Pkcs5Kdf(false) { } + virtual ~Pkcs5HmacBlake2s_Boot () { } virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const; - virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Ripemd160); } - virtual int GetIterationCount (int pim) const { return m_truecryptMode? 2000 : (pim <= 0 ? 655331 : (15000 + (pim * 1000))) ; } - virtual wstring GetName () const { return L"HMAC-RIPEMD-160"; } - virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacRipemd160(m_truecryptMode); } + virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Blake2s); } + virtual int GetIterationCount (int pim) const { return pim <= 0 ? 200000 : (pim * 2048); } + virtual wstring GetName () const { return L"HMAC-BLAKE2s-256"; } + virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacBlake2s_Boot(); } private: - Pkcs5HmacRipemd160 (const Pkcs5HmacRipemd160 &); - Pkcs5HmacRipemd160 &operator= (const Pkcs5HmacRipemd160 &); + Pkcs5HmacBlake2s_Boot (const Pkcs5HmacBlake2s_Boot &); + Pkcs5HmacBlake2s_Boot &operator= (const Pkcs5HmacBlake2s_Boot &); }; - class Pkcs5HmacRipemd160_1000 : public Pkcs5Kdf + class Pkcs5HmacBlake2s : public Pkcs5Kdf { public: - Pkcs5HmacRipemd160_1000 (bool truecryptMode) : Pkcs5Kdf(truecryptMode) { } - virtual ~Pkcs5HmacRipemd160_1000 () { } + Pkcs5HmacBlake2s () : Pkcs5Kdf(false) { } + virtual ~Pkcs5HmacBlake2s () { } virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const; - virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Ripemd160); } - virtual int GetIterationCount (int pim) const { return m_truecryptMode? 1000 : (pim <= 0 ? 327661 : (pim * 2048)); } - virtual wstring GetName () const { return L"HMAC-RIPEMD-160"; } - virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacRipemd160_1000(m_truecryptMode); } + virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Blake2s); } + virtual int GetIterationCount (int pim) const { return pim <= 0 ? 500000 : (15000 + (pim * 1000)); } + virtual wstring GetName () const { return L"HMAC-BLAKE2s-256"; } + virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacBlake2s(); } private: - Pkcs5HmacRipemd160_1000 (const Pkcs5HmacRipemd160_1000 &); - Pkcs5HmacRipemd160_1000 &operator= (const Pkcs5HmacRipemd160_1000 &); + Pkcs5HmacBlake2s (const Pkcs5HmacBlake2s &); + Pkcs5HmacBlake2s &operator= (const Pkcs5HmacBlake2s &); }; class Pkcs5HmacSha256_Boot : public Pkcs5Kdf |