AES key schedule
Template:Short description The Advanced Encryption Standard uses a key schedule to expand a short key into a number of separate round keys. The three AES variants have a different number of rounds. Each variant requires a separate 128-bit round key for each round plus one more.[note 1] The key schedule produces the needed round keys from the initial key.
Round constants
| Template:Mvar | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Template:Mvar | 01 | 02 | 04 | 08 | 10 | 20 | 40 | 80 | 1B | 36 |
The round constant Template:Mvar for round Template:Mvar of the key expansion is the 32-bit word:Template:Refn
where Template:Mvar is an eight-bit value defined as :
where is the bitwise XOR operator and constants such as Template:Math and Template:Math are given in hexadecimal. Equivalently:
where the bits of Template:Mvar are treated as the coefficients of an element of the finite field , so that e.g. represents the polynomial .
AES uses up to Template:Math for AES-128 (as 11 round keys are needed), up to Template:Math for AES-192, and up to Template:Math for AES-256.[note 2]
The key schedule

Define:
- Template:Mvar as the length of the key in 32-bit words: 4 words for AES-128, 6 words for AES-192, and 8 words for AES-256
- Template:Math, Template:Math, ... Template:Math as the 32-bit words of the original key
- Template:Mvar as the number of round keys needed: 11 round keys for AES-128, 13 keys for AES-192, and 15 keys for AES-256[note 3]
- Template:Math, Template:Math, ... Template:Math as the 32-bit words of the expanded key[note 4]
Also define Template:Math as a one-byte left circular shift:Template:Refn
and Template:Math as an application of the AES S-box to each of the four bytes of the word:
Then for :
Notes
References
External links
- Description of Rijndael's key schedule
- schematic view of the key schedule for 128 and 256 bit keys for 160-bit keys on Cryptography Stack Exchange
- ↑ Non-AES Rijndael variants require up to 256 bits of expanded key per round
- ↑ The Rijndael variants with larger block sizes use more of these constants, up to Template:Math for Rijndael with 128-bit keys and 256 bit blocks (needs 15 round keys of each 256 bit, which means 30 full rounds of key expansion, which means 29 calls to the key schedule core using the round constants). The remaining constants for Template:Math are: 6C, D8, AB, 4D, 9A, 2F, 5E, BC, 63, C6, 97, 35, 6A, D4, B3, 7D, FA, EF and C5
- ↑ Other Rijndael variants require Template:Math round keys, where Template:Mvar is the block size in words
- ↑ Other Rijndael variants require Template:Math words of expanded key, where Template:Mvar is the block size in words
<ref> tags exist for a group named "note", but no corresponding <references group="note"/> tag was found.