diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-10-14 21:19:53 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-08 23:24:03 +0100 |
commit | f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de (patch) | |
tree | 68ff46ae6fa1575eb6052465a8708fb96311894e /src/Volume/Pkcs5Kdf.h | |
parent | 905a3ff4a5d70a00d9ba7819b9f43ad9ce0654e6 (diff) | |
download | VeraCrypt-f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de.tar.gz VeraCrypt-f05f6a00a6b0f150b0a0b51cd7b44b9c9193e3de.zip |
Integrate SHA-256 support into Linux/MacOSX code. Set PRF priority to SHA-512 -> Whirlpool -> SHA-256 -> RIPEMD-160 .
Diffstat (limited to 'src/Volume/Pkcs5Kdf.h')
-rw-r--r-- | src/Volume/Pkcs5Kdf.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Volume/Pkcs5Kdf.h b/src/Volume/Pkcs5Kdf.h index 00e7a0a9..23de2c8c 100644 --- a/src/Volume/Pkcs5Kdf.h +++ b/src/Volume/Pkcs5Kdf.h @@ -74,7 +74,38 @@ namespace VeraCrypt Pkcs5HmacRipemd160_1000 (const Pkcs5HmacRipemd160_1000 &); Pkcs5HmacRipemd160_1000 &operator= (const Pkcs5HmacRipemd160_1000 &); }; + + class Pkcs5HmacSha256_Boot : public Pkcs5Kdf + { + public: + Pkcs5HmacSha256_Boot () { } + virtual ~Pkcs5HmacSha256_Boot () { } + + virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount, BOOL bNotTest = TRUE) const; + virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Sha256); } + virtual int GetIterationCount () const { return 200000; } + virtual wstring GetName () const { return L"HMAC-SHA-256"; } + private: + Pkcs5HmacSha256_Boot (const Pkcs5HmacSha256_Boot &); + Pkcs5HmacSha256_Boot &operator= (const Pkcs5HmacSha256_Boot &); + }; + + class Pkcs5HmacSha256 : public Pkcs5Kdf + { + public: + Pkcs5HmacSha256 () { } + virtual ~Pkcs5HmacSha256 () { } + + virtual void DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount, BOOL bNotTest = TRUE) const; + virtual shared_ptr <Hash> GetHash () const { return shared_ptr <Hash> (new Sha256); } + virtual int GetIterationCount () const { return 500000; } + virtual wstring GetName () const { return L"HMAC-SHA-256"; } + + private: + Pkcs5HmacSha256 (const Pkcs5HmacSha256 &); + Pkcs5HmacSha256 &operator= (const Pkcs5HmacSha256 &); + }; class Pkcs5HmacSha512 : public Pkcs5Kdf { |