From 782190417c5a7755eed60ac70bb8665a28506ffe Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Thu, 31 Aug 2023 15:00:57 +0800 Subject: [PATCH] all.sh: ciper_encrypt_only: cover VIA PADLOCK Signed-off-by: Yanray Wang --- tests/scripts/all.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 8129421639..4cc67be75d 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -4219,6 +4219,48 @@ component_test_cipher_encrypt_only_aesni () { rm -f psa_cipher_encrypt_only.h } +component_test_cipher_encrypt_only_aesni_m32 () { + # pre-setup to implicitly enable CIPHER_ENCRYPT_ONLY + scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG + scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC + scripts/config.py unset MBEDTLS_CIPHER_MODE_XTS + scripts/config.py unset MBEDTLS_NIST_KW_C + + echo '#undef PSA_WANT_ALG_CBC_NO_PADDING' >> psa_cipher_encrypt_only.h + echo '#undef PSA_WANT_ALG_CBC_PKCS7' >> psa_cipher_encrypt_only.h + echo '#undef PSA_WANT_ALG_ECB_NO_PADDING' >> psa_cipher_encrypt_only.h + + # test AESNI intrinsics for i386 with VIA PADLOCK + scripts/config.py set MBEDTLS_AESNI_C + scripts/config.py set MBEDTLS_PADLOCK_C + msg "build: implicitly enable CIPER_ENCRYPT_ONLY for i386 with VIA PADLOCK" + make clean + make CC=gcc LDFLAGS='-m32' CFLAGS="-m32 -Werror -Wall -Wextra -mpclmul -msse2 -maes\ + -I '$PWD' -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE='\"psa_cipher_encrypt_only.h\"'" + + msg "test: implicitly enable CIPER_ENCRYPT_ONLY for i386 with VIA PADLOCK" + make test + + msg "selftest: implicitly enable CIPER_ENCRYPT_ONLY for i386 with VIA PADLOCK" + programs/test/selftest + + # test AESNI intrinsics for i386 without VIA PADLOCK + scripts/config.py set MBEDTLS_AESNI_C + scripts/config.py unset MBEDTLS_PADLOCK_C + msg "build: implicitly enable CIPER_ENCRYPT_ONLY for i386 without VIA PADLOCK" + make clean + make CC=gcc LDFLAGS='-m32' CFLAGS="-m32 -Werror -Wall -Wextra -mpclmul -msse2 -maes\ + -I '$PWD' -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE='\"psa_cipher_encrypt_only.h\"'" + + msg "test: implicitly enable CIPER_ENCRYPT_ONLY for i386 without VIA PADLOCK" + make test + + msg "selftest: implicitly enable CIPER_ENCRYPT_ONLY for i386 without VIA PADLOCK" + programs/test/selftest + + rm -f psa_cipher_encrypt_only.h +} + support_test_cipher_encrypt_only_aesce_armcc () { armc6_cc="$ARMC6_BIN_DIR/armclang" (check_tools "$armc6_cc" > /dev/null 2>&1)