Add test for modern compiler and old hardware
parent
5d9607613a
commit
cdd88236af
54
cryptest.sh
54
cryptest.sh
|
|
@ -182,6 +182,24 @@ if [ "$IS_ARM32" -ne "0" ] || [ "$IS_ARM64" -ne "0" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
HAVE_X86_AES=0
|
||||
HAVE_X86_RDRAND=0
|
||||
HAVE_X86_RDSEED=0
|
||||
if [ "$IS_X86" -ne "0" ] || [ "$IS_X64" -ne "0" ]; then
|
||||
$CXX -x c++ -DCRYPTOPP_ADHOC_MAIN -maes adhoc.cpp.proto -o $TMP/adhoc.exe > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
HAVE_X86_AES=1
|
||||
fi
|
||||
$CXX -x c++ -DCRYPTOPP_ADHOC_MAIN -mrdrnd adhoc.cpp.proto -o $TMP/adhoc.exe > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
HAVE_X86_RDRAND=1
|
||||
fi
|
||||
$CXX -x c++ -DCRYPTOPP_ADHOC_MAIN -mrdseed adhoc.cpp.proto -o $TMP/adhoc.exe > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
HAVE_X86_RDSEED=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set to 0 if you don't have Valgrind. Valgrind tests take a long time...
|
||||
HAVE_VALGRIND=$(which valgrind 2>&1 | grep -v "no valgrind" | grep -i -c valgrind)
|
||||
|
||||
|
|
@ -1656,6 +1674,42 @@ if [ "$IS_DARWIN" -ne "0" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
############################################
|
||||
# Modern compiler and old hardware, like PII, PIII or Core2
|
||||
if [ "$IS_X86" -ne "0" ] || [ "$IS_X64" -ne "0" ]; then
|
||||
|
||||
echo
|
||||
echo "************************************" | tee -a "$TEST_RESULTS"
|
||||
echo "Testing: AES, RDRAND and RDSEED" | tee -a "$TEST_RESULTS"
|
||||
echo
|
||||
|
||||
OPTS=("")
|
||||
if [ "$HAVE_X86_AES" -ne "0" ]; then
|
||||
OPTS+=("-maes")
|
||||
fi
|
||||
if [ "$HAVE_X86_RDRAND" -ne "0" ]; then
|
||||
OPTS+=("-mrdrnd")
|
||||
fi
|
||||
if [ "$HAVE_X86_RDSEED" -ne "0" ]; then
|
||||
OPTS+=("-mrdseed")
|
||||
fi
|
||||
|
||||
export CXXFLAGS="-DNDEBUG -g2 -O2 -march=native ${OPTS[@]} ${RETAINED_CXXFLAGS[@]}"
|
||||
"$MAKE" "${MAKEARGS[@]}" static 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
|
||||
fi
|
||||
|
||||
############################################
|
||||
# ARM CRC32
|
||||
if [ "$HAVE_ARM_CRC" -ne "0" ]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue