Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crypto/fipsmodule/rand/entropy/tree_drbg_jitter_entropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct tree_jitter_drbg_t {

// reseed_calls_since_initialization is the number of seed/reseed calls made
// on |drbg| since its initialization.
// We assume 2^64-1 is an upper limit on number of reseeds. Type must support
// that.
uint64_t reseed_calls_since_initialization;

// generation_number caches the UBE generation number.
Expand Down
1 change: 1 addition & 0 deletions crypto/fipsmodule/rand/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct ctr_drbg_state_st {
uint8_t counter[16];
uint64_t reseed_counter;
};
OPENSSL_STATIC_ASSERT((sizeof((struct ctr_drbg_state_st*)0)->reseed_counter) * 8 >= 48, value_can_overflow)

// CTR_DRBG_init initialises |*drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of
// entropy in |entropy| and, optionally, a personalization string up to
Expand Down
3 changes: 3 additions & 0 deletions crypto/fipsmodule/rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ struct rand_thread_local_state {

// reseed_calls_since_initialization is the number of reseed calls made on
// |drbg| since its initialization.
// We assume 2^64-1 is an upper limit on number of reseeds. Type must support
// that.
uint64_t reseed_calls_since_initialization;

// generation_number caches the UBE generation number.
Expand All @@ -39,6 +41,7 @@ struct rand_thread_local_state {
// process exit.
CRYPTO_MUTEX state_clear_lock;
};
OPENSSL_STATIC_ASSERT((sizeof((struct rand_thread_local_state*)0)->generate_calls_since_seed) * 8 >= 48, value_can_overflow)

DEFINE_BSS_GET(struct rand_thread_local_state *, thread_states_list_head)
DEFINE_STATIC_MUTEX(thread_local_states_list_lock)
Expand Down
Loading