diff --git a/aes/aes.cpp b/aes/aes.cpp index 669b72e..942f55b 100644 --- a/aes/aes.cpp +++ b/aes/aes.cpp @@ -11,6 +11,8 @@ http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf */ /* AES Constants */ +// AES polynomial +const uint16_t POLYNOMIAL = 0b100011011; // forward sbox const uint8_t SBOX[256] = { @@ -103,7 +105,7 @@ uint8_t xtime(uint8_t a) { uint8_t mask; if (a & 0b10000000) { - mask = 0x1B; + mask = POLYNOMIAL & 0xFF; } else { mask = 0x00;