Skip to content

Commit

Permalink
Unite impls of DomainEvaluationAccumulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Gali-StarkWare committed Dec 17, 2024
1 parent b43fe93 commit 7ba577a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions crates/prover/src/core/air/accumulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,7 @@ impl<B: Backend> DomainEvaluationAccumulator<B> {
pub fn log_size(&self) -> u32 {
(self.sub_accumulations.len() - 1) as u32
}
}

pub trait AccumulationOps: FieldOps<BaseField> + Sized {
/// Accumulates other into column:
/// column = column + other.
fn accumulate(column: &mut SecureColumnByCoords<Self>, other: &SecureColumnByCoords<Self>);

/// Generates the first `n_powers` powers of `felt`.
fn generate_secure_powers(felt: SecureField, n_powers: usize) -> Vec<SecureField>;
}

impl<B: Backend> DomainEvaluationAccumulator<B> {
/// Computes f(P) as coefficients.
pub fn finalize(self) -> SecureCirclePoly<B> {
assert_eq!(
Expand Down Expand Up @@ -159,6 +148,15 @@ impl<B: Backend> DomainEvaluationAccumulator<B> {
}
}

pub trait AccumulationOps: FieldOps<BaseField> + Sized {
/// Accumulates other into column:
/// column = column + other.
fn accumulate(column: &mut SecureColumnByCoords<Self>, other: &SecureColumnByCoords<Self>);

/// Generates the first `n_powers` powers of `felt`.
fn generate_secure_powers(felt: SecureField, n_powers: usize) -> Vec<SecureField>;
}

/// A domain accumulator for polynomials of a single size.
pub struct ColumnAccumulator<'a, B: Backend> {
pub random_coeff_powers: Vec<SecureField>,
Expand Down

0 comments on commit 7ba577a

Please sign in to comment.