Skip to content
Merged
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
4 changes: 4 additions & 0 deletions wolfcrypt/src/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ static int Entropy_HealthTest_Proportion(byte noise)
prop_last = (prop_last + 1) % PROP_WINDOW_SIZE;
/* Added sample to queue - add count. */
prop_cnt[noise]++;
/* Update count of store values. */
prop_total++;

/* Check whether first value has too many repetitions in queue. */
if (prop_cnt[noise] >= PROP_CUTOFF) {
Expand All @@ -1360,6 +1362,8 @@ static int Entropy_HealthTest_Proportion(byte noise)
prop_first = (prop_first + 1) % PROP_WINDOW_SIZE;
/* Removed first sample from queue - remove count. */
prop_cnt[val]--;
/* Update count of store values. */
prop_total--;
}
}

Expand Down