DefaultProverChannel

Struct DefaultProverChannel 

Source
pub struct DefaultProverChannel<E, H, R>
where E: FieldElement, H: ElementHasher<BaseField = E::BaseField>, R: RandomCoin<BaseField = E::BaseField, Hasher = H>,
{ /* private fields */ }
Expand description

Provides a default implementation of the ProverChannel trait.

Though this implementation is intended primarily for testing purposes, it can be used in production use cases as well.

Implementations§

Source§

impl<E, H, R> DefaultProverChannel<E, H, R>
where E: FieldElement, H: ElementHasher<BaseField = E::BaseField>, R: RandomCoin<BaseField = E::BaseField, Hasher = H>,

Source

pub fn new(domain_size: usize, num_queries: usize) -> Self

Returns a new prover channel instantiated from the specified parameters.

§Panics

Panics if:

  • domain_size is smaller than 8 or is not a power of two.
  • num_queries is zero.
Source

pub fn draw_query_positions(&mut self, nonce: u64) -> Vec<usize>

Draws a set of positions at which the polynomial evaluations committed at the first FRI layer should be queried.

The positions are pseudo-randomly generated based on the values the prover has written into this channel and a PoW nonce.

§Panics

Panics if the specified number of unique positions could not be drawn from the specified domain. Both number of queried positions and domain size are specified during construction of the channel.

Source

pub fn layer_commitments(&self) -> &[H::Digest]

Returns a list of FRI layer commitments written by the prover into this channel.

Trait Implementations§

Source§

impl<E, H, R> ProverChannel<E> for DefaultProverChannel<E, H, R>
where E: FieldElement, H: ElementHasher<BaseField = E::BaseField>, R: RandomCoin<BaseField = E::BaseField, Hasher = H>,

Source§

type Hasher = H

Hash function used by the prover to commit to polynomial evaluations.
Source§

fn commit_fri_layer(&mut self, layer_root: H::Digest)

Sends a layer commitment to the verifier. Read more
Source§

fn draw_fri_alpha(&mut self) -> E

Returns a random α drawn uniformly at random from the entire field. Read more

Auto Trait Implementations§

§

impl<E, H, R> Freeze for DefaultProverChannel<E, H, R>
where R: Freeze,

§

impl<E, H, R> RefUnwindSafe for DefaultProverChannel<E, H, R>

§

impl<E, H, R> Send for DefaultProverChannel<E, H, R>
where R: Send,

§

impl<E, H, R> Sync for DefaultProverChannel<E, H, R>

§

impl<E, H, R> Unpin for DefaultProverChannel<E, H, R>
where R: Unpin, E: Unpin, <H as Hasher>::Digest: Unpin,

§

impl<E, H, R> UnwindSafe for DefaultProverChannel<E, H, R>
where R: UnwindSafe, E: UnwindSafe, <H as Hasher>::Digest: UnwindSafe,

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.

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> 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.