1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-05-21 21:30:48 -05:00

Implement support of Blake2s-256 hash algorithm and remove deprecated algorithms RIPEMD-160 and GOST89.

This commit is contained in:
Mounir IDRASSI
2022-03-07 00:45:30 +01:00
parent 2dee49d3c8
commit 36795a688f
50 changed files with 481 additions and 1943 deletions
+18 -18
View File
@@ -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