From a15c71374b36b4ddac2b6c00d18f6ab6ac87813b Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Thu, 9 Jan 2020 13:02:16 +0000 Subject: [PATCH] ctr_drbg: Clarify reseed_counter values before seeding Before the initial seeding, reseed_counter used to always be 0. Now, the value depends on whether or not the user has explicitly set the amount of data to get from the nonce (via e.g. mbedtls_ctr_drbg_set_nonce_len()). Add comments to clarify the possible values reseed_counter can have before the initial seeding. --- include/mbedtls/ctr_drbg.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/ctr_drbg.h b/include/mbedtls/ctr_drbg.h index 091f15ac2..234e6a036 100644 --- a/include/mbedtls/ctr_drbg.h +++ b/include/mbedtls/ctr_drbg.h @@ -177,7 +177,9 @@ typedef struct mbedtls_ctr_drbg_context * minus one. * Before the initial seeding, this field * contains the amount of entropy in bytes - * to use as a nonce for the initial seeding. + * to use as a nonce for the initial seeding, + * or -1 if no nonce length has been explicitly + * set (see mbedtls_ctr_drbg_set_nonce_len()). */ int prediction_resistance; /*!< This determines whether prediction resistance is enabled, that is