mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-05 23:33:07 +00:00
Fix constraint count
This commit is contained in:
parent
b183579886
commit
a14ddc3b03
@ -149,7 +149,7 @@ impl<F: Field, const R: usize> Gate<F> for GMiMCGate<F, R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn num_constraints(&self) -> usize {
|
fn num_constraints(&self) -> usize {
|
||||||
R + W
|
R + W + 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,8 @@ pub fn evaluate_gate_constraints<F: Field>(
|
|||||||
for gate in gates {
|
for gate in gates {
|
||||||
let gate_constraints = gate.0.eval_filtered(vars);
|
let gate_constraints = gate.0.eval_filtered(vars);
|
||||||
for (i, c) in gate_constraints.into_iter().enumerate() {
|
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;
|
constraints[i] += c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user