Cryptography Reference
In-Depth Information
4.9.1.2 ShiftRows
The
ShiftRows
operation performs a cyclical shift of each row of the state. Each row is shifted by one more
value than the previous row (see
Figure 4-12
)
:
Figure 4-12
The Rijndael
ShiftRows
operation.
1. The first row is left intact (no rotation).
2. The second row is rotated once to the left.
3. The third row is rotated twice to the left.
4. The fourth row is rotated three times to the left.
4.9.1.3 MixColumns
The
MixColumns
operation is the most complicated part of the AES algorithm.
Although I won't go into the nitty-gritty of the mathematics of multiplication over GF(2
8
)(the finite field of
size 2
8
, also written as
2
8
), in the case of AES, this essentially means that we will multiply two 8-bit numbers,
and take the remainder modulo 283 (which is
100011011
in binary), using
binary XOR long division
, not
normal arithmetic. This is the same as doing normal division, except that instead of successively subtracting,
we use binary XOR. Also, while in normal subtraction, we only subtract if we are dividing a smaller number
into a larger number at each stage, whereas with XOR, we only divide if they have the same number of binary
digits (so either number can be greater). So that we don't confuse this with normal arithmetic multiplication, I
will denote the operation as • (as done in the specification [7]).
For example, I will show how to do this with the AES example in Reference [7], calculating 87 • 131
(or,
01010111
•
10000011)
. We first multiply the two numbers as usual, obtaining 11,397, or
1010110111001
. We then perform the long division to obtain the remainder when divided by
10011011:
For the
MixColumns
operation, we are going to take each column and perform a matrix multiplication, where
the multiplication is the • operation shown above. The operation will be
Search WWH ::
Custom Search