mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Merge pull request #8899 from SparkiDev/entropy_cont_tests_fix_2
Entropy: fix proportion health test
This commit is contained in:
@ -1342,6 +1342,8 @@ static int Entropy_HealthTest_Proportion(byte noise)
|
|||||||
prop_last = (prop_last + 1) % PROP_WINDOW_SIZE;
|
prop_last = (prop_last + 1) % PROP_WINDOW_SIZE;
|
||||||
/* Added sample to queue - add count. */
|
/* Added sample to queue - add count. */
|
||||||
prop_cnt[noise]++;
|
prop_cnt[noise]++;
|
||||||
|
/* Update count of store values. */
|
||||||
|
prop_total++;
|
||||||
|
|
||||||
/* Check whether first value has too many repetitions in queue. */
|
/* Check whether first value has too many repetitions in queue. */
|
||||||
if (prop_cnt[noise] >= PROP_CUTOFF) {
|
if (prop_cnt[noise] >= PROP_CUTOFF) {
|
||||||
@ -1360,6 +1362,8 @@ static int Entropy_HealthTest_Proportion(byte noise)
|
|||||||
prop_first = (prop_first + 1) % PROP_WINDOW_SIZE;
|
prop_first = (prop_first + 1) % PROP_WINDOW_SIZE;
|
||||||
/* Removed first sample from queue - remove count. */
|
/* Removed first sample from queue - remove count. */
|
||||||
prop_cnt[val]--;
|
prop_cnt[val]--;
|
||||||
|
/* Update count of store values. */
|
||||||
|
prop_total--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user