Fix constraint count

This commit is contained in:
Daniel Lubarov 2021-04-10 14:54:46 -07:00
parent b183579886
commit a14ddc3b03
2 changed files with 3 additions and 1 deletions

View File

@ -149,7 +149,7 @@ impl<F: Field, const R: usize> Gate<F> for GMiMCGate<F, R> {
}
fn num_constraints(&self) -> usize {
R + W
R + W + 2
}
}

View File

@ -18,6 +18,8 @@ pub fn evaluate_gate_constraints<F: Field>(
for gate in gates {
let gate_constraints = gate.0.eval_filtered(vars);
for (i, c) in gate_constraints.into_iter().enumerate() {
debug_assert!(i < num_gate_constraints,
"num_constraints() gave too low of a number");
constraints[i] += c;
}
}