Methods
(private, static) addRoundKey()
Xor Round Key into state S [§5.1.4].
(static) cipher(input, w) → {Array.<number>}
AES Cipher function: encrypt 'input' state with Rijndael algorithm [§5.1];
applies Nr rounds (10/12/14) using key schedule w for 'add round key' stage.
Parameters:
Name | Type | Description |
---|---|---|
input |
Array.<number> | 16-byte (128-bit) input state array. |
w |
Array.<Array.<number>> | Key schedule as 2D byte-array (Nr+1 × Nb bytes). |
Returns:
Encrypted output state array.
- Type
- Array.<number>
(static) keyExpansion(key) → {Array.<Array.<number>>}
Perform key expansion to generate a key schedule from a cipher key [§5.2].
Parameters:
Name | Type | Description |
---|---|---|
key |
Array.<number> | Cipher key as 16/24/32-byte array. |
Returns:
Expanded key schedule as 2D byte-array (Nr+1 × Nb bytes).
- Type
- Array.<Array.<number>>
(private, static) mixColumns()
Combine bytes of each col of state S [§5.1.3].
(private, static) rotWord()
Rotate 4-byte word w left by one byte.
(private, static) shiftRows()
Shift row r of state S left by r bytes [§5.1.2].
(private, static) subBytes()
Apply SBox to state S [§5.1.1].
(private, static) subWord()
Apply SBox to 4-byte word w.