fbpx
Wikipedia

AES key schedule

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 edit

Values of rci in hexadecimal
i 1 2 3 4 5 6 7 8 9 10
rci 01 02 04 08 10 20 40 80 1B 36

The round constant rconi for round i of the key expansion is the 32-bit word:[note 2]

 

where rci is an eight-bit value defined as :

 

where   is the bitwise XOR operator and constants such as 0016 and 11B16 are given in hexadecimal. Equivalently:

 

where the bits of rci are treated as the coefficients of an element of the finite field  , so that e.g.   represents the polynomial  .

AES uses up to rcon10 for AES-128 (as 11 round keys are needed), up to rcon8 for AES-192, and up to rcon7 for AES-256.[note 3]

The key schedule edit

 
AES key schedule for a 128-bit key.

Define:

  • N 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
  • K0, K1, ... KN-1 as the 32-bit words of the original key
  • R 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 4]
  • W0, W1, ... W4R-1 as the 32-bit words of the expanded key[note 5]

Also define RotWord as a one-byte left circular shift:[note 6]

 

and SubWord as an application of the AES S-box to each of the four bytes of the word:

 

Then for  :

 

Notes edit

  1. ^ Non-AES Rijndael variants require up to 256 bits of expanded key per round
  2. ^ In FIPS-197 the   value is the least significant byte at index 0
  3. ^ The Rijndael variants with larger block sizes use more of these constants, up to rcon29 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 ≥ 11 are: 6C, D8, AB, 4D, 9A, 2F, 5E, BC, 63, C6, 97, 35, 6A, D4, B3, 7D, FA, EF and C5
  4. ^ Other Rijndael variants require max(N, B) + 7 round keys, where B is the block size in words
  5. ^ Other Rijndael variants require BR words of expanded key, where B is the block size in words
  6. ^ Rotation is opposite of byte order direction. FIPS-197 byte addresses in arrays are increasing from left to right[ref 1] in little endian but rotation is from right to left. In AES-NI[ref 2] and in the Linux kernel's lib/crypto/aes.c[ref 3], the byte ordering is increasing from right to left in little endian but rotation is from left to right.

References edit

  • FIPS PUB 197: the official AES standard (PDF file)
  1. ^ "Federal Information Processing Standards Publication 197 November 26, 2001 Announcing the ADVANCED ENCRYPTION STANDARD (AES)" (PDF). p. 8. Retrieved 2020-06-16.
  2. ^ "Intel® Advanced Encryption Standard (AES) New Instructions Set" (PDF). p. 13.
  3. ^ "aes.c". GitHub. Retrieved 2020-06-15.

External links edit

  • 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

schedule, advanced, encryption, standard, uses, schedule, expand, short, into, number, separate, round, keys, three, variants, have, different, number, rounds, each, variant, requires, separate, round, each, round, plus, more, note, schedule, produces, needed,. 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 Contents 1 Round constants 2 The key schedule 3 Notes 4 References 5 External linksRound constants editValues of rci in hexadecimal i 1 2 3 4 5 6 7 8 9 10 rci 01 02 04 08 10 20 40 80 1B 36 The round constant rconi for round i of the key expansion is the 32 bit word note 2 r c o n i r c i 00 16 00 16 00 16 displaystyle rcon i begin bmatrix rc i amp 00 16 amp 00 16 amp 00 16 end bmatrix nbsp where rci is an eight bit value defined as r c i 1 if i 1 2 r c i 1 if i gt 1 and r c i 1 lt 80 16 2 r c i 1 11B 16 if i gt 1 and r c i 1 80 16 displaystyle rc i begin cases 1 amp text if i 1 2 cdot rc i 1 amp text if i gt 1 text and rc i 1 lt 80 16 2 cdot rc i 1 oplus text 11B 16 amp text if i gt 1 text and rc i 1 geq 80 16 end cases nbsp where displaystyle oplus nbsp is the bitwise XOR operator and constants such as 0016 and 11B16 are given in hexadecimal Equivalently r c i x i 1 displaystyle rc i x i 1 nbsp where the bits of rci are treated as the coefficients of an element of the finite field G F 2 x x 8 x 4 x 3 x 1 displaystyle rm GF 2 x x 8 x 4 x 3 x 1 nbsp so that e g r c 10 36 16 00110110 2 displaystyle rc 10 36 16 00110110 2 nbsp represents the polynomial x 5 x 4 x 2 x displaystyle x 5 x 4 x 2 x nbsp AES uses up to rcon10 for AES 128 as 11 round keys are needed up to rcon8 for AES 192 and up to rcon7 for AES 256 note 3 The key schedule edit nbsp AES key schedule for a 128 bit key Define N 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 K0 K1 KN 1 as the 32 bit words of the original key R 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 4 W0 W1 W4R 1 as the 32 bit words of the expanded key note 5 Also define RotWord as a one byte left circular shift note 6 RotWord b 0 b 1 b 2 b 3 b 1 b 2 b 3 b 0 displaystyle operatorname RotWord begin bmatrix b 0 amp b 1 amp b 2 amp b 3 end bmatrix begin bmatrix b 1 amp b 2 amp b 3 amp b 0 end bmatrix nbsp and SubWord as an application of the AES S box to each of the four bytes of the word SubWord b 0 b 1 b 2 b 3 S b 0 S b 1 S b 2 S b 3 displaystyle operatorname SubWord begin bmatrix b 0 amp b 1 amp b 2 amp b 3 end bmatrix begin bmatrix operatorname S b 0 amp operatorname S b 1 amp operatorname S b 2 amp operatorname S b 3 end bmatrix nbsp Then for i 0 4 R 1 displaystyle i 0 ldots 4R 1 nbsp W i K i if i lt N W i N SubWord RotWord W i 1 r c o n i N if i N and i 0 mod N W i N SubWord W i 1 if i N N gt 6 and i 4 mod N W i N W i 1 otherwise displaystyle W i begin cases K i amp text if i lt N W i N oplus operatorname SubWord operatorname RotWord W i 1 oplus rcon i N amp text if i geq N text and i equiv 0 pmod N W i N oplus operatorname SubWord W i 1 amp text if i geq N text N gt 6 text and i equiv 4 pmod N W i N oplus W i 1 amp text otherwise end cases nbsp Notes edit Non AES Rijndael variants require up to 256 bits of expanded key per round In FIPS 197 the r c i displaystyle rc i nbsp value is the least significant byte at index 0 The Rijndael variants with larger block sizes use more of these constants up to rcon29 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 11 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 max N B 7 round keys where B is the block size in words Other Rijndael variants require BR words of expanded key where B is the block size in words Rotation is opposite of byte order direction FIPS 197 byte addresses in arrays are increasing from left to right ref 1 in little endian but rotation is from right to left In AES NI ref 2 and in the Linux kernel s lib crypto aes c ref 3 the byte ordering is increasing from right to left in little endian but rotation is from left to right References editFIPS PUB 197 the official AES standard PDF file Federal Information Processing Standards Publication 197 November 26 2001 Announcing the ADVANCED ENCRYPTION STANDARD AES PDF p 8 Retrieved 2020 06 16 Intel Advanced Encryption Standard AES New Instructions Set PDF p 13 aes c GitHub Retrieved 2020 06 15 External links editDescription 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 Retrieved from https en wikipedia org w index php title AES key schedule amp oldid 1204191754, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.