refactor block

This commit is contained in:
Neemek 2025-10-04 18:38:01 +02:00
parent 87a4a08f63
commit acc0b5e616

View file

@ -36,8 +36,7 @@ impl Block {
}
}
pub fn next(&mut self) {
self.byte_index = 0;
pub fn advance(&mut self) {
self.counter += 1;
self.chunk = few_u32_to_many_u8(&chacha_block(&self.key, self.counter, self.nonce, self.rounds));
}
@ -49,7 +48,8 @@ impl Block {
self.byte_index += 1;
if self.byte_index >= 64 {
self.next()
self.byte_index = 0;
self.advance();
}
}
}