diff --git a/extensions/native/compiler/src/constraints/halo2/baby_bear.rs b/extensions/native/compiler/src/constraints/halo2/baby_bear.rs index e1ced30d98..8a6cc4ec76 100644 --- a/extensions/native/compiler/src/constraints/halo2/baby_bear.rs +++ b/extensions/native/compiler/src/constraints/halo2/baby_bear.rs @@ -152,19 +152,16 @@ impl BabyBearChip { ); // the inner product above must equal `a` ctx.constrain_equal(&a, &acc); - let r = - self.gate() - .inner_product(ctx, limbs, self.cached_limbs_r[..num_limbs].to_vec()); // we fetch the cells to lookup by getting the indices where `limbs` were assigned in `inner_product`. Because `limb_bases[0]` is 1, the progression of indices is 0,1,4,...,4+3*i self.add_cell_to_lookup(ctx, ctx.get(row_offset)); for i in 0..num_limbs - 1 { self.add_cell_to_lookup(ctx, ctx.get(row_offset + 1 + 3 * i as isize)); } - ( - ctx.get(row_offset + 1 + 3 * (num_limbs - 2) as isize), - r, - self.extra_bits + lookup_bits, - ) + let last_limb = ctx.get(row_offset + 1 + 3 * (num_limbs - 2) as isize); + let r = + self.gate() + .inner_product(ctx, limbs, self.cached_limbs_r[..num_limbs].to_vec()); + (last_limb, r, self.extra_bits + lookup_bits) }; // additional constraints for the last limb if rem_bits != 0