Skip to content

Commit a15c713

Browse files
committed
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.
1 parent 448d1cc commit a15c713

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/mbedtls/ctr_drbg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ typedef struct mbedtls_ctr_drbg_context
177177
* minus one.
178178
* Before the initial seeding, this field
179179
* contains the amount of entropy in bytes
180-
* to use as a nonce for the initial seeding.
180+
* to use as a nonce for the initial seeding,
181+
* or -1 if no nonce length has been explicitly
182+
* set (see mbedtls_ctr_drbg_set_nonce_len()).
181183
*/
182184
int prediction_resistance; /*!< This determines whether prediction
183185
resistance is enabled, that is

0 commit comments

Comments
 (0)