From acadd64371f0df8fd628bb6c2c2c9be16556ac89 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Mon, 11 Oct 2021 16:51:30 +0200 Subject: [PATCH] Clippy --- src/fri/proof.rs | 2 +- src/fri/verifier.rs | 7 ++----- src/plonk/get_challenges.rs | 12 ++---------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/fri/proof.rs b/src/fri/proof.rs index 3cbfaa0a..264e2e9e 100644 --- a/src/fri/proof.rs +++ b/src/fri/proof.rs @@ -285,7 +285,7 @@ impl, const D: usize> CompressedFriProof { HashMap::>::new(); common_data.fri_params.reduction_arity_bits.len() ]; - for (round, mut index) in indices.iter().copied().enumerate() { + for &(mut index) in indices { 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() diff --git a/src/fri/verifier.rs b/src/fri/verifier.rs index c1d97118..dce20c38 100644 --- a/src/fri/verifier.rs +++ b/src/fri/verifier.rs @@ -83,20 +83,18 @@ pub(crate) fn verify_fri_proof, const D: usize>( let precomputed_reduced_evals = PrecomputedReducedEvals::from_os_and_alpha(os, challenges.fri_alpha); - for (round, (&x_index, round_proof)) in challenges + for (&x_index, round_proof) in challenges .fri_query_indices .iter() .zip(&proof.query_round_proofs) - .enumerate() { fri_verifier_query_round( challenges, precomputed_reduced_evals, initial_merkle_caps, - &proof, + proof, x_index, n, - round, round_proof, common_data, )?; @@ -220,7 +218,6 @@ fn fri_verifier_query_round, const D: usize>( proof: &FriProof, mut x_index: usize, n: usize, - round: usize, round_proof: &FriQueryRound, common_data: &CommonCircuitData, ) -> Result<()> { diff --git a/src/plonk/get_challenges.rs b/src/plonk/get_challenges.rs index 97907138..c579aa46 100644 --- a/src/plonk/get_challenges.rs +++ b/src/plonk/get_challenges.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use crate::field::extension_field::Extendable; -use crate::field::field_types::{Field, RichField}; +use crate::field::field_types::RichField; use crate::fri::verifier::{compute_evaluation, fri_combine_initial, PrecomputedReducedEvals}; use crate::hash::hashing::hash_n_to_1; use crate::iop::challenger::Challenger; @@ -93,13 +93,6 @@ impl, const D: usize> ProofWithPublicInputs { } impl, const D: usize> CompressedProofWithPublicInputs { - pub(crate) fn fri_query_indices( - &self, - common_data: &CommonCircuitData, - ) -> anyhow::Result> { - Ok(self.get_challenges(common_data)?.fri_query_indices) - } - pub(crate) fn get_challenges( &self, common_data: &CommonCircuitData, @@ -165,8 +158,7 @@ impl, const D: usize> CompressedProofWithPublicInpu PrecomputedReducedEvals::from_os_and_alpha(&self.proof.openings, fri_alpha); let mut fri_query_inferred_elements = Vec::new(); let log_n = common_data.degree_bits + common_data.config.rate_bits; - for query_round in 0..common_data.config.fri_config.num_query_rounds { - let mut x_index = fri_query_indices[query_round]; + for &(mut x_index) in &fri_query_indices { let mut subgroup_x = F::MULTIPLICATIVE_GROUP_GENERATOR * F::primitive_root_of_unity(log_n).exp_u64(reverse_bits(x_index, log_n) as u64); let mut old_eval = fri_combine_initial(