In: Computer Science
Show the first eight words of the AES key expansion for a 128-bit key of all ONES
W0 = ff ff ff ff
W1 = ff ff ff ff
W2 = ff ff ff ff
W3 = ff ff ff ff
calculating W4
i = 4, temp = Wi-1 = W3 = ffffffff
RotWord(temp) = ffffffff (rotation)
SubWord(RotWord(temp)) = 16161616 (S-box )
Rcon[4/4] = 01000000 (round constant table)
XORing SubWord withRcon[4/4] :
temp =16161616 XOR 01000000
= 17161616
XORing W4-4 with temp we get W4 ,
W4 = W0 XOR temp
= ffffffff XOR 17161616
= e8 e9 e9 e9
Next three keys are calculated like above by XORing with 0xffffffff.
=> W5 = 17 16 16 16
=> W6 = e8 e9 e9 e9
=> W7 = 17 16 16 16
Calculating W8
i = 8, temp = Wi-1 = W7 = 17161616
RotWord(temp) = 16161617
SubWord(RotWord(temp)) = 474747f0 (S-box table)
Rcon[8/4] = 02000000 (round constant table)
XORing SubWord withRcon[8/4] :
temp = 474747f0 XOR 02000000
= 454747f0
XORing W8-4 with temp we get W8
W8 = W4 XOR temp
= e8e9e9e9 XOR 454747f0
= ad ae ae 19
Next three keys are calculated like above by XORing with appropriate previous values
=> W9 = ba b8 b8 0f
=> W10 = 52 51 51 e6
=> W11 = 45 4747 f0