From eb65fec0235687b358a0d404b3b8abd038e65b0b Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Sat, 24 Jun 2023 14:29:25 +0100 Subject: [PATCH] Fix use of enum in a bitfield Signed-off-by: Dave Rodgman --- include/mbedtls/cipher.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/cipher.h b/include/mbedtls/cipher.h index 02bca32f2..39579d547 100644 --- a/include/mbedtls/cipher.h +++ b/include/mbedtls/cipher.h @@ -278,13 +278,15 @@ typedef struct mbedtls_cipher_info_t { /** Index to LUT for base cipher information and functions. */ uint8_t MBEDTLS_PRIVATE(base_idx) : 5; - /** Full cipher identifier. For example, - * MBEDTLS_CIPHER_AES_256_CBC. + /** Full cipher identifier (as per mbedtls_cipher_type_t). + * For example, MBEDTLS_CIPHER_AES_256_CBC. */ - mbedtls_cipher_type_t MBEDTLS_PRIVATE(type) : 7; + uint8_t MBEDTLS_PRIVATE(type) : 7; - /** The cipher mode. For example, MBEDTLS_MODE_CBC. */ - mbedtls_cipher_mode_t MBEDTLS_PRIVATE(mode) : 4; + /** The cipher mode (as per mbedtls_cipher_mode_t). + * For example, MBEDTLS_MODE_CBC. + */ + uint8_t MBEDTLS_PRIVATE(mode) : 4; /** The cipher key length, in bits. This is the * default length for variable sized ciphers.