## Patch to fix RDSEED exception during build tests
## Discussion at:
## http://comments.gmane.org/gmane.comp.encryption.cryptopp/8028
## Original upstream commit:
## https://github.com/weidai11/cryptopp/commit/0059f486ad0467d5c4dc692db99a5a5f96c2a733
## This patch file has been manually regenerated for cryptopp-5.6.3
--- validat1.cpp.ORIGINAL 2015-11-19 17:25:32.000000000 -0600
+++ validat1.cpp 2016-12-12 16:46:19.272200200 -0600
@@ -459,6 +459,7 @@
#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 maurer = true, generate = true, discard = true;
static const unsigned int SIZE = 10000;
@@ -529,7 +530,8 @@
#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(1024);
bool maurer = true, generate = true, discard = true;
static const unsigned int SIZE = 10000;