pub struct StarkProver<C>where
C: StarkGenericConfig,{ /* private fields */ }Expand description
zk-STARK prover
This is a high-level wrapper around the STARK proving functionality. It provides a convenient interface for generating STARK proofs with a given configuration.
§Example
ⓘ
use lib_q_zkp::stark::{StarkProver, default_config};
use Complex;
use Mersenne31;
type Val = Complex<Mersenne31>;
let config = default_config();
let prover = StarkProver::new(config);
// air: implements Air trait
// trace: RowMajorMatrix<Val>
// public_values: &[Val]
let proof = prover.prove(&air, trace, &public_values);Implementations§
Source§impl<C> StarkProver<C>where
C: StarkGenericConfig,
impl<C> StarkProver<C>where
C: StarkGenericConfig,
Sourcepub fn new(config: C) -> StarkProver<C>
pub fn new(config: C) -> StarkProver<C>
Create a new zk-STARK prover with the given configuration
pub fn prove<A>(
&self,
air: &A,
trace: DenseMatrix<<<<C as StarkGenericConfig>::Pcs as Pcs<<C as StarkGenericConfig>::Challenge, <C as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>,
public_values: &[<<<C as StarkGenericConfig>::Pcs as Pcs<<C as StarkGenericConfig>::Challenge, <C as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val],
) -> Result<Proof<C>, ProverError>where
A: Air<SymbolicAirBuilder<<<<C as StarkGenericConfig>::Pcs as Pcs<<C as StarkGenericConfig>::Challenge, <C as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>> + for<'a> Air<ProverConstraintFolder<'a, C>> + for<'a> Air<DebugConstraintBuilder<'a, <<<C as StarkGenericConfig>::Pcs as Pcs<<C as StarkGenericConfig>::Challenge, <C as StarkGenericConfig>::Challenger>>::Domain as PolynomialSpace>::Val>>,
Auto Trait Implementations§
impl<C> Freeze for StarkProver<C>where
C: Freeze,
impl<C> RefUnwindSafe for StarkProver<C>where
C: RefUnwindSafe,
impl<C> Send for StarkProver<C>where
C: Send,
impl<C> Sync for StarkProver<C>where
C: Sync,
impl<C> Unpin for StarkProver<C>where
C: Unpin,
impl<C> UnsafeUnpin for StarkProver<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for StarkProver<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more