Key Expansion Key size = 192 bits = 6 x 32 bits = 6 words (Nk=6) Round key size = 128 bits ki – 32-bit words k0 k1 k2 k3 k4 k5 Key K k0 k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12 k13 k14 k15 k16 …. Round Key 0 K0 Round Key 1 K1 Round Key 2 K2 Round Key 3 K3 …. 4 words
Key Expansion (1) ki = ki-Nk ki-1 Nk=6 …. k0 k1 k2 k3 k4 k5 k6 k7 k8
Key Expansion (2) ki = ki-Nk f(ki-1) Nk=6 …. RotWord RotWord(a,b,c,d)=(b,c,d,a) SubWord SubWord(a,b,c,d)=(S[a],S[b],S[c],S[d]) Rcon[i/Nk] f Rcon[j] = (e[j], 00,00,00) ki = ki-Nk f(ki-1)
Pseudocode for Key Expansion Using Notation from the Homework Specification for i=0 to Nk-1 do ki = wi end for for i=Nk to (r+1)*4-1 do if i mod Nk = 0 do ki = ki-Nk ⊕ SubWord(RotWord(ki-1)) ⊕ Rconi/Nk elsif Nk=8 and i mod Nk = 4 do ki = ki-Nk ⊕ SubWord(ki-1) else ki = ki-Nk ⊕ ki-1 end if
Block Diagram Notation: Sub = SubWord Rot = RotWord
Pseudocode for Key Expansion Using Notation from the Key Expansion Examples