diff --git a/src/fri/proof.rs b/src/fri/proof.rs index b6402733..4d31c66e 100644 --- a/src/fri/proof.rs +++ b/src/fri/proof.rs @@ -79,11 +79,13 @@ pub struct FriQueryRoundTarget { pub steps: Vec>, } -/// Compressed proofs for FRI query rounds. +/// Compressed proof of the FRI query rounds. #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] #[serde(bound = "")] pub struct CompressedFriQueryRounds, const D: usize> { + /// Map from initial indices `i` to the `FriInitialProof` for the `i`th leaf. pub initial_trees_proofs: HashMap>, + /// For each FRI query step, a map from initial indices `i` to the `FriInitialProof` for the `i`th leaf. pub steps: Vec>>, } @@ -112,7 +114,7 @@ pub struct FriProofTarget { pub struct CompressedFriProof, const D: usize> { /// A Merkle cap for each reduced polynomial in the commit phase. pub commit_phase_merkle_caps: Vec>, - /// Query rounds proofs + /// Compressed query rounds proof. pub query_round_proofs: CompressedFriQueryRounds, /// The final polynomial in coefficient form. pub final_poly: PolynomialCoeffs, @@ -219,7 +221,7 @@ impl, const D: usize> FriProof { } impl, const D: usize> CompressedFriProof { - /// Decompress all the Merkle paths in the FRI proof and add duplicate indices. + /// Decompress all the Merkle paths in the FRI proof and reinsert duplicate indices. pub fn decompress( self, indices: &[usize], @@ -259,7 +261,7 @@ impl, const D: usize> CompressedFriProof { }) .collect::>(); - for mut index in indices.iter().cloned() { + for mut index in indices.iter().copied() { let initial_trees_proof = query_round_proofs.initial_trees_proofs[&index].clone(); for (i, (leaves_data, proof)) in initial_trees_proof.evals_proofs.into_iter().enumerate() @@ -290,7 +292,6 @@ impl, const D: usize> CompressedFriProof { .collect::>(); let mut decompressed_query_proofs = Vec::with_capacity(num_reductions); - // Replace the query round proofs with the decompressed versions. for i in 0..num_reductions { let initial_trees_proof = FriInitialTreeProof { evals_proofs: (0..num_initial_trees) diff --git a/src/plonk/proof.rs b/src/plonk/proof.rs index 41c5501b..ee38938b 100644 --- a/src/plonk/proof.rs +++ b/src/plonk/proof.rs @@ -96,7 +96,7 @@ pub struct CompressedProof, const D: usize> { pub quotient_polys_cap: MerkleCap, /// Purported values of each polynomial at the challenge point. pub openings: OpeningSet, - /// A batch FRI argument for all openings. + /// A compressed batch FRI argument for all openings. pub opening_proof: CompressedFriProof, } diff --git a/src/plonk/prover.rs b/src/plonk/prover.rs index ebf9e140..19852cff 100644 --- a/src/plonk/prover.rs +++ b/src/plonk/prover.rs @@ -5,7 +5,6 @@ use rayon::prelude::*; use crate::field::extension_field::Extendable; use crate::field::field_types::RichField; use crate::fri::commitment::PolynomialBatchCommitment; -use crate::fri::proof::FriProof; use crate::hash::hash_types::HashOut; use crate::hash::hashing::hash_n_to_hash; use crate::iop::challenger::Challenger; diff --git a/src/plonk/verifier.rs b/src/plonk/verifier.rs index 590275cd..2dbf7989 100644 --- a/src/plonk/verifier.rs +++ b/src/plonk/verifier.rs @@ -2,11 +2,10 @@ use anyhow::{ensure, Result}; use crate::field::extension_field::Extendable; use crate::field::field_types::{Field, RichField}; -use crate::fri::proof::FriProof; use crate::fri::verifier::verify_fri_proof; use crate::plonk::circuit_data::{CommonCircuitData, VerifierOnlyCircuitData}; use crate::plonk::plonk_common::reduce_with_powers; -use crate::plonk::proof::{Proof, ProofWithPublicInputs}; +use crate::plonk::proof::ProofWithPublicInputs; use crate::plonk::vanishing_poly::eval_vanishing_poly; use crate::plonk::vars::EvaluationVars;