Skip to content

Commit

Permalink
revert modification to eval_lc
Browse files Browse the repository at this point in the history
  • Loading branch information
flyq committed Oct 24, 2023
1 parent 7d4e809 commit d1a3143
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions crates/bellpepper-core/src/util_cs/test_cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,19 @@ fn eval_lc<Scalar: PrimeField>(
inputs: &[(Scalar, String)],
aux: &[(Scalar, String)],
) -> Scalar {
terms.eval(
&inputs.iter().map(|(val, _)| *val).collect::<Vec<_>>(),
&aux.iter().map(|(val, _)| *val).collect::<Vec<_>>(),
)
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<Scalar: PrimeField> Default for TestConstraintSystem<Scalar> {
Expand Down

0 comments on commit d1a3143

Please sign in to comment.