Changed RDSEED to use alternate ctor. Added comments about number of retries for RDRAND and RDSEED

pull/75/head
Jeffrey Walton 2015-12-02 18:23:10 -05:00
parent 2c16082495
commit 0059f486ad
1 changed files with 3 additions and 1 deletions

View File

@ -460,6 +460,7 @@ bool TestAutoSeeded()
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
bool TestRDRAND() bool TestRDRAND()
{ {
// Testing on 6th generation i7 shows RDRAND needs less than 8 retries for 10K bytes.
RDRAND rdrand; RDRAND rdrand;
bool entropy = true, compress = true, discard = true; bool entropy = true, compress = true, discard = true;
static const unsigned int SIZE = 10000; static const unsigned int SIZE = 10000;
@ -532,7 +533,8 @@ bool TestRDRAND()
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
bool TestRDSEED() bool TestRDSEED()
{ {
RDSEED rdseed; // Testing on 6th generation i7 shows RDSEED needs about 128 retries for 10K bytes.
RDSEED rdseed(128);
bool entropy = true, compress = true, discard = true; bool entropy = true, compress = true, discard = true;
static const unsigned int SIZE = 10000; static const unsigned int SIZE = 10000;