diff --git a/crates/prover/src/core/pcs/prover.rs b/crates/prover/src/core/pcs/prover.rs index 58d347ee6..dbedabd5d 100644 --- a/crates/prover/src/core/pcs/prover.rs +++ b/crates/prover/src/core/pcs/prover.rs @@ -10,7 +10,7 @@ use super::super::fields::qm31::SecureField; use super::super::fri::{FriProof, FriProver}; use super::super::poly::BitReversedOrder; use super::super::ColumnVec; -use super::quotients::{compute_fri_quotients, PointSample}; +use super::quotients::compute_fri_quotients; use super::utils::TreeVec; use super::{PcsConfig, TreeSubspan}; use crate::core::air::Trace; @@ -87,18 +87,7 @@ impl<'a, B: BackendForChannel, MC: MerkleChannel> CommitmentSchemeProver<'a, ) -> CommitmentSchemeProof { // Evaluate polynomials on open points. let span = span!(Level::INFO, "Evaluate columns out of domain").entered(); - let samples = self - .polynomials() - .zip_cols(&sampled_points) - .map_cols(|(poly, points)| { - points - .iter() - .map(|&point| PointSample { - point, - value: poly.eval_at_point(point), - }) - .collect_vec() - }); + let samples = B::evaluate_polynomials_out_of_domain(self.polynomials(), sampled_points); span.exit(); let sampled_values = samples .as_cols_ref() diff --git a/crates/prover/src/core/poly/circle/ops.rs b/crates/prover/src/core/poly/circle/ops.rs index a08fa6739..8fa83bf70 100644 --- a/crates/prover/src/core/poly/circle/ops.rs +++ b/crates/prover/src/core/poly/circle/ops.rs @@ -9,6 +9,8 @@ use crate::core::fields::FieldOps; use crate::core::poly::twiddles::TwiddleTree; use crate::core::poly::BitReversedOrder; use crate::core::ColumnVec; +use crate::core::pcs::quotients::PointSample; +use crate::core::pcs::TreeVec; /// Operations on BaseField polynomials. pub trait PolyOps: FieldOps + Sized { @@ -44,6 +46,24 @@ pub trait PolyOps: FieldOps + Sized { /// Used by the [`CirclePoly::eval_at_point()`] function. fn eval_at_point(poly: &CirclePoly, point: CirclePoint) -> SecureField; + fn evaluate_polynomials_out_of_domain( + polynomials: TreeVec>>, + points: TreeVec>>>, + ) -> TreeVec>> { + polynomials + .zip_cols(&points) + .map_cols(|(poly, points)| { + points + .iter() + .map(|&point| PointSample { + point, + value: poly.eval_at_point(point), + }) + .collect_vec() + }) + } + + /// Extends the polynomial to a larger degree bound. /// Used by the [`CirclePoly::extend()`] function. fn extend(poly: &CirclePoly, log_size: u32) -> CirclePoly;