We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f3080b commit 9695573Copy full SHA for 9695573
streebog/src/streebog.rs
@@ -61,12 +61,10 @@ impl StreebogState {
61
}
62
63
fn update_sigma(&mut self, m: &Block) {
64
- let mut over = false;
+ let mut carry = 0;
65
for (a, b) in self.sigma.iter_mut().zip(m.iter()) {
66
- let (res, loc_over) = (*a).overflowing_add(*b);
67
- *a = res;
68
- if over { *a += 1; }
69
- over = loc_over;
+ carry = (*a as u16) + (*b as u16) + (carry >> 8);
+ *a = (carry & 0xFF) as u8;
70
71
72
0 commit comments