Skip to content

Commit

Permalink
feat: remove unnecessary constaints from provably non-zero divisors
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Oct 11, 2023
1 parent b3a9c34 commit 5a0d9d2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,11 @@ impl GeneratedAcir {
//
// When the predicate is 0, the equation always passes.
// When the predicate is 1, the rhs must not be 0.
let rhs_is_zero = self.is_zero(rhs);
let rhs_is_not_zero = self.mul_with_witness(&rhs_is_zero.into(), predicate);
self.assert_is_zero(rhs_is_not_zero);
if !rhs.is_const() || rhs.is_zero() {
let rhs_is_zero = self.is_zero(rhs);
let rhs_is_not_zero = self.mul_with_witness(&rhs_is_zero.into(), predicate);
self.assert_is_zero(rhs_is_not_zero);
}

// maximum bit size for q and for [r and rhs]
let mut max_q_bits = max_bit_size;
Expand Down

0 comments on commit 5a0d9d2

Please sign in to comment.