Skip to content

Commit

Permalink
doc comment for key expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
eightfilms committed Jun 29, 2024
1 parent 2eb8724 commit d9a7884
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/encryption/symmetric/aes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ where [(); N / 8]:
word
}

/// Generates a key schedule based on a given cipher key `Key`, generating a total of
/// `Nb * (Nr + 1)` words, where Nb = size of block (in words), and Nr = number of rounds.
/// Nr is determined by the size `N` of the key. Every 4-word chunk from this output
/// is used as a round key.
///
/// Key expansion ensures that each key used per round is different, introducing additional
/// complexity and diffusion.
fn key_expansion(key: Key<N>, expanded_key: &mut Vec<Word>, key_len: usize, num_rounds: usize) {
let block_num_words = 128 / 32;

Expand Down

0 comments on commit d9a7884

Please sign in to comment.