pub struct FRIFolder<'a, F, FA, MerkleProver, VCS>where
FA: BinaryField,
F: BinaryField,
MerkleProver: MerkleTreeProver<F, Scheme = VCS>,
VCS: MerkleTreeScheme<F>,{ /* private fields */ }
Expand description
A stateful prover for the FRI fold phase.
Implementations§
source§impl<'a, F, FA, MerkleProver, VCS> FRIFolder<'a, F, FA, MerkleProver, VCS>where
F: BinaryField + ExtensionField<FA>,
FA: BinaryField,
MerkleProver: MerkleTreeProver<F, Scheme = VCS>,
VCS: MerkleTreeScheme<F>,
impl<'a, F, FA, MerkleProver, VCS> FRIFolder<'a, F, FA, MerkleProver, VCS>where
F: BinaryField + ExtensionField<FA>,
FA: BinaryField,
MerkleProver: MerkleTreeProver<F, Scheme = VCS>,
VCS: MerkleTreeScheme<F>,
sourcepub fn new(
params: &'a FRIParams<F, FA>,
merkle_prover: &'a MerkleProver,
committed_codeword: &'a [F],
committed: &'a MerkleProver::Committed,
) -> Result<Self, Error>
pub fn new( params: &'a FRIParams<F, FA>, merkle_prover: &'a MerkleProver, committed_codeword: &'a [F], committed: &'a MerkleProver::Committed, ) -> Result<Self, Error>
Constructs a new folder.
sourcepub fn curr_round(&self) -> usize
pub fn curr_round(&self) -> usize
Number of times execute_fold_round
has been called.
sourcepub fn execute_fold_round(
&mut self,
challenge: F,
) -> Result<FoldRoundOutput<VCS::Digest>, Error>
pub fn execute_fold_round( &mut self, challenge: F, ) -> Result<FoldRoundOutput<VCS::Digest>, Error>
Executes the next fold round and returns the folded codeword commitment.
As a memory efficient optimization, this method may not actually do the folding, but instead accumulate the folding challenge for processing at a later time. This saves us from storing intermediate folded codewords.
sourcepub fn finalize(
self,
) -> Result<(TerminateCodeword<F>, FRIQueryProver<'a, F, FA, MerkleProver, VCS>), Error>
pub fn finalize( self, ) -> Result<(TerminateCodeword<F>, FRIQueryProver<'a, F, FA, MerkleProver, VCS>), Error>
Finalizes the FRI folding process.
This step will process any unprocessed folding challenges to produce the final folded codeword. Then it will decode this final folded codeword to get the final message. The result is the final message and a query prover instance.
This returns the final message and a query prover instance.
pub fn finish_proof<Challenger>(
self,
challenger: Challenger,
) -> Result<FRIProof<F, VCS>, Error>where
Challenger: CanSampleBits<usize>,
Auto Trait Implementations§
impl<'a, F, FA, MerkleProver, VCS> Freeze for FRIFolder<'a, F, FA, MerkleProver, VCS>
impl<'a, F, FA, MerkleProver, VCS> RefUnwindSafe for FRIFolder<'a, F, FA, MerkleProver, VCS>where
<F as WithUnderlier>::Underlier: Sized,
<FA as WithUnderlier>::Underlier: Sized,
MerkleProver: RefUnwindSafe,
<MerkleProver as MerkleTreeProver<F>>::Committed: RefUnwindSafe,
F: RefUnwindSafe,
FA: RefUnwindSafe,
impl<'a, F, FA, MerkleProver, VCS> Send for FRIFolder<'a, F, FA, MerkleProver, VCS>where
<F as WithUnderlier>::Underlier: Sized,
<FA as WithUnderlier>::Underlier: Sized,
MerkleProver: Sync,
<MerkleProver as MerkleTreeProver<F>>::Committed: Sync + Send,
impl<'a, F, FA, MerkleProver, VCS> Sync for FRIFolder<'a, F, FA, MerkleProver, VCS>where
<F as WithUnderlier>::Underlier: Sized,
<FA as WithUnderlier>::Underlier: Sized,
MerkleProver: Sync,
<MerkleProver as MerkleTreeProver<F>>::Committed: Sync,
impl<'a, F, FA, MerkleProver, VCS> Unpin for FRIFolder<'a, F, FA, MerkleProver, VCS>where
<F as WithUnderlier>::Underlier: Sized,
<FA as WithUnderlier>::Underlier: Sized,
F: Unpin,
<MerkleProver as MerkleTreeProver<F>>::Committed: Unpin,
impl<'a, F, FA, MerkleProver, VCS> UnwindSafe for FRIFolder<'a, F, FA, MerkleProver, VCS>where
<F as WithUnderlier>::Underlier: Sized,
<FA as WithUnderlier>::Underlier: Sized,
MerkleProver: RefUnwindSafe,
<MerkleProver as MerkleTreeProver<F>>::Committed: RefUnwindSafe + UnwindSafe,
F: RefUnwindSafe + UnwindSafe,
FA: 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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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