From 36795a688fd1d5bb9f497970938d9fcb08cfc330 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 7 Mar 2022 00:45:30 +0100 Subject: Implement support of Blake2s-256 hash algorithm and remove deprecated algorithms RIPEMD-160 and GOST89. --- src/Core/RandomNumberGenerator.cpp | 6 +++--- src/Core/Unix/Linux/CoreLinux.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Core') diff --git a/src/Core/RandomNumberGenerator.cpp b/src/Core/RandomNumberGenerator.cpp index 91247d87..39753ee8 100644 --- a/src/Core/RandomNumberGenerator.cpp +++ b/src/Core/RandomNumberGenerator.cpp @@ -252,7 +252,7 @@ namespace VeraCrypt void RandomNumberGenerator::Test () { shared_ptr origPoolHash = PoolHash; - PoolHash.reset (new Ripemd160()); + PoolHash.reset (new Blake2s()); Pool.Zero(); Buffer buffer (1); @@ -262,14 +262,14 @@ namespace VeraCrypt AddToPool (buffer); } - if (Crc32::ProcessBuffer (Pool) != 0x2de46d17) + if (Crc32::ProcessBuffer (Pool) != 0x9ae2fff8) throw TestFailed (SRC_POS); buffer.Allocate (PoolSize); buffer.CopyFrom (PeekPool()); AddToPool (buffer); - if (Crc32::ProcessBuffer (Pool) != 0xcb88e019) + if (Crc32::ProcessBuffer (Pool) != 0x391135a7) throw TestFailed (SRC_POS); PoolHash = origPoolHash; diff --git a/src/Core/Unix/Linux/CoreLinux.cpp b/src/Core/Unix/Linux/CoreLinux.cpp index 47ec8fb8..e1da6dff 100644 --- a/src/Core/Unix/Linux/CoreLinux.cpp +++ b/src/Core/Unix/Linux/CoreLinux.cpp @@ -303,8 +303,7 @@ namespace VeraCrypt void CoreLinux::MountVolumeNative (shared_ptr volume, MountOptions &options, const DirectoryPath &auxMountPoint) const { bool xts = (typeid (*volume->GetEncryptionMode()) == typeid (EncryptionModeXTS)); - bool algoNotSupported = (typeid (*volume->GetEncryptionAlgorithm()) == typeid (GOST89)) - || (typeid (*volume->GetEncryptionAlgorithm()) == typeid (Kuznyechik)) + bool algoNotSupported = (typeid (*volume->GetEncryptionAlgorithm()) == typeid (Kuznyechik)) || (typeid (*volume->GetEncryptionAlgorithm()) == typeid (CamelliaKuznyechik)) || (typeid (*volume->GetEncryptionAlgorithm()) == typeid (KuznyechikTwofish)) || (typeid (*volume->GetEncryptionAlgorithm()) == typeid (KuznyechikAES)) -- cgit v1.2.3