altos: AES code was storing bytes in an int array
authorKeith Packard <keithp@keithp.com>
Thu, 27 Jan 2022 23:49:15 +0000 (15:49 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 27 Jan 2022 23:49:15 +0000 (15:49 -0800)
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 <keithp@keithp.com>
src/aes/ao_aes_tables.c
src/aes/ao_aes_tables.h

index 1bca227c1b9d92c680f36fafb783b12445daa87d..311b7b4e158a25121263f451760280fdadbf503a 100644 (file)
@@ -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, 
index 73bcf3fbbab748dd6183f60662f22497cea6c969..cc005bfd90b657837c08077e990ae3af351f5f83 100644 (file)
@@ -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];