Skip to content

Commit

Permalink
fix: rotate_scalar misbehaves on i32::MIN (#13)
Browse files Browse the repository at this point in the history
Should never actually be callable with such a large negative rotation
  • Loading branch information
jonathanpwang authored May 22, 2023
1 parent f510177 commit 9bbe6da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snark-verifier/src/util/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<F: PrimeField> Domain<F> {
match rotation.0.cmp(&0) {
Ordering::Equal => scalar,
Ordering::Greater => scalar * self.gen.pow_vartime([rotation.0 as u64]),
Ordering::Less => scalar * self.gen_inv.pow_vartime([(-rotation.0) as u64]),
Ordering::Less => scalar * self.gen_inv.pow_vartime([(-(rotation.0 as i64)) as u64]),
}
}
}
Expand Down

0 comments on commit 9bbe6da

Please sign in to comment.