From 78144f3f4222610eac40ff3031a1840dd5de26a2 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 24 Apr 2016 00:00:32 -0400 Subject: [PATCH] Add test case for CRYPTOPP_USE_FIPS_202_SHA3 --- cryptest.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/cryptest.sh b/cryptest.sh index 3e8de746..5c38d03f 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -809,6 +809,60 @@ else fi fi +############################################ +# Basic debug build, using SHA3/FIPS 202 +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, default CXXFLAGS, CRYPTOPP_USE_FIPS_202_SHA3" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +rm -f adhoc.cpp > /dev/null 2>&1 + +export CXXFLAGS="-DDEBUG -g2 -O2 -DCRYPTOPP_USE_FIPS_202_SHA3" +"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + +if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" +else + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" + fi + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" + fi +fi + +############################################ +# Basic release build, using SHA3/FIPS 202 +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: release, default CXXFLAGS, CRYPTOPP_USE_FIPS_202_SHA3" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +rm -f adhoc.cpp > /dev/null 2>&1 + +export CXXFLAGS="-DNDEBUG -g2 -O2 -DCRYPTOPP_USE_FIPS_202_SHA3" +"$MAKE" "${MAKEARGS[@]}" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + +if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to make cryptest.exe" | tee -a "$TEST_RESULTS" +else + ./cryptest.exe v 2>&1 | tee -a "$TEST_RESULTS" + if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to execute validation suite" | tee -a "$TEST_RESULTS" + fi + ./cryptest.exe tv all 2>&1 | tee -a "$TEST_RESULTS" + if [ "${PIPESTATUS[0]}" -ne "0" ]; then + echo "ERROR: failed to execute test vectors" | tee -a "$TEST_RESULTS" + fi +fi + ############################################ # Debug build at -O3 echo