diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 94242f897..f08fdc8bd 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -175,9 +175,6 @@ typedef struct { uint8_t *info; size_t info_length; - psa_mac_operation_t hmac; - uint8_t prk[PSA_HASH_MAX_SIZE]; - uint8_t output_block[PSA_HASH_MAX_SIZE]; #if PSA_HASH_MAX_SIZE > 0xff #error "PSA_HASH_MAX_SIZE does not fit in uint8_t" #endif @@ -185,6 +182,9 @@ typedef struct uint8_t block_number; unsigned int state : 2; unsigned int info_set : 1; + uint8_t output_block[PSA_HASH_MAX_SIZE]; + uint8_t prk[PSA_HASH_MAX_SIZE]; + psa_mac_operation_t hmac; } psa_hkdf_key_derivation_t; #endif /* MBEDTLS_PSA_BUILTIN_ALG_HKDF */ diff --git a/library/psa_crypto_aead.c b/library/psa_crypto_aead.c index 356679c38..2769028d0 100644 --- a/library/psa_crypto_aead.c +++ b/library/psa_crypto_aead.c @@ -32,6 +32,8 @@ typedef struct { + psa_algorithm_t core_alg; + uint8_t tag_length; union { unsigned dummy; /* Make the union non-empty even with no supported algorithms. */ @@ -45,11 +47,9 @@ typedef struct mbedtls_chachapoly_context chachapoly; #endif /* MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305 */ } ctx; - psa_algorithm_t core_alg; - uint8_t tag_length; } aead_operation_t; -#define AEAD_OPERATION_INIT {{0}, 0, 0} +#define AEAD_OPERATION_INIT {0, 0, {0}} static void psa_aead_abort_internal( aead_operation_t *operation ) {