AddRoundKey XORs a round key into the mixed state. This lesson pins the key and output bytes.

highlighted = computed this step

Why the round key is XORed

AddRoundKey XORs the mixed state with the round key. The grid shows the final state for this single round.

stateround key\text{state}\oplus\text{round key}
AddRoundKeyAES state bytes shown as a column-major grid.AddRoundKey - addroundkeyrowc0c1c2c3r00xa40x680x6b0x02r10x9c0x9f0x5b0x6ar20x7f0x350xea0x50r30xf20x2b0x430x49

Pin the round key

The round key is 0xa0fafe1788542cb123a339392a6c7605.

0xa0fafe1788542cb123a339392a6c76050xa0fafe1788542cb123a339392a6c7605
AddRoundKeyAES state bytes shown as a column-major grid.AddRoundKey - addroundkeyrowc0c1c2c3r00xa40x680x6b0x02r10x9c0x9f0x5b0x6ar20x7f0x350xea0x50r30xf20x2b0x430x49

Read the one-round output

After XOR, the state is 0xa49c7ff2689f352b6b5bea43026a5049.

0xa49c7ff2689f352b6b5bea43026a50490xa49c7ff2689f352b6b5bea43026a5049
AddRoundKeyAES state bytes shown as a column-major grid.AddRoundKey - addroundkeyrowc0c1c2c3r00xa40x680x6b0x02r10x9c0x9f0x5b0x6ar20x7f0x350xea0x50r30xf20x2b0x430x49

Summary

AddRoundKey finishes this displayed AES round. NOTE: no-padding; no-side-channel; no-production; never-roll-your-own. Exact byte transforms of ONE AES round over GF(2^8); real AES with 128 runs 10 rounds with a key schedule inside a reviewed mode such as CBC or GCM.

round output pinned\text{round output pinned}
AddRoundKeyAES state bytes shown as a column-major grid.AddRoundKey - addroundkeyrowc0c1c2c3r00xa40x680x6b0x02r10x9c0x9f0x5b0x6ar20x7f0x350xea0x50r30xf20x2b0x430x49