From 5387fbb11869643803f19db01a98655e92fe77c4 Mon Sep 17 00:00:00 2001 From: Sai <135601871+sai-deng@users.noreply.github.com> Date: Mon, 20 May 2024 09:19:11 -0700 Subject: [PATCH] Fix degree bits in batch verifier (#106) --- plonky2/src/fri/batch_verifier.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plonky2/src/fri/batch_verifier.rs b/plonky2/src/fri/batch_verifier.rs index b6a0909839..e978572d35 100644 --- a/plonky2/src/fri/batch_verifier.rs +++ b/plonky2/src/fri/batch_verifier.rs @@ -169,7 +169,7 @@ fn batch_fri_verifier_query_round< &round_proof.initial_trees_proof, initial_merkle_caps, )?; - let mut n = degree_bits[0] + params.config.rate_bits; + let mut n = degree_bits[0]; // `subgroup_x` is `subgroup[x_index]`, i.e., the actual field element in the domain. let mut subgroup_x = F::MULTIPLICATIVE_GROUP_GENERATOR * F::primitive_root_of_unity(n).exp_u64(reverse_bits(x_index, n) as u64); @@ -218,9 +218,7 @@ fn batch_fri_verifier_query_round< x_index = coset_index; n -= arity_bits; - if batch_index < degree_bits.len() - && n == degree_bits[batch_index] + params.config.rate_bits - { + if batch_index < degree_bits.len() && n == degree_bits[batch_index] { let subgroup_x_init = F::MULTIPLICATIVE_GROUP_GENERATOR * F::primitive_root_of_unity(n).exp_u64(reverse_bits(x_index, n) as u64); let eval = batch_fri_combine_initial::(