1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 19:38:26 -06:00

Windows: Add support for Streebog (hash) and kuznyechik (encryption)

This commit is contained in:
Mounir IDRASSI
2016-08-09 14:25:52 +02:00
parent 0b2c8b09c6
commit e90e24b30b
28 changed files with 5597 additions and 14 deletions

View File

@@ -152,6 +152,40 @@ namespace VeraCrypt
Pkcs5HmacWhirlpool (const Pkcs5HmacWhirlpool &);
Pkcs5HmacWhirlpool &operator= (const Pkcs5HmacWhirlpool &);
};
class Pkcs5HmacStreebog : public Pkcs5Kdf
{
public:
Pkcs5HmacStreebog () : Pkcs5Kdf(false) { }
virtual ~Pkcs5HmacStreebog () { }
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 Streebog); }
virtual int GetIterationCount (int pim) const { return pim <= 0 ? 500000 : (15000 + (pim * 1000)); }
virtual wstring GetName () const { return L"HMAC-Streebog"; }
virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacStreebog(m_truecryptMode); }
private:
Pkcs5HmacStreebog (const Pkcs5HmacStreebog &);
Pkcs5HmacStreebog &operator= (const Pkcs5HmacStreebog &);
};
class Pkcs5HmacStreebog_Boot : public Pkcs5Kdf
{
public:
Pkcs5HmacStreebog_Boot () : Pkcs5Kdf(false) { }
virtual ~Pkcs5HmacStreebog_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 Streebog); }
virtual int GetIterationCount (int pim) const { return pim <= 0 ? 200000 : pim * 2048; }
virtual wstring GetName () const { return L"HMAC-Streebog"; }
virtual Pkcs5Kdf* Clone () const { return new Pkcs5HmacStreebog_Boot(m_truecryptMode); }
private:
Pkcs5HmacStreebog_Boot (const Pkcs5HmacStreebog_Boot &);
Pkcs5HmacStreebog_Boot &operator= (const Pkcs5HmacStreebog_Boot &);
};
}
#endif // TC_HEADER_Encryption_Pkcs5