From 0059f486ad0467d5c4dc692db99a5a5f96c2a733 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 2 Dec 2015 18:23:10 -0500 Subject: [PATCH] Changed RDSEED to use alternate ctor. Added comments about number of retries for RDRAND and RDSEED --- validat1.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/validat1.cpp b/validat1.cpp index 1d614636..144bdbf0 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -460,6 +460,7 @@ bool TestAutoSeeded() #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) bool TestRDRAND() { + // Testing on 6th generation i7 shows RDRAND needs less than 8 retries for 10K bytes. RDRAND rdrand; bool entropy = true, compress = true, discard = true; static const unsigned int SIZE = 10000; @@ -532,7 +533,8 @@ bool TestRDRAND() #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 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; static const unsigned int SIZE = 10000;