Struct winter_fri::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>,
impl<E, H, R> DefaultProverChannel<E, H, R>where E: FieldElement, H: ElementHasher<BaseField = E::BaseField>, R: RandomCoin<BaseField = E::BaseField, Hasher = H>,
sourcepub fn new(domain_size: usize, num_queries: usize) -> Self
pub fn new(domain_size: usize, num_queries: usize) -> Self
Returns a new prover channel instantiated from the specified parameters.
Panics
Panics if:
domain_sizeis smaller than 8 or is not a power of two.num_queriesis zero.
sourcepub fn draw_query_positions(&mut self, nonce: u64) -> Vec<usize>
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.
sourcepub fn layer_commitments(&self) -> &[H::Digest]
pub fn layer_commitments(&self) -> &[H::Digest]
Returns a list of FRI layer commitments written by the prover into this channel.