diff --git a/crates/bellpepper-core/src/util_cs/test_cs.rs b/crates/bellpepper-core/src/util_cs/test_cs.rs index 315ce40..becb2b4 100644 --- a/crates/bellpepper-core/src/util_cs/test_cs.rs +++ b/crates/bellpepper-core/src/util_cs/test_cs.rs @@ -119,10 +119,19 @@ fn eval_lc( inputs: &[(Scalar, String)], aux: &[(Scalar, String)], ) -> Scalar { - terms.eval( - &inputs.iter().map(|(val, _)| *val).collect::>(), - &aux.iter().map(|(val, _)| *val).collect::>(), - ) + let mut acc = Scalar::ZERO; + + for (var, coeff) in terms.iter() { + let mut tmp = match var.get_unchecked() { + Index::Input(index) => inputs[index].0, + Index::Aux(index) => aux[index].0, + }; + + tmp.mul_assign(coeff); + acc.add_assign(&tmp); + } + + acc } impl Default for TestConstraintSystem {