Skip to main content

decrypt_block

Function decrypt_block 

Source
pub fn decrypt_block<const N: usize>(
    round_keys: &[[u8; 16]; N],
    block: &[u8; 16],
) -> [u8; 16]
Expand description

Decrypt one 16-byte block using inverse T-tables.

Note: the inverse T-tables (TD0..TD3) combine InvSubBytes + InvMixColumns. Because AddRoundKey falls between InvSubBytes and InvMixColumns in the decryption round, each round key rk[1]..rk[N-2] must have InvMixColumns applied to it before the XOR.

N = 11 for AES-128 (10 rounds), N = 15 for AES-256 (14 rounds).