diff --git a/include/ox_aes.h b/include/ox_aes.h index 2ee7b87f8..e41d1b2ae 100644 --- a/include/ox_aes.h +++ b/include/ox_aes.h @@ -67,8 +67,11 @@ #include "decorators.h" /** Block size of the AES in bytes. */ -#define CX_AES_BLOCK_SIZE 16 -#define CX_AES_128_KEY_LEN 16 +#define CX_AES_BLOCK_SIZE (16U) +#define CX_AES_128_KEY_LEN (16U) +#define CX_AES_192_KEY_LEN (24U) +#define CX_AES_256_KEY_LEN (32U) +#define CX_AES_MAX_KEY_LEN CX_AES_256_KEY_LEN /** * @brief AES key container. @@ -76,8 +79,8 @@ * @details Such container should be initialized with #cx_aes_init_key_no_throw. */ struct cx_aes_key_s { - uint32_t size; ///< key size - uint8_t keys[32]; ///< key value + uint32_t size; ///< key size + uint8_t keys[CX_AES_MAX_KEY_LEN]; ///< key value }; /** Convenience type. See #cx_aes_key_s. */ typedef struct cx_aes_key_s cx_aes_key_t;