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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user