Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions streebog/src/streebog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ impl StreebogState {
}

fn update_sigma(&mut self, m: &Block) {
let mut over = false;
let mut carry = 0;
for (a, b) in self.sigma.iter_mut().zip(m.iter()) {
let (res, loc_over) = (*a).overflowing_add(*b);
*a = res;
if over { *a += 1; }
over = loc_over;
carry = (*a as u16) + (*b as u16) + (carry >> 8);
*a = (carry & 0xFF) as u8;
}
}

Expand Down