Use blake2b as hash for random generator from Argon2 is used.

This commit is contained in:
Mounir IDRASSI committed 2025-07-03 17:32:47 +09:00
1 parent eadb02d8ef
commit 3867c1cca3
30 files changed
+134 -75

No files matched your search

+10 -6
View File
@@ -6343,10 +6343,11 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
{
BYTE digest [MAX_DIGESTSIZE];
#ifndef WOLFCRYPT_BACKEND
WHIRLPOOL_CTX wctx;
WHIRLPOOL_CTX wctx;
STREEBOG_CTX stctx;
blake2s_state bctx;
#endif
blake2s_state bctx;
blake2b_state b2ctx;
#endif
sha512_ctx s2ctx;
sha256_ctx s256ctx;
@@ -6354,9 +6355,6 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
for (hid = FIRST_PRF_ID; hid <= LAST_PRF_ID; hid++)
{
// Skip Argon2 since it is not a hash function
if (hid == ARGON2)
continue;
if (QueryPerformanceCounter (&performanceCountStart) == 0)
goto counter_error;
@@ -6394,6 +6392,12 @@ static BOOL PerformBenchmark(HWND hBenchDlg, HWND hwndDlg)
STREEBOG_add(&stctx, lpTestBuffer, benchmarkBufferSize);
STREEBOG_finalize(&stctx, (unsigned char *)digest);
break;
case ARGON2:
// For Argon2, we measure speed of the underlying blake2b hash function
blake2b_init(&b2ctx, BLAKE2B_OUTBYTES);
blake2b_update(&b2ctx, lpTestBuffer, benchmarkBufferSize);
blake2b_final(&b2ctx, digest, BLAKE2B_OUTBYTES);
break;
}
#endif