From baa266c1dcc421ea6ffbbc535e1ec7c3cdd1d12a Mon Sep 17 00:00:00 2001 From: Julian Arevalo Date: Mon, 20 May 2024 09:14:02 +0200 Subject: [PATCH 1/2] lib_cxng: use types with fixed size for portability between 32/64 bit Avoid unit tests errors that are run on x86 64 bit --- include/ox_aes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ox_aes.h b/include/ox_aes.h index b702e368c..f09cf751d 100644 --- a/include/ox_aes.h +++ b/include/ox_aes.h @@ -76,8 +76,8 @@ * @details Such container should be initialized with #cx_aes_init_key_no_throw. */ struct cx_aes_key_s { - size_t size; ///< key size - uint8_t keys[32]; ///< key value + uint32_t size; ///< key size + uint8_t keys[32]; ///< key value }; /** Convenience type. See #cx_aes_key_s. */ typedef struct cx_aes_key_s cx_aes_key_t; From 989963226717da2ef154661954ed3c5c0381256b Mon Sep 17 00:00:00 2001 From: Julian Arevalo Date: Mon, 20 May 2024 09:15:13 +0200 Subject: [PATCH 2/2] lib_cxng: use types that clearly express their width --- lib_cxng/include/lcx_cipher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_cxng/include/lcx_cipher.h b/lib_cxng/include/lcx_cipher.h index e007031e1..415ed58b2 100644 --- a/lib_cxng/include/lcx_cipher.h +++ b/lib_cxng/include/lcx_cipher.h @@ -42,8 +42,8 @@ typedef enum { /** Generic key structure */ typedef struct { - unsigned int size; - unsigned char keys[32]; + uint32_t size; + uint8_t keys[32]; } cipher_key_t; /** Base cipher information */