mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-22 04:22:40 -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:
@@ -30,6 +30,7 @@ namespace VeraCrypt
|
|||||||
l.push_back (shared_ptr <Hash> (new Blake2s ()));
|
l.push_back (shared_ptr <Hash> (new Blake2s ()));
|
||||||
l.push_back (shared_ptr <Hash> (new Whirlpool ()));
|
l.push_back (shared_ptr <Hash> (new Whirlpool ()));
|
||||||
l.push_back (shared_ptr <Hash> (new Streebog ()));
|
l.push_back (shared_ptr <Hash> (new Streebog ()));
|
||||||
|
l.push_back (shared_ptr <Hash> (new Blake2b ()));
|
||||||
#endif
|
#endif
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
shared_ptr <Pkcs5Kdf> Pkcs5Kdf::GetAlgorithm (const Hash &hash)
|
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())
|
foreach (shared_ptr <Pkcs5Kdf> kdf, GetAvailableAlgorithms())
|
||||||
{
|
{
|
||||||
if (kdf->IsArgon2())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (typeid (*kdf->GetHash()) == typeid (hash))
|
if (typeid (*kdf->GetHash()) == typeid (hash))
|
||||||
return kdf;
|
return kdf;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user