AES key schedule

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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

Values of Template:Mvar in hexadecimal
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

rconi=[rci008008008]

where Template:Mvar is an eight-bit value defined as :

rci={1if i=12rci1if i>1 and rci1<8016(((2rci1)11B16) mod 10016)if i>1 and rci18016

where is the bitwise XOR operator and constants such as 0016Script error: No such module "Check for unknown parameters". and 11B16Script error: No such module "Check for unknown parameters". are given in hexadecimal. Equivalently:

rci=xi1

where the bits of Template:Mvar are treated as the coefficients of an element of the finite field GF(2)[x]/(x8+x4+x3+x+1), so that e.g. rc10=3616=001101102 represents the polynomial x5+x4+x2+x.

AES uses up to rcon10Script error: No such module "Check for unknown parameters". for AES-128 (as 11 round keys are needed), up to rcon8Script error: No such module "Check for unknown parameters". for AES-192, and up to rcon7Script error: No such module "Check for unknown parameters". for AES-256.[note 2]

The key schedule

File:AES-Key Schedule 128-bit key.svg
AES key schedule for a 128-bit key.

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
  • K0Script error: No such module "Check for unknown parameters"., K1Script error: No such module "Check for unknown parameters"., ... KN-1Script error: No such module "Check for unknown parameters". 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]
  • W0Script error: No such module "Check for unknown parameters"., W1Script error: No such module "Check for unknown parameters"., ... W4R-1Script error: No such module "Check for unknown parameters". as the 32-bit words of the expanded key[note 4]

Also define RotWordScript error: No such module "Check for unknown parameters". as a one-byte left circular shift:Template:Refn

RotWord([b0b1b2b3])=[b1b2b3b0]

and SubWordScript error: No such module "Check for unknown parameters". as an application of the AES S-box to each of the four bytes of the word:

SubWord([b0b1b2b3])=[S(b0)S(b1)S(b2)S(b3)]

Then for i=04R1:

Wi={Kiif i<NWiNSubWord(RotWord(Wi1))rconi/Nif iN and i0(modN)WiNSubWord(Wi1)if iNN>6, and i4(modN)WiNWi1otherwise.

Notes

<templatestyles src="Reflist/styles.css" />

  1. Non-AES Rijndael variants require up to 256 bits of expanded key per round
  2. The Rijndael variants with larger block sizes use more of these constants, up to rcon29Script error: No such module "Check for unknown parameters". 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 i ≥ 11Script error: No such module "Check for unknown parameters". are: 6C, D8, AB, 4D, 9A, 2F, 5E, BC, 63, C6, 97, 35, 6A, D4, B3, 7D, FA, EF and C5
  3. Other Rijndael variants require max(N, B) + 7Script error: No such module "Check for unknown parameters". round keys, where Template:Mvar is the block size in words
  4. Other Rijndael variants require BRScript error: No such module "Check for unknown parameters". words of expanded key, where Template:Mvar is the block size in words

Script error: No such module "Check for unknown parameters".

References

<templatestyles src="Reflist/styles.css" />

Script error: No such module "Check for unknown parameters".

External links