5
$\begingroup$

In this file on GitHub, from lines 154 to 169, there are twelve arrays of constants that I've not seen in other AES implementations. How do they relate to the algorithm?

$\endgroup$
2
  • $\begingroup$ most implementations will generate the tables at runtime, and many will use a single table and then do rotations, instead of doing rotations first with multiple tables like the link, as that uses much more memory and about the same amount of computation $\endgroup$ Commented Feb 6, 2017 at 12:04
  • $\begingroup$ in my implementation I use 8 tables for encryption, 4 for the MDS and 4 for the final subbytes/shiftrows, as you can see from the link, each table occupies 1KB of RAM. I do not use an additional set of tables for decryption key expansion, since I only do that once when the key is changed $\endgroup$ Commented Feb 6, 2017 at 12:36

1 Answer 1

6
$\begingroup$

The tables represent the composition of some of the routines from the round function. These tables are used because they facilitate an efficient implementation. These slides and the "Advanced Implementation" section this blog post do a good job of explaining. The table based implementation was also mentioned in the Rijndael AES proposal as well, if I recall correctly.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.