refactor block
This commit is contained in:
parent
87a4a08f63
commit
acc0b5e616
1 changed files with 3 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue