From 606a67724dea8ab3d52d52456722dc593cf8ac8d Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 27 Jan 2022 15:49:15 -0800 Subject: [PATCH] altos: AES code was storing bytes in an int array The only operations using these values are logic using bytes, not arithmetic, so shrinking the size of the elements should have no effect on operation. This saves space *and* eliminates a type conversion warning from -Wconversion. Signed-off-by: Keith Packard --- src/aes/ao_aes_tables.c | 2 +- src/aes/ao_aes_tables.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aes/ao_aes_tables.c b/src/aes/ao_aes_tables.c index 1bca227c..311b7b4e 100644 --- a/src/aes/ao_aes_tables.c +++ b/src/aes/ao_aes_tables.c @@ -716,7 +716,7 @@ const word8x4 M1[4][256] = { }, }; -const int xrcon[30] = { +const word8 xrcon[30] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, diff --git a/src/aes/ao_aes_tables.h b/src/aes/ao_aes_tables.h index 73bcf3fb..cc005bfd 100644 --- a/src/aes/ao_aes_tables.h +++ b/src/aes/ao_aes_tables.h @@ -4,7 +4,7 @@ extern const word8x4 M0[4][256]; extern const word8x4 M1[4][256]; -extern const int xrcon[30]; +extern const word8 xrcon[30]; extern const word8 xS[256]; extern const word8 xSi[256]; -- 2.30.2