binius_core::protocols::fri

Struct FRIFolder

source
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>,

source

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.

source

pub fn n_rounds(&self) -> usize

Number of fold rounds, including the final fold.

source

pub fn curr_round(&self) -> usize

Number of times execute_fold_round has been called.

source

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.

source

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.

source

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>

§

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>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more