From 5c86b1775a5fdd1ca2ed56050c7b0fe1618ecc23 Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Mon, 26 Jun 2023 16:54:52 +0800 Subject: [PATCH] aes.c: use uint8_t for array of pow and log to save RAM Signed-off-by: Yanray Wang --- library/aes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/aes.c b/library/aes.c index 0a61d1b070..a90735aa0b 100644 --- a/library/aes.c +++ b/library/aes.c @@ -365,15 +365,15 @@ static int aes_init_done = 0; static void aes_gen_tables(void) { int i, x, y, z; - int pow[256]; - int log[256]; + uint8_t pow[256]; + uint8_t log[256]; /* * compute pow and log tables over GF(2^8) */ for (i = 0, x = 1; i < 256; i++) { - pow[i] = x; - log[x] = i; + pow[i] = (uint8_t) x; + log[x] = (uint8_t) i; x = MBEDTLS_BYTE_0(x ^ XTIME(x)); }