diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/aes_decrypt.c | 1 | ||||
-rw-r--r-- | lib/aes_encrypt.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/aes_decrypt.c b/lib/aes_decrypt.c index a1b5272..d32b491 100644 --- a/lib/aes_decrypt.c +++ b/lib/aes_decrypt.c @@ -38,6 +38,7 @@ #include <utils.h> #define ZERO_BYTE 0x00 + static const uint8_t inv_sbox[256] = { 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, diff --git a/lib/aes_encrypt.c b/lib/aes_encrypt.c index 3011394..909314a 100644 --- a/lib/aes_encrypt.c +++ b/lib/aes_encrypt.c @@ -62,7 +62,10 @@ static const uint8_t sbox[256] = { 0xb0, 0x54, 0xbb, 0x16 }; -#define rotword(a) (((a)>>24)|((a)<<8)) +static inline uint32_t rotword (uint32_t a) { + return (((a)>>24)|((a)<<8)); +} + #define subbyte(a,o) (sbox[((a)>>(o))&0xff]<<(o)) #define subword(a) (subbyte(a,24)|subbyte(a,16)|subbyte(a,8)|subbyte(a,0)) |