From 235c615a10b418974354c38218bc29beda2ae7e4 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 14 Dec 2018 12:15:58 -0500 Subject: [PATCH] Make TestCurve25519 available in Release builds --- validat0.cpp | 52 ------------------------------------------------ validat7.cpp | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++- validate.h | 2 +- 3 files changed, 56 insertions(+), 54 deletions(-) diff --git a/validat0.cpp b/validat0.cpp index 39431989..56c3e159 100644 --- a/validat0.cpp +++ b/validat0.cpp @@ -21,11 +21,6 @@ #include "gzip.h" #include "zlib.h" -//curve25519 -#include "xed25519.h" -#include "donna.h" -#include "naclite.h" - #include #include #include @@ -428,53 +423,6 @@ bool TestCompressors() return !fail1 && !fail2 && !fail3; } -bool TestCurve25519() -{ - std::cout << "\nTesting curve25519 Key Agreements...\n\n"; - const unsigned int AGREE_COUNT = 64; - bool pass = true; - - SecByteBlock priv1(32), priv2(32), pub1(32), pub2(32), share1(32), share2(32); - for (unsigned int i=0; i #include #include @@ -352,5 +356,55 @@ bool ValidateEC2N_Agreement() return pass; } +// TestCurve25519 is slighty more comprehensive than ValidateX25519 +// because it cross-validates against Bernstein's NaCL library. +// TestCurve25519 called in Debug builds. +bool TestCurve25519() +{ + std::cout << "\nTesting curve25519 Key Agreements...\n\n"; + const unsigned int AGREE_COUNT = 64; + bool pass = true; + + SecByteBlock priv1(32), priv2(32), pub1(32), pub2(32), share1(32), share2(32); + for (unsigned int i=0; i