From ec9cb410604e04a12fd01be0260531f9768f030c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 17 Jun 2016 12:28:32 -0400 Subject: [PATCH] Add missing test case for Debug+CRYPTOPP_NO_UNALIGNED_DATA_ACCESS --- cryptest.sh | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index a384af8f..d650f0ca 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -478,8 +478,8 @@ if [[ ("$HAVE_X86_AES" -ne "0" && "$HAVE_GDB" -ne "0") ]] && false; then "$MAKE" clean > /dev/null 2>&1 rm -f adhoc.cpp > /dev/null 2>&1 - "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS -march=native -maes" rijndael.o 2>&1 | tee -a "$TEST_RESULTS" - + OBJFILE=rijndael.o + "$MAKE" "${MAKEARGS[@]}" CXX="$CXX" CXXFLAGS="$RELEASE_CXXFLAGS -march=native -maes" $OBJFILE 2>&1 | tee -a "$TEST_RESULTS" DISASS=$(gdb -batch -ex 'disassemble AESNI_Enc_Block AESNI_Enc_4_Blocks' $OBJFILE 2>/dev/null) if [[ ($(echo "$DISASS" | grep -i aesenc) -eq "0") ]]; then @@ -1036,6 +1036,34 @@ else fi fi +############################################ +# Debug build, no unaligned data access +# This test will not be needed in Crypto++ 5.7 and above +echo +echo "************************************" | tee -a "$TEST_RESULTS" +echo "Testing: debug, NO_UNALIGNED_DATA_ACCESS" | tee -a "$TEST_RESULTS" +echo + +unset CXXFLAGS +"$MAKE" clean > /dev/null 2>&1 +rm -f adhoc.cpp > /dev/null 2>&1 + +export CXXFLAGS="$DEBUG_CXXFLAGS -DCRYPTOPP_NO_UNALIGNED_DATA_ACCESS ${RETAINED_CXXFLAGS[@]}" +"$MAKE" "${MAKEARGS[@]}" CXX="$CXX" 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 + ############################################ # Release build, no unaligned data access # This test will not be needed in Crypto++ 5.7 and above