Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSM: using iterator in the verifier #1914

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions msm/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ pub fn verify<

// -- Absorbing the commitments
let mut fq_sponge = EFqSponge::new(G::other_curve_sponge_params());
proof_comms
.witness_comms
.cols
.iter()
(&proof_comms.witness_comms)
.into_iter()
.for_each(|comm| absorb_commitment(&mut fq_sponge, comm));

if let Some(mvlookup_comms) = &proof_comms.mvlookup_comms {
Expand Down Expand Up @@ -67,11 +65,9 @@ pub fn verify<
let mut coms_and_evaluations: Vec<Evaluation<_>> = vec![];

coms_and_evaluations.extend(
proof_comms
.witness_comms
.cols
.iter()
.zip(proof_evals.witness_evals.cols.iter())
(&proof_comms.witness_comms)
.into_iter()
.zip(&proof_evals.witness_evals)
.map(|(commitment, point_eval)| Evaluation {
commitment: commitment.clone(),
evaluations: vec![vec![point_eval.zeta], vec![point_eval.zeta_omega]],
Expand All @@ -96,7 +92,7 @@ pub fn verify<
let mut fr_sponge = EFrSponge::new(G::sponge_params());
fr_sponge.absorb(&fq_sponge.digest());

for PointEvaluations { zeta, zeta_omega } in proof_evals.witness_evals.cols.iter() {
for PointEvaluations { zeta, zeta_omega } in (&proof_evals.witness_evals).into_iter() {
fr_sponge.absorb(zeta);
fr_sponge.absorb(zeta_omega);
}
Expand Down