Browse Source

Reduce density of `ThreeBitCondNegLookup`

master
jon-chuang 4 years ago
committed by GitHub
parent
commit
905e7284b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/fields/fp/mod.rs

+ 4
- 3
src/fields/fp/mod.rs

@ -594,10 +594,11 @@ impl ThreeBitCondNegLookupGadget for AllocatedFp {
+ b[0].lc() * (c[1] - &c[0])
+ b[1].lc() * (c[2] - &c[0])
+ (c[0], Variable::One);
// enforce y * (1 - 2 * b_2) == res
b.cs().enforce_constraint(
y_lc.clone() + y_lc.clone(),
b[2].lc(),
y_lc - result.variable,
y_lc.clone(),
b[2].lc() * F::from(2u64).neg() + (F::one(), Variable::One),
lc!() + result.variable,
)?;
Ok(result)

Loading…
Cancel
Save