Crypto: Reduce diverging PSA Crypto headers between TF-M and Mbed TLS
Reduce divergence between PSA Crypto headers available in TF-M and
Mbed TLS.
* Consistently use mbedtls_svc_key_id_t for psa_key_id_t in the headers
* Concentrate IMPDEF behaviour in crypto_struct and crypto_platform
* Make sure the same config file is used for client and server views,
i.e. make sure that ENCODES_OWNER config define is passed in a
dedicated compile switch privately to the crypto service
* Add \emptydescription for Doxygen when required
* clean up the psa_crypto_config cmake target
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Ia65c9d267ac9dc0441ea484408c5501c1558e580
diff --git a/interface/include/psa/crypto_struct.h b/interface/include/psa/crypto_struct.h
index 3616f07..50a4cf2 100644
--- a/interface/include/psa/crypto_struct.h
+++ b/interface/include/psa/crypto_struct.h
@@ -135,11 +135,11 @@
}
static inline void psa_set_key_id(psa_key_attributes_t *attributes,
- psa_key_id_t key)
+ mbedtls_svc_key_id_t key)
{
psa_key_lifetime_t lifetime = attributes->client.lifetime;
- attributes->client.id = key;
+ attributes->client.id = (psa_key_id_t)key;
if( PSA_KEY_LIFETIME_IS_VOLATILE(lifetime))
{
@@ -150,10 +150,10 @@
}
}
-static inline psa_key_id_t psa_get_key_id(
+static inline mbedtls_svc_key_id_t psa_get_key_id(
const psa_key_attributes_t *attributes)
{
- return attributes->client.id;
+ return (mbedtls_svc_key_id_t)attributes->client.id;
}
static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes,