Skip to content

Commit

Permalink
cleaned up prover exports
Browse files Browse the repository at this point in the history
  • Loading branch information
irakliyk committed Oct 29, 2023
1 parent bbdc978 commit 772e6ad
Show file tree
Hide file tree
Showing 35 changed files with 176 additions and 129 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ like:
use winterfell::{
crypto::{hashers::Blake3_256, DefaultRandomCoin},
math::{fields::f128::BaseElement, FieldElement},
matrix::ColMatrix,
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, Trace,
TracePolyTable, TraceTable,
TraceInfo, TracePolyTable, TraceTable,
};

// We'll use BLAKE3 as the hash function during proof generation.
Expand Down Expand Up @@ -282,8 +283,8 @@ impl Prover for WorkProver {
// We'll use the default trace low-degree extension.
fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand Down
3 changes: 1 addition & 2 deletions examples/src/fibonacci/fib2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, FieldElement},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
18 changes: 11 additions & 7 deletions examples/src/fibonacci/fib2/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
// LICENSE file in the root directory of this source tree.

use super::{
BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin, DefaultTraceLde, ElementHasher,
FibAir, FieldElement, PhantomData, ProofOptions, Prover, StarkDomain, Trace, TracePolyTable,
TraceTable, TRACE_WIDTH,
BaseElement, DefaultRandomCoin, ElementHasher, FibAir, FieldElement, PhantomData, ProofOptions,
Prover, TRACE_WIDTH,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, Trace, TraceInfo, TracePolyTable,
TraceTable,
};

// FIBONACCI PROVER
Expand Down Expand Up @@ -70,8 +74,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -80,8 +84,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/fibonacci/fib8/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, FieldElement},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
16 changes: 10 additions & 6 deletions examples/src/fibonacci/fib8/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
// LICENSE file in the root directory of this source tree.

use super::{
BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin, DefaultTraceLde, ElementHasher,
Fib8Air, FieldElement, PhantomData, ProofOptions, Prover, StarkDomain, Trace, TracePolyTable,
BaseElement, DefaultRandomCoin, ElementHasher, Fib8Air, FieldElement, PhantomData,
ProofOptions, Prover,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, Trace, TraceInfo, TracePolyTable,
TraceTable,
};

Expand Down Expand Up @@ -85,8 +89,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -95,8 +99,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/fibonacci/fib_small/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f64::BaseElement, FieldElement},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
18 changes: 11 additions & 7 deletions examples/src/fibonacci/fib_small/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
use super::{
air::FibSmall, BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin, DefaultTraceLde,
ElementHasher, FieldElement, PhantomData, ProofOptions, Prover, StarkDomain, Trace,
TracePolyTable, TraceTable, TRACE_WIDTH,
air::FibSmall, BaseElement, DefaultRandomCoin, ElementHasher, FieldElement, PhantomData,
ProofOptions, Prover, TRACE_WIDTH,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, Trace, TraceInfo, TracePolyTable,
TraceTable,
};

// FIBONACCI PROVER
Expand Down Expand Up @@ -69,8 +73,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -79,8 +83,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/fibonacci/mulfib2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, FieldElement},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
18 changes: 11 additions & 7 deletions examples/src/fibonacci/mulfib2/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
// LICENSE file in the root directory of this source tree.

use super::{
BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin, DefaultTraceLde, ElementHasher,
FieldElement, MulFib2Air, PhantomData, ProofOptions, Prover, StarkDomain, Trace,
TracePolyTable, TraceTable,
BaseElement, DefaultRandomCoin, ElementHasher, FieldElement, MulFib2Air, PhantomData,
ProofOptions, Prover,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, Trace, TraceInfo, TracePolyTable,
TraceTable,
};

// FIBONACCI PROVER
Expand Down Expand Up @@ -66,8 +70,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -76,8 +80,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/fibonacci/mulfib8/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, FieldElement},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
18 changes: 11 additions & 7 deletions examples/src/fibonacci/mulfib8/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
// LICENSE file in the root directory of this source tree.

use super::{
BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin, DefaultTraceLde, ElementHasher,
FieldElement, MulFib8Air, PhantomData, ProofOptions, Prover, StarkDomain, Trace,
TracePolyTable, TraceTable,
BaseElement, DefaultRandomCoin, ElementHasher, FieldElement, MulFib8Air, PhantomData,
ProofOptions, Prover,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, Trace, TraceInfo, TracePolyTable,
TraceTable,
};

