Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit 9b46ddb

Browse files
authored
fix: constraint for parity-check gadget's a==2 (#738)
1 parent d383d23 commit 9b46ddb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

zkevm-circuits/src/exp_circuit.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ impl<F: Field> SubCircuitConfig<F> for ExpCircuitConfig<F> {
165165
cb.require_zero("is_odd is boolean (hi == 0)", remainder_hi);
166166
cb.require_boolean("is_odd is boolean (lo is boolean)", is_odd.clone());
167167

168+
// Parity check mul gadget was assigned correctly.
169+
let (two_limb0, two_limb1, two_limb2, two_limb3) = parity_check.a_limbs_cur(meta);
170+
cb.require_equal("parity check a = 2", two_limb0.expr(), 2.expr());
171+
for col in [two_limb1, two_limb2, two_limb3] {
172+
cb.require_zero("parity check a = 2 (other limbs are 0)", col.expr());
173+
}
174+
168175
// There should be no overflow in the parity check mul gadget.
169176
cb.require_zero("no overflow in parity check mul gadget", parity_check.overflow.clone());
170177

0 commit comments

Comments
 (0)