Skip to content

Commit 0059f48

Browse files
committed
Changed RDSEED to use alternate ctor. Added comments about number of retries for RDRAND and RDSEED
1 parent 2c16082 commit 0059f48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

validat1.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ bool TestAutoSeeded()
460460
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
461461
bool TestRDRAND()
462462
{
463+
// Testing on 6th generation i7 shows RDRAND needs less than 8 retries for 10K bytes.
463464
RDRAND rdrand;
464465
bool entropy = true, compress = true, discard = true;
465466
static const unsigned int SIZE = 10000;
@@ -532,7 +533,8 @@ bool TestRDRAND()
532533
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
533534
bool TestRDSEED()
534535
{
535-
RDSEED rdseed;
536+
// Testing on 6th generation i7 shows RDSEED needs about 128 retries for 10K bytes.
537+
RDSEED rdseed(128);
536538
bool entropy = true, compress = true, discard = true;
537539
static const unsigned int SIZE = 10000;
538540

0 commit comments

Comments
 (0)