Use bit-fields

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-06-24 10:53:37 +01:00
parent f9c9c92a40
commit 48d13c5143

View File

@ -275,10 +275,10 @@ typedef struct mbedtls_cipher_info_t {
/** Full cipher identifier. For example, /** Full cipher identifier. For example,
* MBEDTLS_CIPHER_AES_256_CBC. * MBEDTLS_CIPHER_AES_256_CBC.
*/ */
mbedtls_cipher_type_t MBEDTLS_PRIVATE(type); mbedtls_cipher_type_t MBEDTLS_PRIVATE(type) : 7;
/** The cipher mode. For example, MBEDTLS_MODE_CBC. */ /** The cipher mode. For example, MBEDTLS_MODE_CBC. */
mbedtls_cipher_mode_t MBEDTLS_PRIVATE(mode); mbedtls_cipher_mode_t MBEDTLS_PRIVATE(mode) : 4;
/** The cipher key length, in bits. This is the /** The cipher key length, in bits. This is the
* default length for variable sized ciphers. * default length for variable sized ciphers.
@ -299,10 +299,10 @@ typedef struct mbedtls_cipher_info_t {
* MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the * MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the
* cipher supports variable IV or variable key sizes, respectively. * cipher supports variable IV or variable key sizes, respectively.
*/ */
uint8_t MBEDTLS_PRIVATE(flags); uint8_t MBEDTLS_PRIVATE(flags) : 2;
/** The block size, in Bytes. */ /** The block size, in bytes. */
uint8_t MBEDTLS_PRIVATE(block_size); uint8_t MBEDTLS_PRIVATE(block_size) : 5;
/** Struct for base cipher information and functions. */ /** Struct for base cipher information and functions. */
const mbedtls_cipher_base_t *MBEDTLS_PRIVATE(base); const mbedtls_cipher_base_t *MBEDTLS_PRIVATE(base);