pub struct BatchVerifier<F: Field, C> { /* private fields */ }
Expand description
Verifier for a front-loaded batch sumcheck protocol execution.
The sumcheck protocol over can be batched over multiple instances by taking random linear combinations over the claimed sums and polynomials. When the sumcheck instances are not all over polynomials with the same number of variables, we can still batch them together.
This version of the protocols sharing the round challenges of the early rounds across sumcheck
claims with different numbers of variables. In contrast, the
crate::protocols::sumcheck::verify
module implements batches sumcheck sharing later
round challenges. We call this version a “front-loaded” sumcheck.
For each sumcheck claim, we sample one random mixing coefficient. The multiple composite claims within each claim over a group of multilinears are mixed using the powers of the mixing coefficient.
This exposes a round-by-round interface so that the protocol call be interleaved with other interactive protocols, sharing the same sequence of challenges. The verification logic must be invoked with a specific sequence of calls, continuing for as many rounds as necessary until all claims are finished.
- construct a new verifier with
BatchVerifier::new
- call
BatchVerifier::try_finish_claim
until it returnsNone
- if
BatchVerifier::remaining_claims
is 0, callBatchVerifier::finish
, otherwise proceed to step 4 - call
BatchVerifier::receive_round_proof
- sample a random challenge and call
BatchVerifier::finish_round
with it - repeat from step 2
Implementations§
Source§impl<F, C> BatchVerifier<F, C>
impl<F, C> BatchVerifier<F, C>
Sourcepub fn new<Transcript>(
claims: &[SumcheckClaim<F, C>],
transcript: &mut Transcript,
) -> Result<Self, Error>where
Transcript: CanSample<F>,
pub fn new<Transcript>(
claims: &[SumcheckClaim<F, C>],
transcript: &mut Transcript,
) -> Result<Self, Error>where
Transcript: CanSample<F>,
Constructs a new verifier for the front-loaded batched sumcheck.
The constructor samples batching coefficients from the proof transcript.
§Throws
- if the claims are not sorted in ascending order by number of variables
Sourcepub fn remaining_claims(&self) -> usize
pub fn remaining_claims(&self) -> usize
Returns the number of sumcheck claims that have not finished.
Sourcepub fn try_finish_claim<Transcript>(
&mut self,
transcript: &mut Transcript,
) -> Result<Option<Vec<F>>, Error>where
Transcript: CanRead,
pub fn try_finish_claim<Transcript>(
&mut self,
transcript: &mut Transcript,
) -> Result<Option<Vec<F>>, Error>where
Transcript: CanRead,
Processes the next finished sumcheck claim, if all of its rounds are complete.
Sourcepub fn receive_round_proof<Transcript>(
&mut self,
transcript: &mut Transcript,
) -> Result<(), Error>where
Transcript: CanRead,
pub fn receive_round_proof<Transcript>(
&mut self,
transcript: &mut Transcript,
) -> Result<(), Error>where
Transcript: CanRead,
Reads the round message from the proof transcript.
Sourcepub fn finish_round(&mut self, challenge: F) -> Result<(), Error>
pub fn finish_round(&mut self, challenge: F) -> Result<(), Error>
Finishes an interaction round by reducing the instance with a random challenge.
Trait Implementations§
Auto Trait Implementations§
impl<F, C> Freeze for BatchVerifier<F, C>
impl<F, C> RefUnwindSafe for BatchVerifier<F, C>
impl<F, C> Send for BatchVerifier<F, C>
impl<F, C> Sync for BatchVerifier<F, C>
impl<F, C> Unpin for BatchVerifier<F, C>
impl<F, C> UnwindSafe for BatchVerifier<F, C>
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
§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>
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