diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-07 00:45:30 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2022-03-08 00:29:26 +0100 |
commit | 36795a688fd1d5bb9f497970938d9fcb08cfc330 (patch) | |
tree | 24ffb2320c1f72c16b96c13fa4dddda4267065ee /src/Volume/Pkcs5Kdf.cpp | |
parent | 2dee49d3c8422aa1aa11c8630823aab3028cccd5 (diff) | |
download | VeraCrypt-36795a688fd1d5bb9f497970938d9fcb08cfc330.tar.gz VeraCrypt-36795a688fd1d5bb9f497970938d9fcb08cfc330.zip |
Implement support of Blake2s-256 hash algorithm and remove deprecated algorithms RIPEMD-160 and GOST89.
Diffstat (limited to 'src/Volume/Pkcs5Kdf.cpp')
-rw-r--r-- | src/Volume/Pkcs5Kdf.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Volume/Pkcs5Kdf.cpp b/src/Volume/Pkcs5Kdf.cpp index ba5f46dd..fee057a8 100644 --- a/src/Volume/Pkcs5Kdf.cpp +++ b/src/Volume/Pkcs5Kdf.cpp @@ -58,14 +58,13 @@ namespace VeraCrypt { l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha512 (true))); l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacWhirlpool (true))); - l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacRipemd160 (true))); } else { l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha512 (false))); l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacSha256 ())); + l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacBlake2s ())); l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacWhirlpool (false))); - l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacRipemd160 (false))); l.push_back (shared_ptr <Pkcs5Kdf> (new Pkcs5HmacStreebog ())); } @@ -78,16 +77,16 @@ namespace VeraCrypt throw ParameterIncorrect (SRC_POS); } - void Pkcs5HmacRipemd160::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const + void Pkcs5HmacBlake2s_Boot::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const { ValidateParameters (key, password, salt, iterationCount); - derive_key_ripemd160 ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size()); + derive_key_blake2s ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size()); } - void Pkcs5HmacRipemd160_1000::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const + void Pkcs5HmacBlake2s::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const { ValidateParameters (key, password, salt, iterationCount); - derive_key_ripemd160 ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size()); + derive_key_blake2s ((char *) password.DataPtr(), (int) password.Size(), (char *) salt.Get(), (int) salt.Size(), iterationCount, (char *) key.Get(), (int) key.Size()); } void Pkcs5HmacSha256_Boot::DeriveKey (const BufferPtr &key, const VolumePassword &password, const ConstBufferPtr &salt, int iterationCount) const |