Skip to content

Commit 97f59ab

Browse files
CTR_DRBG: add the possibility of grabbing entropy for a nonce
Add a new function mbedtls_ctr_drbg_set_nonce_len() which configures the DRBG instance to call f_entropy a second time during the initial seeding to grab a nonce. The default nonce length is 0, so there is no behavior change unless the user calls the new function.
1 parent 9be5098 commit 97f59ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/ctr_drbg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ void mbedtls_ctr_drbg_update( mbedtls_ctr_drbg_context *ctx,
357357
* and with output
358358
* ctx contains new_working_state
359359
*/
360-
int mbedtls_ctr_drbg_reseed_internal( mbedtls_ctr_drbg_context *ctx,
361-
const unsigned char *additional,
362-
size_t len,
363-
size_t nonce_len )
360+
static int mbedtls_ctr_drbg_reseed_internal( mbedtls_ctr_drbg_context *ctx,
361+
const unsigned char *additional,
362+
size_t len,
363+
size_t nonce_len )
364364
{
365365
unsigned char seed[MBEDTLS_CTR_DRBG_MAX_SEED_INPUT];
366366
size_t seedlen = 0;

0 commit comments

Comments
 (0)