From 14d92f9eba81191e3537ac14ff21d84ef7405e9c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 7 Mar 2017 03:57:23 -0500 Subject: Improve performance of RDRAND and RDSEED (Issue 387) --- validat1.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'validat1.cpp') diff --git a/validat1.cpp b/validat1.cpp index 8a220879..e4e7c456 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -679,7 +679,6 @@ bool TestRDRAND() // Squash code coverage warnings on unused functions (void)rdrand.AlgorithmName(); (void)rdrand.CanIncorporateEntropy(); - rdrand.SetRetries(rdrand.GetRetries()); rdrand.IncorporateEntropy(NULLPTR, 0); if (!(entropy && compress && discard)) @@ -694,7 +693,7 @@ bool TestRDSEED() { // Testing on 5th generation i5 shows RDSEED needs about 128 retries for 10K bytes // on 64-bit/amd64 VM, and it needs more for an 32-bit/i686 VM. - RDSEED rdseed(256); + RDSEED rdseed; bool entropy = true, compress = true, discard = true; static const unsigned int SIZE = 10000; @@ -758,7 +757,6 @@ bool TestRDSEED() // Squash code coverage warnings on unused functions (void)rdseed.AlgorithmName(); (void)rdseed.CanIncorporateEntropy(); - rdseed.SetRetries(rdseed.GetRetries()); rdseed.IncorporateEntropy(NULLPTR, 0); if (!(entropy && compress && discard)) @@ -1410,8 +1408,9 @@ bool TestModeIV(SymmetricCipher &e, SymmetricCipher &d) SecByteBlock lastIV, iv(e.IVSize()); StreamTransformationFilter filter(e, new StreamTransformationFilter(d)); - // vector_ptr due to Enterprise Analysis finding on the stack based array. - vector_ptr plaintext(20480); + // Enterprise Analysis finding on the stack based array + const int BUF_SIZE=20480U; + AlignedSecByteBlock plaintext(BUF_SIZE); for (unsigned int i=1; i<20480; i*=2) { -- cgit v1.2.1