VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/Pkcs5Kdf.h
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-09 14:25:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 01:09:11 +0200
commite90e24b30b379752bf6531c663085de1d2a653d7 (patch)
tree6ff3a18a2e9dedb9e506d67f2c560e1c8f657e47 /src/Volume/Pkcs5Kdf.h
parent0b2c8b09c6eb3ddce22fa88c34a640881f8f2177 (diff)
downloadVeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.tar.gz
VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.zip
Windows: Add support for Streebog (hash) and kuznyechik (encryption)
Diffstat (limited to 'src/Volume/Pkcs5Kdf.h')
-rw-r--r--src/Volume/Pkcs5Kdf.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Volume/Pkcs5Kdf.h b/src/Volume/Pkcs5Kdf.h
index d92a3301..c10efaf3 100644
--- a/src/Volume/Pkcs5Kdf.h
+++ b/src/Volume/Pkcs5Kdf.h
@@ -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