From: Keith Packard Date: Thu, 27 Jan 2022 23:49:15 +0000 (-0800) Subject: altos: AES code was storing bytes in an int array X-Git-Tag: 1.9.10.4~58 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=606a67724dea8ab3d52d52456722dc593cf8ac8d;hp=59cbf80e63b4c88de45e59c6e3d209f99910fcf3 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 --- 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];