Skip to content

Commit

Permalink
fix: one forgotten instance of the poly_X refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Feb 8, 2024
1 parent e9fec15 commit aed2791
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/spartan/ppsnark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,15 @@ impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for Relax

let eval_X = {
// constant term
let mut poly_X = vec![(0, U.u)];
//remaining inputs
poly_X.extend(
(0..U.X.len())
.map(|i| (i + 1, U.X[i]))
.collect::<Vec<(usize, E::Scalar)>>(),
);
let poly_X = std::iter::once((0, U.u))
.chain(
//remaining inputs
(0..U.X.len())
// filter_map uses the sparsity of the polynomial, if irrelevant
// we should replace by UniPoly
.filter_map(|i| (!U.X[i].is_zero_vartime()).then_some((i + 1, U.X[i]))),
)
.collect();
SparsePolynomial::new(vk.num_vars.log_2(), poly_X).evaluate(&rand_sc_unpad[1..])
};

Expand Down

0 comments on commit aed2791

Please sign in to comment.