From 8005e8a167c196f1b10bdaf924c14eadc47bf629 Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Mon, 19 Apr 2021 14:46:54 +0100 Subject: [PATCH] Shrink psa_pake_side_t to uint8_t Signed-off-by: Janos Follath --- include/psa/crypto_types.h | 2 +- include/psa/crypto_values.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/psa/crypto_types.h b/include/psa/crypto_types.h index 8635afd74..3ec77f28f 100644 --- a/include/psa/crypto_types.h +++ b/include/psa/crypto_types.h @@ -389,7 +389,7 @@ typedef uint16_t psa_key_derivation_step_t; * Encodes which side of the algorithm is being executed. For more information * see the documentation of individual PSA_PAKE_SIDE_XXX constants. */ -typedef uint16_t psa_pake_side_t; +typedef uint8_t psa_pake_side_t; /** Encoding of input and output indicators for PAKE. * diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index 21d0202ff..0e3d9231a 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -2477,7 +2477,7 @@ static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key ) * need this, either #PSA_PAKE_SIDE_FIRST or #PSA_PAKE_SIDE_SECOND are * accepted. */ -#define PSA_PAKE_SIDE_FIRST ((psa_pake_side_t)0x0001) +#define PSA_PAKE_SIDE_FIRST ((psa_pake_side_t)0x01) /** The second peer in a balanced PAKE. * @@ -2486,19 +2486,19 @@ static inline int mbedtls_svc_key_id_is_null( mbedtls_svc_key_id_t key ) * need this, either #PSA_PAKE_SIDE_FIRST or #PSA_PAKE_SIDE_SECOND are * accepted. */ -#define PSA_PAKE_SIDE_SECOND ((psa_pake_side_t)0x0002) +#define PSA_PAKE_SIDE_SECOND ((psa_pake_side_t)0x02) /** The client in an augmented PAKE. * * Augmented PAKE algorithms need to differentiate between client and server. */ -#define PSA_PAKE_SIDE_CLIENT ((psa_pake_side_t)0x0101) +#define PSA_PAKE_SIDE_CLIENT ((psa_pake_side_t)0x11) /** The server in an augmented PAKE. * * Augmented PAKE algorithms need to differentiate between client and server. */ -#define PSA_PAKE_SIDE_SERVER ((psa_pake_side_t)0x0102) +#define PSA_PAKE_SIDE_SERVER ((psa_pake_side_t)0x12) /** The PAKE uses elliptic curves. *