Add comments to accel_ecdh component
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
ec718afb41
commit
e3095e7cb0
1 changed files with 22 additions and 6 deletions
|
@ -2063,8 +2063,8 @@ component_test_psa_crypto_config_accel_ecdsa () {
|
||||||
loc_accel_flags=$( echo "$loc_accel_list" | sed 's/[^ ]* */-DLIBTESTDRIVER1_MBEDTLS_PSA_ACCEL_&/g' )
|
loc_accel_flags=$( echo "$loc_accel_list" | sed 's/[^ ]* */-DLIBTESTDRIVER1_MBEDTLS_PSA_ACCEL_&/g' )
|
||||||
make -C tests libtestdriver1.a CFLAGS="$ASAN_CFLAGS $loc_accel_flags" LDFLAGS="$ASAN_CFLAGS"
|
make -C tests libtestdriver1.a CFLAGS="$ASAN_CFLAGS $loc_accel_flags" LDFLAGS="$ASAN_CFLAGS"
|
||||||
|
|
||||||
# Configure and build the test driver library
|
# Configure and build the main libraries
|
||||||
# -------------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
# Start from default config (no USE_PSA) + driver support + TLS 1.3
|
# Start from default config (no USE_PSA) + driver support + TLS 1.3
|
||||||
scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS
|
scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||||
|
@ -2082,7 +2082,7 @@ component_test_psa_crypto_config_accel_ecdsa () {
|
||||||
loc_accel_flags="$loc_accel_flags $( echo "$loc_accel_list" | sed 's/[^ ]* */-DMBEDTLS_PSA_ACCEL_&/g' )"
|
loc_accel_flags="$loc_accel_flags $( echo "$loc_accel_list" | sed 's/[^ ]* */-DMBEDTLS_PSA_ACCEL_&/g' )"
|
||||||
make CFLAGS="$ASAN_CFLAGS -O -Werror -I../tests/include -I../tests -I../../tests -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_TEST_LIBTESTDRIVER1 $loc_accel_flags" LDFLAGS="-ltestdriver1 $ASAN_CFLAGS"
|
make CFLAGS="$ASAN_CFLAGS -O -Werror -I../tests/include -I../tests -I../../tests -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_TEST_LIBTESTDRIVER1 $loc_accel_flags" LDFLAGS="-ltestdriver1 $ASAN_CFLAGS"
|
||||||
|
|
||||||
# Make sure ECDSA was not re-enabled by accident (additive config)
|
# Make sure this was not re-enabled by accident (additive config)
|
||||||
not grep mbedtls_ecdsa_ library/ecdsa.o
|
not grep mbedtls_ecdsa_ library/ecdsa.o
|
||||||
|
|
||||||
# Run the tests
|
# Run the tests
|
||||||
|
@ -2183,31 +2183,47 @@ component_test_psa_crypto_config_reference_ecdsa_use_psa () {
|
||||||
component_test_psa_crypto_config_accel_ecdh () {
|
component_test_psa_crypto_config_accel_ecdh () {
|
||||||
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated ECDH"
|
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated ECDH"
|
||||||
|
|
||||||
|
# Algorithms and key types to accelerate
|
||||||
|
loc_accel_list="ALG_ECDH KEY_TYPE_ECC_KEY_PAIR KEY_TYPE_ECC_PUBLIC_KEY"
|
||||||
|
|
||||||
|
# Configure and build the test driver library
|
||||||
|
# -------------------------------------------
|
||||||
|
|
||||||
# Disable ALG_STREAM_CIPHER and ALG_ECB_NO_PADDING to avoid having
|
# Disable ALG_STREAM_CIPHER and ALG_ECB_NO_PADDING to avoid having
|
||||||
# partial support for cipher operations in the driver test library.
|
# partial support for cipher operations in the driver test library.
|
||||||
scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_STREAM_CIPHER
|
scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_STREAM_CIPHER
|
||||||
scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_ECB_NO_PADDING
|
scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_ECB_NO_PADDING
|
||||||
|
|
||||||
loc_accel_list="ALG_ECDH KEY_TYPE_ECC_KEY_PAIR KEY_TYPE_ECC_PUBLIC_KEY"
|
|
||||||
loc_accel_flags=$( echo "$loc_accel_list" | sed 's/[^ ]* */-DLIBTESTDRIVER1_MBEDTLS_PSA_ACCEL_&/g' )
|
loc_accel_flags=$( echo "$loc_accel_list" | sed 's/[^ ]* */-DLIBTESTDRIVER1_MBEDTLS_PSA_ACCEL_&/g' )
|
||||||
make -C tests libtestdriver1.a CFLAGS=" $ASAN_CFLAGS $loc_accel_flags" LDFLAGS="$ASAN_CFLAGS"
|
make -C tests libtestdriver1.a CFLAGS=" $ASAN_CFLAGS $loc_accel_flags" LDFLAGS="$ASAN_CFLAGS"
|
||||||
|
|
||||||
|
# Configure and build the main libraries
|
||||||
|
# --------------------------------------
|
||||||
|
|
||||||
|
# Start from default config (no USE_PSA or TLS 1.3) + driver support
|
||||||
scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS
|
scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS
|
||||||
scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG
|
scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG
|
||||||
scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO
|
|
||||||
scripts/config.py unset MBEDTLS_SSL_PROTO_TLS1_3
|
# Disable the module that's accelerated
|
||||||
scripts/config.py unset MBEDTLS_ECDH_C
|
scripts/config.py unset MBEDTLS_ECDH_C
|
||||||
|
|
||||||
|
# Disable things that depend on it
|
||||||
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||||
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
|
||||||
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
|
||||||
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
|
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
|
||||||
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||||
|
|
||||||
|
# Build the library
|
||||||
loc_accel_flags="$loc_accel_flags $( echo "$loc_accel_list" | sed 's/[^ ]* */-DMBEDTLS_PSA_ACCEL_&/g' )"
|
loc_accel_flags="$loc_accel_flags $( echo "$loc_accel_list" | sed 's/[^ ]* */-DMBEDTLS_PSA_ACCEL_&/g' )"
|
||||||
make CFLAGS="$ASAN_CFLAGS -O -Werror -I../tests/include -I../tests -I../../tests -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_TEST_LIBTESTDRIVER1 $loc_accel_flags" LDFLAGS="-ltestdriver1 $ASAN_CFLAGS"
|
make CFLAGS="$ASAN_CFLAGS -O -Werror -I../tests/include -I../tests -I../../tests -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_TEST_LIBTESTDRIVER1 $loc_accel_flags" LDFLAGS="-ltestdriver1 $ASAN_CFLAGS"
|
||||||
|
|
||||||
|
# Make sure this was not re-enabled by accident (additive config)
|
||||||
not grep mbedtls_ecdh_ library/ecdh.o
|
not grep mbedtls_ecdh_ library/ecdh.o
|
||||||
|
|
||||||
|
# Run the tests
|
||||||
|
# -------------
|
||||||
|
|
||||||
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated ECDH"
|
msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated ECDH"
|
||||||
make test
|
make test
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue