2026-03-14
All the internal operations of AES are based on finite fields.
The field is the one that's most important for AES, since that has exactly the number of bytes in it.
The irreducible polynomial used for multiplication is defined in the standard, and is
Note
The addition is in the galois field, hence it's XOR.
In the last round there's no MixColumns. The individual steps proceed as follows:
The SBox is a 16 x 16 matrix where each bytes first 4 bits are used for the row and the last 4 bytes are used for the column. The S-Box is actually two mathematical steps, the multiplicative inverse of the byte in the field, and then an affine transformation on the resulting byte treated as a bit vector. The steps are not very relevant, since this can be precomputed and stored, and thus the result is called the S-Box or the substitution box. What the steps do tell, however, is the fact that this has very strong non-identity properties. There are no fixed points and correlation is low later on.
The 0th row in the 4x4 data matrix is not shifted at all, the first is shifted by one column to the left (wrapping around), second by two, and third by 3.
We multiply each column by a specific matrix, which has [0x2, 0x3, 0x1, 0x1] and in the subsequent rows is shifted one to the right. The matrix multiplication results in each element being a sum of products, the sum and product here being in the galois field.
This is for AES-128. The other key sizes follow roughly the same mechanism.
First, the 128-bit key is split into 4 32-bit keys. Then, the keys are computed as follows (from 0 to 10):
belongs to 1 to 10, and belongs to 1 to 3. The initial 4 keys are obtained from splitting the master key, and are used for key-whitening.
is a messed up function that takes in 4 input bytes, and gives 4 output bytes. It takes the input, rotates it by a byte, performs S-Box, then adds a specific round coefficient.