Fix compile with NO_OS_DEPENDENCE

pull/769/head
Jeffrey Walton 2018-12-25 06:48:09 -05:00
parent 416db72f2c
commit c37d7c83b1
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 7 additions and 1 deletions

View File

@ -412,9 +412,14 @@ bool TestX25519()
bool TestEd25519() bool TestEd25519()
{ {
std::cout << "\nTesting ed25519 Signatures...\n\n"; std::cout << "\nTesting ed25519 Signatures...\n\n";
bool pass = true;
#if defined(NO_OS_DEPENDENCE)
std::cout << "\nNo operating system provided random number generator, skipping test." << std::endl;
return pass;
#else
const unsigned int SIGN_COUNT = 64, MSG_SIZE=128; const unsigned int SIGN_COUNT = 64, MSG_SIZE=128;
const unsigned int NACL_EXTRA=NaCl::crypto_sign_BYTES; const unsigned int NACL_EXTRA=NaCl::crypto_sign_BYTES;
bool pass = true;
// Test key conversion // Test key conversion
byte seed[32], sk1[64], sk2[64], pk1[32], pk2[32]; byte seed[32], sk1[64], sk2[64], pk1[32], pk2[32];
@ -511,6 +516,7 @@ bool TestEd25519()
else else
std::cout << "FAILED:"; std::cout << "FAILED:";
std::cout << " " << SIGN_COUNT << " verifications" << std::endl; std::cout << " " << SIGN_COUNT << " verifications" << std::endl;
#endif
return pass; return pass;
} }