Skip to content

Commit

Permalink
fix: keystream seeker
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesposito committed Dec 2, 2023
1 parent 2ef7219 commit b34400d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cipher/src/chacha20/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ pub fn chacha20_rounds(out: &mut [u32; 16], add: Option<[u32; 16]>) {

pub fn seek_keystream(state: &[u32; 16], n: u64) -> [u32; 16] {
let mut state = state.clone();
let mut keystream = state;

safe_2words_counter_increment_n(&mut state[12..14], n);

let mut keystream = state;
chacha20_rounds(&mut keystream, Some(state));

keystream
Expand Down

0 comments on commit b34400d

Please sign in to comment.