From e7cde181ea393d20f08da845efb0b3f54b25d6ae Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 5 Jan 2023 19:06:58 +0100 Subject: [PATCH] psa: include: Move some Mbed TLS headers The structures related to CMAC, GCM, CCM and CHACHAPOLY operations are defined in crypto_builtin_composites.h not in crypto_struct.h. Thus move the cmac.h, gcm.h, ccm.h and chachapoly.h header inclusions from crypto_struct.h to crypto_builtin_composites.h. Signed-off-by: Ronald Cron --- include/psa/crypto_builtin_composites.h | 7 +++++-- include/psa/crypto_struct.h | 5 ----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/psa/crypto_builtin_composites.h b/include/psa/crypto_builtin_composites.h index 932c503667..3ba18b3977 100644 --- a/include/psa/crypto_builtin_composites.h +++ b/include/psa/crypto_builtin_composites.h @@ -36,6 +36,11 @@ #include +#include "mbedtls/cmac.h" +#include "mbedtls/gcm.h" +#include "mbedtls/ccm.h" +#include "mbedtls/chachapoly.h" + /* * MAC multi-part operation definitions. */ @@ -57,8 +62,6 @@ typedef struct { #define MBEDTLS_PSA_HMAC_OPERATION_INIT { 0, PSA_HASH_OPERATION_INIT, { 0 } } #endif /* MBEDTLS_PSA_BUILTIN_ALG_HMAC */ -#include "mbedtls/cmac.h" - typedef struct { psa_algorithm_t MBEDTLS_PRIVATE(alg); union { diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 934bc176ef..ba9875fa92 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -70,11 +70,6 @@ extern "C" { * in each of its header files. */ #include "mbedtls/build_info.h" -#include "mbedtls/cmac.h" -#include "mbedtls/gcm.h" -#include "mbedtls/ccm.h" -#include "mbedtls/chachapoly.h" - /* Include the context definition for the compiled-in drivers for the primitive * algorithms. */ #include "psa/crypto_driver_contexts_primitives.h"