From 4f2ac97b0a08f148e025deaece50a78123967c2c Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Tue, 4 Jan 2022 00:01:53 -0800 Subject: [PATCH] consistent order --- plonky2/src/fri/verifier.rs | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/plonky2/src/fri/verifier.rs b/plonky2/src/fri/verifier.rs index 08bcb12c..4c14f32a 100644 --- a/plonky2/src/fri/verifier.rs +++ b/plonky2/src/fri/verifier.rs @@ -122,32 +122,6 @@ fn fri_verify_initial_proof>( Ok(()) } -/// Holds the reduced (by `alpha`) evaluations at `zeta` for the polynomial opened just at -/// zeta, for `Z` at zeta and for `Z` at `g*zeta`. -#[derive(Copy, Clone, Debug)] -pub(crate) struct PrecomputedReducedEvals, const D: usize> { - pub single: F::Extension, - pub zs_right: F::Extension, -} - -impl, const D: usize> PrecomputedReducedEvals { - pub(crate) fn from_os_and_alpha(os: &OpeningSet, alpha: F::Extension) -> Self { - let mut alpha = ReducingFactor::new(alpha); - let single = alpha.reduce( - os.constants - .iter() - .chain(&os.plonk_sigmas) - .chain(&os.wires) - .chain(&os.plonk_zs) - .chain(&os.partial_products) - .chain(&os.quotient_polys), - ); - let zs_right = alpha.reduce(os.plonk_zs_right.iter()); - - Self { single, zs_right } - } -} - pub(crate) fn fri_combine_initial< F: RichField + Extendable, C: GenericConfig, @@ -282,3 +256,29 @@ fn fri_verifier_query_round< Ok(()) } + +/// Holds the reduced (by `alpha`) evaluations at `zeta` for the polynomial opened just at +/// zeta, for `Z` at zeta and for `Z` at `g*zeta`. +#[derive(Copy, Clone, Debug)] +pub(crate) struct PrecomputedReducedEvals, const D: usize> { + pub single: F::Extension, + pub zs_right: F::Extension, +} + +impl, const D: usize> PrecomputedReducedEvals { + pub(crate) fn from_os_and_alpha(os: &OpeningSet, alpha: F::Extension) -> Self { + let mut alpha = ReducingFactor::new(alpha); + let single = alpha.reduce( + os.constants + .iter() + .chain(&os.plonk_sigmas) + .chain(&os.wires) + .chain(&os.plonk_zs) + .chain(&os.partial_products) + .chain(&os.quotient_polys), + ); + let zs_right = alpha.reduce(os.plonk_zs_right.iter()); + + Self { single, zs_right } + } +}