Skip to content

Commit

Permalink
valida verifier changes (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirhemo authored Feb 8, 2024
1 parent baada92 commit 86d13dd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion air/src/air.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait Air<AB: AirBuilder>: BaseAir<AB::F> {
pub trait AirBuilder: Sized {
type F: Field;

type Expr: AbstractField<F = Self::F>
type Expr: AbstractField
+ From<Self::F>
+ Add<Self::Var, Output = Self::Expr>
+ Add<Self::F, Output = Self::Expr>
Expand Down
4 changes: 2 additions & 2 deletions commit/src/pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ where
fn commit_shifted_batches(
&self,
polynomials: Vec<In>,
coset_shift: Val,
coset_shift: &[Val],
) -> (Self::Commitment, Self::ProverData);

fn commit_shifted_batch(
&self,
polynomials: In,
coset_shift: Val,
) -> (Self::Commitment, Self::ProverData) {
self.commit_shifted_batches(vec![polynomials], coset_shift)
self.commit_shifted_batches(vec![polynomials], &[coset_shift])
}
}

Expand Down
1 change: 1 addition & 0 deletions field/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ pub trait PrimeField32: PrimeField64 {

pub trait AbstractExtensionField<Base: AbstractField>:
AbstractField
+ From<Base>
+ Add<Base, Output = Self>
+ AddAssign<Base>
+ Sub<Base, Output = Self>
Expand Down
10 changes: 6 additions & 4 deletions fri/src/two_adic_pcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ impl<C: TwoAdicFriPcsGenericConfig, In: MatrixRows<C::Val>> Pcs<C::Val, In> for
type Error = VerificationError<C>;

fn commit_batches(&self, polynomials: Vec<In>) -> (Self::Commitment, Self::ProverData) {
self.commit_shifted_batches(polynomials, C::Val::one())
let ones = vec![C::Val::one(); polynomials.len()];
self.commit_shifted_batches(polynomials, &ones)
}
}

Expand Down Expand Up @@ -151,13 +152,14 @@ impl<C: TwoAdicFriPcsGenericConfig, In: MatrixRows<C::Val>>
fn commit_shifted_batches(
&self,
polynomials: Vec<In>,
coset_shift: C::Val,
coset_shifts: &[C::Val],
) -> (Self::Commitment, Self::ProverData) {
let shift = C::Val::generator() / coset_shift;
let ldes = info_span!("compute all coset LDEs").in_scope(|| {
polynomials
.into_iter()
.map(|poly| {
.zip_eq(coset_shifts)
.map(|(poly, coset_shift)| {
let shift = C::Val::generator() / *coset_shift;
let input = poly.to_row_major_matrix();
// Commit to the bit-reversed LDE.
self.dft
Expand Down

0 comments on commit 86d13dd

Please sign in to comment.