@@ -258,8 +258,9 @@ BOOL Randmix ()
258258 {
259259 unsigned char hashOutputBuffer [MAX_DIGESTSIZE ];
260260 #ifndef WOLFCRYPT_BACKEND
261- WHIRLPOOL_CTX wctx ;
262- blake2s_state bctx ;
261+ WHIRLPOOL_CTX wctx ;
262+ blake2s_state bctx ;
263+ blake2b_state b2ctx ;
263264 STREEBOG_CTX stctx ;
264265 #endif
265266 sha512_ctx sctx ;
@@ -314,9 +315,8 @@ BOOL Randmix ()
314315 sha256_end (hashOutputBuffer , & s256ctx );
315316 break ;
316317
317- #ifndef WOLFCRYPT_BACKEND
318- case BLAKE2S :
319- case ARGON2 : // in case of Argon2, we use Blake2s
318+ #ifndef WOLFCRYPT_BACKEND
319+ case BLAKE2S :
320320 blake2s_init (& bctx );
321321 blake2s_update (& bctx , pRandPool , RNG_POOL_SIZE );
322322 blake2s_final (& bctx , hashOutputBuffer );
@@ -333,7 +333,14 @@ BOOL Randmix ()
333333 STREEBOG_add (& stctx , pRandPool , RNG_POOL_SIZE );
334334 STREEBOG_finalize (& stctx , hashOutputBuffer );
335335 break ;
336- #endif
336+
337+ case ARGON2 :
338+ // For Argon2, we use the underlying Blake2b hash function
339+ blake2b_init (& b2ctx , BLAKE2B_OUTBYTES );
340+ blake2b_update (& b2ctx , pRandPool , RNG_POOL_SIZE );
341+ blake2b_final (& b2ctx , hashOutputBuffer , BLAKE2B_OUTBYTES );
342+ break ;
343+ #endif
337344 default :
338345 // Unknown/wrong ID
339346 TC_THROW_FATAL_EXCEPTION ;
0 commit comments