diff --git a/crates/prover/src/core/pcs/prover.rs b/crates/prover/src/core/pcs/prover.rs index e5ae1b266..ceb51dcb4 100644 --- a/crates/prover/src/core/pcs/prover.rs +++ b/crates/prover/src/core/pcs/prover.rs @@ -170,11 +170,10 @@ impl<'a, 'b, B: BackendForChannel, MC: MerkleChannel> TreeBuilder<'a, 'b, B, columns: impl IntoIterator>, ) -> TreeSubspan { let span = span!(Level::INFO, "Interpolation for commitment").entered(); - let polys = columns - .into_iter() - .map(|eval| eval.interpolate_with_twiddles(self.commitment_scheme.twiddles)) - .collect_vec(); + let polys: Vec> = + B::interpolate_columns(columns, self.commitment_scheme.twiddles); span.exit(); + self.extend_polys(polys) } diff --git a/crates/prover/src/core/poly/circle/ops.rs b/crates/prover/src/core/poly/circle/ops.rs index 40b86cb68..941166da3 100644 --- a/crates/prover/src/core/poly/circle/ops.rs +++ b/crates/prover/src/core/poly/circle/ops.rs @@ -27,6 +27,18 @@ pub trait PolyOps: FieldOps + Sized { itwiddles: &TwiddleTree, ) -> CirclePoly; + /// Computes minimal polynomials that evaluate to the same values as each evaluation in `columns`. + /// Used by the [`TreeBuilder::extend_evals()`] function. + fn interpolate_columns( + columns: impl IntoIterator>, + twiddles: &TwiddleTree, + ) -> Vec> { + columns + .into_iter() + .map(|eval| eval.interpolate_with_twiddles(&twiddles)) + .collect() + } + /// Evaluates the polynomial at a single point. /// Used by the [`CirclePoly::eval_at_point()`] function. fn eval_at_point(poly: &CirclePoly, point: CirclePoint) -> SecureField;