From 8a09ca9d94da0963e003b7f28ddfc48e5fff5359 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Sun, 21 Mar 2021 10:14:08 +0000 Subject: [PATCH] PSA PAKE: Add dummy operation context Signed-off-by: Janos Follath --- include/psa/crypto_struct.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index a4e6cca8e..f289caf16 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -494,6 +494,25 @@ static inline struct psa_pake_cipher_suite_s psa_pake_cipher_suite( return cipher_suite; } + +struct psa_pake_operation_s +{ + psa_algorithm_t alg; + union + { + /* Make the union non-empty even with no supported algorithms. */ + uint8_t dummy; + } ctx; +}; + +/* This only zeroes out the first byte in the union, the rest is unspecified. */ +#define PSA_PAKE_OPERATION_INIT {0, {0}} +static inline struct psa_pake_operation_s psa_pake_operation_init( void ) +{ + const struct psa_pake_operation_s v = PSA_PAKE_OPERATION_INIT; + return( v ); +} + #ifdef __cplusplus } #endif