AES starts by arranging one block into a column-major byte grid. This lesson pins the starting state.

highlighted = computed this step

Why AES uses a state grid

AES stores one block as sixteen bytes in a four-by-four grid. The grid is column-major, so each column is contiguous in the state bytes.

column-major state\text{column-major state}
AES state gridAES state bytes shown as a column-major grid.AES state grid - rawrowc0c1c2c3r00x190xa00x9a0xe9r10x3d0xf40xc60xf8r20xe30xe20x8d0x48r30xbe0x2b0x2a0x08

Pin the input state

The round input is 0x193de3bea0f4e22b9ac68d2ae9f84808.

0x193de3bea0f4e22b9ac68d2ae9f848080x193de3bea0f4e22b9ac68d2ae9f84808
AES state gridAES state bytes shown as a column-major grid.AES state grid - rawrowc0c1c2c3r00x190xa00x9a0xe9r10x3d0xf40xc60xf8r20xe30xe20x8d0x48r30xbe0x2b0x2a0x08

Why the layout matters

ShiftRows moves bytes by row, while MixColumns works down columns. The displayed grid makes those directions visible before the transforms start.

rows shift, columns mix\text{rows shift, columns mix}
AES state gridAES state bytes shown as a column-major grid.AES state grid - rawrowc0c1c2c3r00x190xa00x9a0xe9r10x3d0xf40xc60xf8r20xe30xe20x8d0x48r30xbe0x2b0x2a0x08

Summary

The state grid is the exact starting block. 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.

state bytes pinned\text{state bytes pinned}
AES state gridAES state bytes shown as a column-major grid.AES state grid - rawrowc0c1c2c3r00x190xa00x9a0xe9r10x3d0xf40xc60xf8r20xe30xe20x8d0x48r30xbe0x2b0x2a0x08