pub struct IVCStatefulProver<'a, FC: FCircuit<Field = I::Field>, I: IVC> {
pub i: usize,
pub initial_state: FC::State,
pub current_state: FC::State,
pub current_proof: I::Proof<FC>,
/* private fields */
}Expand description
IVCStatefulProver is a convenience struct that implements a stateful IVC
prover who maintains running state across iterations, so that the user does
not need to manually track and pass in the current state and proof at each
step.
Fields§
§i: usizeIVCStatefulProver::i is the number of steps proved so far.
initial_state: FC::StateIVCStatefulProver::initial_state is the initial state of iterative
step circuit executions.
current_state: FC::StateIVCStatefulProver::current_state is the current state of iterative
step circuit executions, reached after Self::i steps.
current_proof: I::Proof<FC>IVCStatefulProver::current_proof is the current proof attesting that
Self::current_state is indeed derived from Self::initial_state
after executing the step circuit iteratively for Self::i steps.
Implementations§
Source§impl<'a, FC: FCircuit<Field = I::Field>, I: IVC> IVCStatefulProver<'a, FC, I>
impl<'a, FC: FCircuit<Field = I::Field>, I: IVC> IVCStatefulProver<'a, FC, I>
Sourcepub fn new(
pk: &'a I::ProverKey<FC>,
step_circuit: &'a FC,
initial_state: FC::State,
) -> Result<Self, Error>
pub fn new( pk: &'a I::ProverKey<FC>, step_circuit: &'a FC, initial_state: FC::State, ) -> Result<Self, Error>
IVCStatefulProver::new creates a new stateful IVC prover with the
given prover key pk, step circuit step_circuit, and initial state
initial_state.
Sourcepub fn prove_step(
&mut self,
external_inputs: FC::ExternalInputs,
rng: impl RngCore,
) -> Result<FC::ExternalOutputs, Error>
pub fn prove_step( &mut self, external_inputs: FC::ExternalInputs, rng: impl RngCore, ) -> Result<FC::ExternalOutputs, Error>
IVCStatefulProver::prove_step performs one step of proving, updating
the internal state and proof, and returning the external outputs.
Auto Trait Implementations§
impl<'a, FC, I> Freeze for IVCStatefulProver<'a, FC, I>
impl<'a, FC, I> RefUnwindSafe for IVCStatefulProver<'a, FC, I>where
<FC as FCircuit>::State: RefUnwindSafe,
<I as IVC>::Proof<FC>: RefUnwindSafe,
<I as IVC>::ProverKey<FC>: RefUnwindSafe,
FC: RefUnwindSafe,
impl<'a, FC, I> Send for IVCStatefulProver<'a, FC, I>
impl<'a, FC, I> Sync for IVCStatefulProver<'a, FC, I>
impl<'a, FC, I> Unpin for IVCStatefulProver<'a, FC, I>
impl<'a, FC, I> UnsafeUnpin for IVCStatefulProver<'a, FC, I>
impl<'a, FC, I> UnwindSafe for IVCStatefulProver<'a, FC, I>where
<FC as FCircuit>::State: UnwindSafe,
<I as IVC>::Proof<FC>: UnwindSafe,
<I as IVC>::ProverKey<FC>: RefUnwindSafe,
FC: RefUnwindSafe,
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
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>
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>
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