Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/provers/coefficient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ impl<'a, F: Field, E: RoundPolyEvaluator<F>> CoefficientProver<'a, F, E> {
&self.pairwise
}

/// Consume the prover and return the (tablewise, pairwise) tables by move.
///
/// Intended for end-of-sumcheck extraction: callers that have completed
/// all rounds and want to forward the reduced state to a downstream
/// protocol (witness, transcript, accumulator) without cloning. Returning
/// both buffers in one call avoids the partial-move trap that single-field
/// `self`-consuming accessors would create.
///
/// If called before sumcheck has run to completion the buffers reflect
/// the current partial-fold state — meaningful only if the caller is
/// tracking rounds explicitly.
pub fn finalize(self) -> (Vec<Vec<Vec<F>>>, Vec<Vec<F>>) {
(self.tablewise, self.pairwise)
}

fn half(&self) -> usize {
if self.n_tw > 0 {
self.tablewise[0].len() / 2
Expand Down
15 changes: 15 additions & 0 deletions src/provers/coefficient_lsb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ impl<'a, F: Field, E: RoundPolyEvaluator<F>> CoefficientProverLSB<'a, F, E> {
&self.pairwise
}

/// Consume the prover and return the (tablewise, pairwise) tables by move.
///
/// Intended for end-of-sumcheck extraction: callers that have completed
/// all rounds and want to forward the reduced state to a downstream
/// protocol (witness, transcript, accumulator) without cloning. Returning
/// both buffers in one call avoids the partial-move trap that single-field
/// `self`-consuming accessors would create.
///
/// If called before sumcheck has run to completion the buffers reflect
/// the current partial-fold state — meaningful only if the caller is
/// tracking rounds explicitly.
pub fn finalize(self) -> (Vec<Vec<Vec<F>>>, Vec<Vec<F>>) {
(self.tablewise, self.pairwise)
}

fn n_pairs(&self) -> usize {
if self.n_tw > 0 {
self.tablewise[0].len() / 2
Expand Down
Loading