1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

CTR_DRBG: explicitly set entropy_nonce_len=0 when desired

No behavior change. Prepare for a future version that will set the
entropy nonce length to a nonzero value by default.
This commit is contained in:
Gilles Peskine
2019-10-22 20:33:56 +02:00
parent c949de06ec
commit 0ed378aa02
2 changed files with 3 additions and 0 deletions

View File

@ -45,6 +45,7 @@ static void ctr_drbg_validate_internal( int reseed_mode, data_t * nonce,
/* CTR_DRBG_Instantiate(entropy[:entropy->len], nonce, perso, <ignored>)
* where nonce||perso = nonce[nonce->len] */
mbedtls_ctr_drbg_set_entropy_len( &ctx, entropy_chunk_len );
mbedtls_ctr_drbg_set_nonce_len( &ctx, 0 );
TEST_ASSERT( mbedtls_ctr_drbg_seed(
&ctx,
mbedtls_test_entropy_func, entropy->x,