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

Integrate SHA-256 support into Linux/MacOSX code. Set PRF priority to SHA-512 -> Whirlpool -> SHA-256 -> RIPEMD-160 .

This commit is contained in:
Mounir IDRASSI
2014-10-14 21:19:53 +02:00
parent 905a3ff4a5
commit f05f6a00a6
5 changed files with 97 additions and 5 deletions

View File

@@ -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
{