Fix compile error with NO_OS_DEPENDENCE

pull/416/head
Jeffrey Walton 2017-05-10 03:50:32 -04:00
parent 151ec518e8
commit 093499260e
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 9 additions and 3 deletions

View File

@ -46,6 +46,7 @@
#include "drbg.h" #include "drbg.h"
#include "rdrand.h" #include "rdrand.h"
#include "mersenne.h" #include "mersenne.h"
#include "randpool.h"
#include "zdeflate.h" #include "zdeflate.h"
#include "smartptr.h" #include "smartptr.h"
#include "channels.h" #include "channels.h"
@ -71,7 +72,9 @@ bool ValidateAll(bool thorough)
bool pass=TestSettings(); bool pass=TestSettings();
pass=TestOS_RNG() && pass; pass=TestOS_RNG() && pass;
pass=TestRandomPool() && pass; pass=TestRandomPool() && pass;
#if !defined(NO_OS_DEPENDENCE)
pass=TestAutoSeededX917() && pass; pass=TestAutoSeededX917() && pass;
#endif
// pass=TestSecRandom() && pass; // pass=TestSecRandom() && pass;
#if defined(CRYPTOPP_EXTENDED_VALIDATION) #if defined(CRYPTOPP_EXTENDED_VALIDATION)
pass=TestMersenne() && pass; pass=TestMersenne() && pass;
@ -534,7 +537,6 @@ bool TestOS_RNG()
return pass; return pass;
} }
#if !defined(NO_OS_DEPENDENCE)
bool TestRandomPool() bool TestRandomPool()
{ {
std::cout << "\nTesting RandomPool generator...\n\n"; std::cout << "\nTesting RandomPool generator...\n\n";
@ -624,6 +626,7 @@ bool TestRandomPool()
std::cout << " GenerateWord32 and Crop\n"; std::cout << " GenerateWord32 and Crop\n";
} }
#if !defined(NO_OS_DEPENDENCE)
std::cout << "\nTesting AutoSeeded RandomPool generator...\n\n"; std::cout << "\nTesting AutoSeeded RandomPool generator...\n\n";
{ {
AutoSeededRandomPool prng; AutoSeededRandomPool prng;
@ -710,11 +713,13 @@ bool TestRandomPool()
std::cout << "passed:"; std::cout << "passed:";
std::cout << " GenerateWord32 and Crop\n"; std::cout << " GenerateWord32 and Crop\n";
} }
#endif
std::cout.flush(); std::cout.flush();
return pass; return pass;
} }
#if !defined(NO_OS_DEPENDENCE)
bool TestAutoSeededX917() bool TestAutoSeededX917()
{ {
// This tests Auto-Seeding and GenerateIntoBufferedTransformation. // This tests Auto-Seeding and GenerateIntoBufferedTransformation.
@ -808,7 +813,7 @@ bool TestAutoSeededX917()
std::cout.flush(); std::cout.flush();
return pass; return pass;
} }
#endif // NO_OS_DEPENDENCE #endif
#if defined(CRYPTOPP_EXTENDED_VALIDATION) #if defined(CRYPTOPP_EXTENDED_VALIDATION)
bool TestMersenne() bool TestMersenne()

View File

@ -19,8 +19,9 @@ bool TestSettings();
bool TestOS_RNG(); bool TestOS_RNG();
// bool TestSecRandom(); // bool TestSecRandom();
bool TestRandomPool(); bool TestRandomPool();
#if !defined(NO_OS_DEPENDENCE)
bool TestAutoSeededX917(); bool TestAutoSeededX917();
#endif
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64)
bool TestRDRAND(); bool TestRDRAND();
bool TestRDSEED(); bool TestRDSEED();