// FIBONACCI PROVER
Expand Down Expand Up @@ -78,8 +82,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -88,8 +92,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/lamport/aggregate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, get_power_series, FieldElement, StarkField},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
18 changes: 11 additions & 7 deletions examples/src/lamport/aggregate/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
// LICENSE file in the root directory of this source tree.

use super::{
get_power_series, rescue, BaseElement, DefaultConstraintEvaluator, DefaultRandomCoin,
DefaultTraceLde, ElementHasher, FieldElement, LamportAggregateAir, PhantomData, ProofOptions,
Prover, PublicInputs, Signature, StarkDomain, StarkField, TracePolyTable, TraceTable,
get_power_series, rescue, BaseElement, DefaultRandomCoin, ElementHasher, FieldElement,
LamportAggregateAir, PhantomData, ProofOptions, Prover, PublicInputs, Signature, StarkField,
CYCLE_LENGTH, NUM_HASH_ROUNDS, SIG_CYCLE_LENGTH, TRACE_WIDTH,
};
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, TraceInfo, TracePolyTable,
TraceTable,
};

#[cfg(feature = "concurrent")]
use winterfell::iterators::*;
Expand Down Expand Up @@ -112,8 +116,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -122,8 +126,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/lamport/threshold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, ElementHasher},
math::{fields::f128::BaseElement, get_power_series, FieldElement, StarkField},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod signature;
Expand Down
20 changes: 12 additions & 8 deletions examples/src/lamport/threshold/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
// LICENSE file in the root directory of this source tree.

use super::{
get_power_series, rescue, AggPublicKey, BaseElement, DefaultConstraintEvaluator,
DefaultRandomCoin, DefaultTraceLde, ElementHasher, FieldElement, LamportThresholdAir,
PhantomData, ProofOptions, Prover, PublicInputs, Signature, StarkDomain, StarkField,
TracePolyTable, TraceTable, HASH_CYCLE_LENGTH, NUM_HASH_ROUNDS, SIG_CYCLE_LENGTH, TRACE_WIDTH,
get_power_series, rescue, AggPublicKey, BaseElement, DefaultRandomCoin, ElementHasher,
FieldElement, LamportThresholdAir, PhantomData, ProofOptions, Prover, PublicInputs, Signature,
StarkField, HASH_CYCLE_LENGTH, NUM_HASH_ROUNDS, SIG_CYCLE_LENGTH, TRACE_WIDTH,
};
use std::collections::HashMap;
use winterfell::{
matrix::ColMatrix, AuxTraceRandElements, ConstraintCompositionCoefficients,
DefaultConstraintEvaluator, DefaultTraceLde, StarkDomain, TraceInfo, TracePolyTable,
TraceTable,
};

#[cfg(feature = "concurrent")]
use winterfell::iterators::*;
Expand Down Expand Up @@ -153,8 +157,8 @@ where

fn new_trace_lde<E: FieldElement<BaseField = Self::BaseField>>(
&self,
trace_info: &winterfell::TraceInfo,
main_trace: &winterfell::ColMatrix<Self::BaseField>,
trace_info: &TraceInfo,
main_trace: &ColMatrix<Self::BaseField>,
domain: &StarkDomain<Self::BaseField>,
) -> (Self::TraceLde<E>, TracePolyTable<E>) {
DefaultTraceLde::new(trace_info, main_trace, domain)
Expand All @@ -163,8 +167,8 @@ where
fn new_evaluator<'a, E: FieldElement<BaseField = Self::BaseField>>(
&self,
air: &'a Self::Air,
aux_rand_elements: winterfell::AuxTraceRandElements<E>,
composition_coefficients: winterfell::ConstraintCompositionCoefficients<E>,
aux_rand_elements: AuxTraceRandElements<E>,
composition_coefficients: ConstraintCompositionCoefficients<E>,
) -> Self::ConstraintEvaluator<'a, E> {
DefaultConstraintEvaluator::new(air, aux_rand_elements, composition_coefficients)
}
Expand Down
3 changes: 1 addition & 2 deletions examples/src/merkle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ use std::time::Instant;
use winterfell::{
crypto::{DefaultRandomCoin, Digest, ElementHasher, MerkleTree},
math::{fields::f128::BaseElement, FieldElement, StarkField},
DefaultConstraintEvaluator, DefaultTraceLde, ProofOptions, Prover, StarkDomain, StarkProof,
Trace, TracePolyTable, TraceTable, VerifierError,
ProofOptions, Prover, StarkProof, Trace, VerifierError,
};

mod air;
Expand Down
Loading

0 comments on commit 772e6ad

Please sign in to comment.