Cryptography Reference
In-Depth Information
11.8 Encryption as a Complete Process
Encryption with Rijndael is encapsulated in the following pseudocode according
to [DaRi], Sections 4.2-4.4. The arguments are passed as pointers to fields of
bytes or 4-byte words. The interpretation of the fields, variables, and functions
employed is provided in Tables 11-15 through 11-17.
Table 11-15. Interpretation of variables
Variable
Interpretation
Nk
length
L
k
of the secret user key in 4-byte words
Nb
block length
L
b
in 4-byte words
Nr
round number
L
r
according to the table above
Table 11-16. Interpretation of fields
Variables
Size in bytes
Interpretation
CipherKey
4*Nk
secret user key
ExpandedKey
4*Nb * (Nr+1)
field of 4-byte words to hold the round key
Rcon
4*Nb * (Nr+1)/Nk
field of 4-byte words as constant
c
(
j
) := (rc(
j
)
,
0
,
0
,
0)
a
State
4*Nb
field for input and output of plain text
and encrypted blocks
RoundKey
4*Nb
round key, segment of
ExpandedKey
a. It suffices to store the constants
rc
(
j
)
in a field of size
Nb * (Nr+1)/Nk
≤
30 bytes. If the field
begins with 0, this byte is unoccupied, since the index
j
begins with 1. It then is then 31 bytes long.
Table 11-17. Interpretation of functions
Function
Interpretation
KeyExpansion
generation of round key
→
RotBytes
left rotation of a 4-byte word by 1 byte:
(abcd)
(bcda)
SubBytes
S-box substitution
S
of all bytes of the passed field
Round
regular round
FinalRound
last round without
MixColumns
ShiftRows
ShiftRows
transformation
MixColumns
MixColumns
transformation
AddRoundKey
addition of a round key