mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-09 07:21:29 +01:00
Reduce density of ThreeBitCondNegLookup
This commit is contained in:
@@ -594,10 +594,11 @@ impl<F: PrimeField> ThreeBitCondNegLookupGadget<F> for AllocatedFp<F> {
|
||||
+ 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)
|
||||
|
||||
Reference in New Issue
Block a user