From c4caddbdfa34fd8ade36a16d2884b3e16b66f27a Mon Sep 17 00:00:00 2001 From: Sai Deng Date: Fri, 13 Sep 2024 14:30:24 -0700 Subject: [PATCH] cleanup --- plonky2/src/fri/witness_util.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/plonky2/src/fri/witness_util.rs b/plonky2/src/fri/witness_util.rs index c0eb8ecf64..041d43c134 100644 --- a/plonky2/src/fri/witness_util.rs +++ b/plonky2/src/fri/witness_util.rs @@ -1,8 +1,5 @@ -use std::iter; - use anyhow::Result; use itertools::Itertools; -use plonky2_field::types::Field; use crate::field::extension::Extendable; use crate::fri::proof::{FriProof, FriProofTarget}; @@ -23,14 +20,12 @@ where { witness.set_target(fri_proof_target.pow_witness, fri_proof.pow_witness)?; - assert!(fri_proof_target.final_poly.len() >= fri_proof.final_poly.coeffs.len()); - for (&t, &x) in fri_proof_target.final_poly.0.iter().zip( - fri_proof - .final_poly - .coeffs - .iter() - .chain(iter::repeat(&F::Extension::ZERO)), - ) { + for (&t, &x) in fri_proof_target + .final_poly + .0 + .iter() + .zip_eq(&fri_proof.final_poly.coeffs) + { witness.set_extension_target(t, x)?; } @@ -56,7 +51,7 @@ where for (&t, &x) in at.0.iter().zip_eq(&a.0) { witness.set_target(t, x)?; } - for (&t, &x) in at.1.siblings.iter().zip(&a.1.siblings) { + for (&t, &x) in at.1.siblings.iter().zip_eq(&a.1.siblings) { witness.set_hash_target(t, x)?; } } @@ -69,7 +64,7 @@ where .merkle_proof .siblings .iter() - .zip(&s.merkle_proof.siblings) + .zip_eq(&s.merkle_proof.siblings) { witness.set_hash_target(t, x)?; }