From 1ef64a73e4b67459029cbf3332ec1816675615c1 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 13 Feb 2026 17:01:19 +0100 Subject: [PATCH 01/11] programs: metatest: Remove include path duplication Signed-off-by: Ronald Cron --- programs/Makefile | 2 +- programs/test/CMakeLists.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 36679dcb0f..323e33ec56 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -199,7 +199,7 @@ endif test/metatest$(EXEXT): $(FRAMEWORK)/tests/programs/metatest.c $(DEP) echo " CC $(FRAMEWORK)/tests/programs/metatest.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/include -I../tf-psa-crypto/drivers/builtin/src $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/src $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ test/query_config.o: test/query_config.c $(FRAMEWORK)/tests/programs/query_config.h $(DEP) echo " CC test/query_config.c" diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 8a5d6ba822..1b371d30b9 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -103,8 +103,7 @@ foreach(exe IN LISTS executables) endforeach() target_include_directories(metatest - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/include - ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src) + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src) install(TARGETS ${executables} DESTINATION "bin" From ae822174766eeec502961c7e2b70a216a76cad08 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:42:33 +0100 Subject: [PATCH 02/11] programs: metatest: Add tf-psa-crypto/platform as include dir Signed-off-by: Ronald Cron --- programs/Makefile | 2 +- programs/test/CMakeLists.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 323e33ec56..846361d788 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -199,7 +199,7 @@ endif test/metatest$(EXEXT): $(FRAMEWORK)/tests/programs/metatest.c $(DEP) echo " CC $(FRAMEWORK)/tests/programs/metatest.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/src $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/src -I../tf-psa-crypto/platform $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ test/query_config.o: test/query_config.c $(FRAMEWORK)/tests/programs/query_config.h $(DEP) echo " CC test/query_config.c" diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 1b371d30b9..0de71a9b03 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -103,8 +103,9 @@ foreach(exe IN LISTS executables) endforeach() target_include_directories(metatest - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src) - + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src + ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/platform +) install(TARGETS ${executables} DESTINATION "bin" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) From 03ee085e104587b8719903880dce2081d9056f02 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:26:02 +0100 Subject: [PATCH 03/11] Remove duplicated recursion tests The recursion tests for the crypto code are run in a TF-PSA-Crypto component. No need to run them in an Mbed TLS component as well. Signed-off-by: Ronald Cron --- tests/scripts/components-basic-checks.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/scripts/components-basic-checks.sh b/tests/scripts/components-basic-checks.sh index 6a5bc3a1d7..1e480dd12b 100644 --- a/tests/scripts/components-basic-checks.sh +++ b/tests/scripts/components-basic-checks.sh @@ -12,8 +12,6 @@ component_check_recursion () { msg "Check: recursion.pl" # < 1s ./framework/scripts/recursion.pl library/*.c - ./framework/scripts/recursion.pl ${PSA_CORE_PATH}/*.c - ./framework/scripts/recursion.pl ${BUILTIN_SRC_PATH}/*.c } component_check_generated_files () { From 24bf98156ac7d0146ac824f30ce51ebad2bac584 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:40:44 +0100 Subject: [PATCH 04/11] components*.sh: Handle current and upcoming object paths Signed-off-by: Ronald Cron --- .../components-configuration-crypto.sh | 31 ++++++-- tests/scripts/components-platform.sh | 72 +++++++++++++++++++ 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index baa59fb5f5..6a6b0a70de 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -10,6 +10,7 @@ ################################################################ CMAKE_BUILTIN_BUILD_DIR="tf-psa-crypto/drivers/builtin/CMakeFiles/builtin.dir/src" +CMAKE_EXTRAS_BUILD_DIR="tf-psa-crypto/extras/CMakeFiles/extras.dir" component_test_psa_crypto_key_id_encodes_owner () { msg "build: full config + PSA_CRYPTO_KEY_ID_ENCODES_OWNER, cmake, gcc, ASan" @@ -280,8 +281,13 @@ component_full_no_pkparse_pkwrite () { cmake --build . # Ensure that PK_[PARSE|WRITE]_C were not re-enabled accidentally (additive config). - not grep mbedtls_pk_parse_key ${CMAKE_BUILTIN_BUILD_DIR}/pkparse.c.o - not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o + if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/pkparse.c ]; then + not grep mbedtls_pk_parse_key ${CMAKE_EXTRAS_BUILD_DIR}/pkparse.c.o + not grep mbedtls_pk_write_key_der ${CMAKE_EXTRAS_BUILD_DIR}/pkwrite.c.o + else + not grep mbedtls_pk_parse_key ${CMAKE_BUILTIN_BUILD_DIR}/pkparse.c.o + not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o + fi msg "test: full without pkparse and pkwrite" ctest @@ -302,7 +308,11 @@ component_full_no_pkwrite () { make # Ensure that PK_WRITE_C was not re-enabled accidentally (additive config). - not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o + if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/pkwrite.c ]; then + not grep mbedtls_pk_write_key_der ${CMAKE_EXTRAS_BUILD_DIR}/pkwrite.c.o + else + not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o + fi msg "test: full without pkwrite" make test @@ -329,8 +339,13 @@ component_test_crypto_full_md_light_only () { cmake --build . # Make sure we don't have the HMAC functions, but the hashing functions - not grep mbedtls_md_hmac ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o - grep mbedtls_md ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o + if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.c ]; then + not grep mbedtls_md_hmac ${CMAKE_EXTRAS_BUILD_DIR}/md.c.o + grep mbedtls_md ${CMAKE_EXTRAS_BUILD_DIR}/md.c.o + else + not grep mbedtls_md_hmac ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o + grep mbedtls_md ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o + fi msg "test: crypto_full with only the light subset of MD" ctest @@ -1668,7 +1683,11 @@ component_test_psa_crypto_config_accel_hmac () { helper_libtestdriver1_make_main "$loc_accel_list" # Ensure that built-in support for HMAC is disabled. - not grep mbedtls_md_hmac ${BUILTIN_SRC_PATH}/md.o + if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.c ]; then + not grep mbedtls_md_hmac ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.o + else + not grep mbedtls_md_hmac ${BUILTIN_SRC_PATH}/md.o + fi # Run the tests # ------------- diff --git a/tests/scripts/components-platform.sh b/tests/scripts/components-platform.sh index d6eef6f781..2f3becf983 100644 --- a/tests/scripts/components-platform.sh +++ b/tests/scripts/components-platform.sh @@ -439,6 +439,18 @@ component_build_arm_none_eabi_gcc () { ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi } component_build_arm_linux_gnueabi_gcc_arm5vte () { @@ -455,6 +467,18 @@ component_build_arm_linux_gnueabi_gcc_arm5vte () { ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t library/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi } support_build_arm_linux_gnueabi_gcc_arm5vte () { @@ -473,6 +497,18 @@ component_build_arm_none_eabi_gcc_arm5vte () { ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi } component_build_arm_none_eabi_gcc_m0plus () { @@ -484,6 +520,18 @@ component_build_arm_none_eabi_gcc_m0plus () { ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi for lib in library/*.a; do echo "$lib:" ${ARM_NONE_EABI_GCC_PREFIX}size -t $lib | grep TOTALS @@ -499,6 +547,18 @@ component_build_arm_none_eabi_gcc_no_udbl_division () { not grep __aeabi_uldiv library/*.o not grep __aeabi_uldiv ${PSA_CORE_PATH}/*.o not grep __aeabi_uldiv ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi } component_build_arm_none_eabi_gcc_no_64bit_multiplication () { @@ -510,6 +570,18 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () { not grep __aeabi_lmul library/*.o not grep __aeabi_lmul ${PSA_CORE_PATH}/*.o not grep __aeabi_lmul ${BUILTIN_SRC_PATH}/*.o + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then + not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then + not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then + not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + fi + if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then + not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + fi } component_build_arm_clang_thumb () { From 325170b96297eb21c17a523ac913cc220d3ee926 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:49:40 +0100 Subject: [PATCH 05/11] legacy.make: Add globs and paths for tags and cscope Signed-off-by: Ronald Cron --- scripts/legacy.make | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/legacy.make b/scripts/legacy.make index b22b8ef8bf..5726f9e82a 100644 --- a/scripts/legacy.make +++ b/scripts/legacy.make @@ -180,6 +180,10 @@ C_SOURCE_FILES = $(wildcard \ tf-psa-crypto/drivers/*/*/*.c \ tf-psa-crypto/drivers/*/*/*/*.c \ tf-psa-crypto/drivers/*/*/*/*/*.c \ + tf-psa-crypto/dispatch/*.[hc] \ + tf-psa-crypto/extras/*.[hc] \ + tf-psa-crypto/platform/*.[hc] \ + tf-psa-crypto/utilities/*.[hc] \ programs/*/*.[hc] \ framework/tests/include/*/*.h framework/tests/include/*/*/*.h \ framework/tests/src/*.c framework/tests/src/*/*.c \ @@ -200,5 +204,9 @@ cscope.in.out cscope.po.out cscope.out: $(C_SOURCE_FILES) cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/core \ -Itf-psa-crypto/include \ -Itf-psa-crypto/drivers/builtin/src \ + -Itf-psa-crypto/dispatch \ + -Itf-psa-crypto/extras \ + -Itf-psa-crypto/platform \ + -Itf-psa-crypto/utilities \ $(patsubst %,-I%,$(wildcard tf-psa-crypto/drivers/*/include)) -Iframework/tests/include $(C_SOURCE_FILES) .PHONY: cscope global From f3a20d25d618ba21a969f205198c6147411ef51d Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:51:38 +0100 Subject: [PATCH 06/11] Prepare libtestdriver1 build for upcoming directory changes Signed-off-by: Ronald Cron --- tests/Makefile | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 745a09d240..a34bc95f99 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -252,7 +252,19 @@ libtestdriver1.a: cp -Rf ../scripts ./libtestdriver1 cp -Rf ../tf-psa-crypto/core ./libtestdriver1/tf-psa-crypto cp -Rf ../tf-psa-crypto/include ./libtestdriver1/tf-psa-crypto - cp -Rf ../tf-psa-crypto/drivers/builtin ./libtestdriver1/tf-psa-crypto/drivers + cp -Rf ../tf-psa-crypto/drivers/builtin ./libtestdriver1/tf-psa-crypto/drivers/builtin + if [ -d ../tf-psa-crypto/dispatch ]; then \ + cp -Rf ../tf-psa-crypto/dispatch ./libtestdriver1/tf-psa-crypto/dispatch; \ + fi + if [ -d ../tf-psa-crypto/extras ]; then \ + cp -Rf ../tf-psa-crypto/extras ./libtestdriver1/tf-psa-crypto/extras; \ + fi + if [ -d ../tf-psa-crypto/platform ]; then \ + cp -Rf ../tf-psa-crypto/platform ./libtestdriver1/tf-psa-crypto/platform; \ + fi + if [ -d ../tf-psa-crypto/utilities ]; then \ + cp -Rf ../tf-psa-crypto/utilities ./libtestdriver1/tf-psa-crypto/utilities; \ + fi cp -Rf ../tf-psa-crypto/scripts ./libtestdriver1/tf-psa-crypto # Set the test driver base (minimal) configuration. @@ -285,7 +297,18 @@ libtestdriver1.a: perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*.h perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*/*.h perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/src/*.[ch] - + if [ -d ../tf-psa-crypto/dispatch ]; then \ + perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/dispatch/*.[ch]; \ + fi + if [ -d ../tf-psa-crypto/extras ]; then \ + perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/extras/*.[ch]; \ + fi + if [ -d ../tf-psa-crypto/platform ]; then \ + perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/platform/*.[ch]; \ + fi + if [ -d ../tf-psa-crypto/utilities ]; then \ + perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/utilities/*.[ch]; \ + fi $(MAKE) -C ./libtestdriver1/library CFLAGS="-I../../ $(CFLAGS)" LDFLAGS="$(LDFLAGS)" libmbedcrypto.a cp ./libtestdriver1/library/libmbedcrypto.a ../library/libtestdriver1.a From a400a3bb8aecc2f88a7dcd814d17f719777184e7 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:53:14 +0100 Subject: [PATCH 07/11] Adapt list_internal_identifiers.py for upcoming directory changes Signed-off-by: Ronald Cron --- tests/scripts/list_internal_identifiers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scripts/list_internal_identifiers.py b/tests/scripts/list_internal_identifiers.py index 2cbfdce8d5..445aeda352 100755 --- a/tests/scripts/list_internal_identifiers.py +++ b/tests/scripts/list_internal_identifiers.py @@ -37,7 +37,9 @@ def main(): "include/mbedtls/*_internal.h", "library/*.h", "tf-psa-crypto/core/*.h", - "tf-psa-crypto/drivers/builtin/src/*.h" + "tf-psa-crypto/drivers/builtin/src/*.h", + "tf-psa-crypto/platform/*.h", + "tf-psa-crypto/utilities/*.h", ])[0] result.sort(key=lambda x: x.name) From 32479c6a725762fcba58e0e2b59dc471c716060e Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 14 Feb 2026 10:53:23 +0100 Subject: [PATCH 08/11] cmake: Introduce TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS Signed-off-by: Ronald Cron --- CMakeLists.txt | 53 ++++++++++++++++++++++++++---------------- library/CMakeLists.txt | 5 ++-- tests/CMakeLists.txt | 10 ++++---- 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc122f5167..42e4ccb34d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -373,6 +373,20 @@ foreach(target IN LISTS tf_psa_crypto_library_targets) endif() endforeach(target) +# +# TF-PSA-Crypto directories with internal headers that are currently still +# consumed by Mbed TLS. When we have finished cleaning up this list should be +# empty. +# +set(TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/core + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/dispatch + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/extras + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/platform + ${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/utilities +) + add_subdirectory(library) add_subdirectory(pkgconfig) @@ -416,16 +430,16 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS) endif() target_include_directories(mbedtls_test PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include - PRIVATE ${MBEDTLS_FRAMEWORK_DIR}/tests/include - PRIVATE tests/include - PRIVATE include - PRIVATE tf-psa-crypto/include - PRIVATE tf-psa-crypto/drivers/builtin/include - PRIVATE tf-psa-crypto/drivers/everest/include - PRIVATE tf-psa-crypto/drivers/pqcp/include - PRIVATE library - PRIVATE tf-psa-crypto/core - PRIVATE tf-psa-crypto/drivers/builtin/src) + ${MBEDTLS_FRAMEWORK_DIR}/tests/include + tests/include + include + tf-psa-crypto/include + tf-psa-crypto/drivers/builtin/include + tf-psa-crypto/drivers/everest/include + tf-psa-crypto/drivers/pqcp/include + library + ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS} + ) # Request C11, needed for memory poisoning tests set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11) set_config_files_compile_definitions(mbedtls_test) @@ -453,16 +467,15 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS) endif() target_include_directories(mbedtls_test_helpers PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include - PRIVATE ${MBEDTLS_FRAMEWORK_DIR}/tests/include - PRIVATE tests/include - PRIVATE include - PRIVATE tf-psa-crypto/include - PRIVATE tf-psa-crypto/drivers/builtin/include - PRIVATE library - PRIVATE tf-psa-crypto/core - PRIVATE tf-psa-crypto/drivers/builtin/src - PRIVATE tf-psa-crypto/drivers/everest/include - PRIVATE tf-psa-crypto/drivers/pqcp/include + ${MBEDTLS_FRAMEWORK_DIR}/tests/include + tests/include + include + tf-psa-crypto/include + tf-psa-crypto/drivers/builtin/include + library + tf-psa-crypto/drivers/everest/include + tf-psa-crypto/drivers/pqcp/include + ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS} ) set_config_files_compile_definitions(mbedtls_test_helpers) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 5474e2cacf..f1b7c74aba 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -236,15 +236,14 @@ foreach(target IN LISTS target_libraries) add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support # Include public header files from /include, /tf-psa-crypto/include/ and # tf-psa-crypto/drivers/builtin/include/. Include private header files - # from /library, tf-psa-crypto/core/ and tf-psa-crypto/drivers/builtin/src/. + # from /library and ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}. target_include_directories(${target} PUBLIC $ $ $ $ PRIVATE ${MBEDTLS_DIR}/library/ - ${MBEDTLS_DIR}/tf-psa-crypto/core - ${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/src + ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS} # needed for generated headers ${CMAKE_CURRENT_BINARY_DIR}) set_config_files_compile_definitions(${target}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ec625234dc..09913b56e7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -177,11 +177,11 @@ function(add_test_suite suite_name) # them as PUBLIC. target_include_directories(test_suite_${data_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../framework/tests/include - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../library - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/core - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/src) + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${PROJECT_SOURCE_DIR}/framework/tests/include + ${PROJECT_SOURCE_DIR}/library + ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS} + ) # Request C11, which is needed for memory poisoning tests set_target_properties(test_suite_${data_name} PROPERTIES C_STANDARD 11) From aa024253d6b3713bfba9ea1d163b4f8b6407b595 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 27 Feb 2026 17:30:50 +0100 Subject: [PATCH 09/11] tests: make: Fix spaces instead of tab Signed-off-by: Ronald Cron --- tests/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index a34bc95f99..62a7b82e61 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -255,16 +255,16 @@ libtestdriver1.a: cp -Rf ../tf-psa-crypto/drivers/builtin ./libtestdriver1/tf-psa-crypto/drivers/builtin if [ -d ../tf-psa-crypto/dispatch ]; then \ cp -Rf ../tf-psa-crypto/dispatch ./libtestdriver1/tf-psa-crypto/dispatch; \ - fi + fi if [ -d ../tf-psa-crypto/extras ]; then \ cp -Rf ../tf-psa-crypto/extras ./libtestdriver1/tf-psa-crypto/extras; \ - fi + fi if [ -d ../tf-psa-crypto/platform ]; then \ cp -Rf ../tf-psa-crypto/platform ./libtestdriver1/tf-psa-crypto/platform; \ - fi + fi if [ -d ../tf-psa-crypto/utilities ]; then \ cp -Rf ../tf-psa-crypto/utilities ./libtestdriver1/tf-psa-crypto/utilities; \ - fi + fi cp -Rf ../tf-psa-crypto/scripts ./libtestdriver1/tf-psa-crypto # Set the test driver base (minimal) configuration. From 269b390bb4cb5303188af9b862780412933d670b Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 9 Mar 2026 08:22:51 +0100 Subject: [PATCH 10/11] components-platform.sh: Fix path of compiler directory Signed-off-by: Ronald Cron --- tests/scripts/components-platform.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/scripts/components-platform.sh b/tests/scripts/components-platform.sh index 2f3becf983..b68a4aeafc 100644 --- a/tests/scripts/components-platform.sh +++ b/tests/scripts/components-platform.sh @@ -468,16 +468,16 @@ component_build_arm_linux_gnueabi_gcc_arm5vte () { ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then - ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o + ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o fi if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then - ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o + ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o fi if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then - ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o + ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o fi if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then - ${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o + ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o fi } From bef136e607ee0a436ea9d0b56bf37d6401c81507 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 9 Mar 2026 08:23:53 +0100 Subject: [PATCH 11/11] Update framework pointer to the merge of PR 280 Signed-off-by: Ronald Cron --- framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework b/framework index e07b6643e8..9b92164c47 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit e07b6643e8db5fe2fdc20be288b91a2194316862 +Subproject commit 9b92164c47fdaecb2600b417733507e2a105c3a5