Move "libtestdriver1_" aliases to test_driver_common.h

Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
Ronald Cron
2025-12-05 14:45:32 +01:00
parent 50bd6aae50
commit ca68ad8377
9 changed files with 23 additions and 9 deletions
@@ -25,4 +25,27 @@
/* *INDENT-ON* */
/*
* In the libtestdriver1 library used in Mbed TLS 3.6 and 4.0 for driver
* dispatch testing, the PSA core code is cloned and all identifiers starting
* with MBEDTLS_, PSA_, mbedtls_, or psa_ are prefixed with `libtestdriver1_`.
* As a result, libtestdriver1 drivers use, for example,
* `libtestdriver1_psa_key_attributes_t` instead of `psa_key_attributes_t`.
*
* With the generated test drivers introduced in TF-PSA-Crypto between 1.0
* and 1.1, only the modules under `drivers/builtin` are cloned, not the PSA
* core. The generated test drivers therefore do not use prefixed PSA core
* identifiers. For example, they use the `psa_key_attributes_t` type, just
* like the built-in drivers.
*
* To make driver dispatch work in both cases, we define certain
* `libtestdriver1_xyz` identifiers as aliases of the corresponding `xyz`
* identifiers in the latter case.
*/
#if defined(TF_PSA_CRYPTO_TEST_LIBTESTDRIVER1)
typedef psa_key_attributes_t libtestdriver1_psa_key_attributes_t;
typedef psa_crypto_driver_pake_inputs_t libtestdriver1_psa_crypto_driver_pake_inputs_t;
typedef psa_crypto_driver_pake_step_t libtestdriver1_psa_crypto_driver_pake_step_t;
#endif
#endif /* test_driver_common.h */