1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-06-17 01:56:10 -05:00

Linux/macOS: expose BLAKE2b-512 as PRF in hash selection dialogs

The Blake2b hash class (BLAKE2b-512) was fully implemented but never
registered in Hash::GetAvailableAlgorithms(), so it was absent from the
Random Pool Enrichment, Keyfile Generator and Benchmark dialogs on
Linux/macOS. In particular, when Argon2 is selected as the volume PRF,
the RNG pool hash is set to BLAKE2b-512, but the Random Pool Enrichment
dialog could neither display nor pre-select it, diverging from Windows
which offers BLAKE2b-512 in the same dialog.

Register Blake2b after Streebog (matching the Crypto.c PRF order). Its
64-byte digest divides RNG_POOL_SIZE (320), so the HashMixPool size
constraint holds, and blake2b.o is always built in non-wolfCrypt builds.

Also make Pkcs5Kdf::GetAlgorithm(const Hash&) Argon2-aware by removing
the unconditional skip of the Argon2 KDF, so a BLAKE2b-512 hash now maps
to the Argon2 KDF instead of throwing.
This commit is contained in:
Mounir IDRASSI
2026-06-14 12:10:55 +09:00
parent a751e75588
commit 54a23eeacb
2 changed files with 4 additions and 3 deletions
+1
View File
@@ -30,6 +30,7 @@ namespace VeraCrypt
l.push_back (shared_ptr <Hash> (new Blake2s ()));
l.push_back (shared_ptr <Hash> (new Whirlpool ()));
l.push_back (shared_ptr <Hash> (new Streebog ()));
l.push_back (shared_ptr <Hash> (new Blake2b ()));
#endif
return l;
}
+3 -3
View File
@@ -62,11 +62,11 @@ namespace VeraCrypt
shared_ptr <Pkcs5Kdf> Pkcs5Kdf::GetAlgorithm (const Hash &hash)
{
// Match the KDF whose underlying hash is the requested one. Argon2
// (whose underlying hash is BLAKE2b-512) is included, so a BLAKE2b-512
// hash maps to the Argon2 KDF.
foreach (shared_ptr <Pkcs5Kdf> kdf, GetAvailableAlgorithms())
{
if (kdf->IsArgon2())
continue;
if (typeid (*kdf->GetHash()) == typeid (hash))
return kdf;
}