pub struct VerifierState<F: PrimeField> {
pub round: usize,
pub nv: usize,
pub max_multiplicands: usize,
pub finished: bool,
pub polynomials_received: Vec<NatEvaluatedPolyWithoutConstant<F>>,
pub randomness: Vec<F>,
pub config: F::Config,
}Expand description
Sumcheck Verifier State.
Fields§
§round: usizeThe current round number.
nv: usizeThe number of variables the sumcheck polynomial is in.
max_multiplicands: usizeThe degree of the polynomial.
finished: booltrue if the protocol has finished.
polynomials_received: Vec<NatEvaluatedPolyWithoutConstant<F>>A list storing the univariate polynomial in evaluation form sent by the prover at each round so far.
randomness: Vec<F>A list storing the randomness sampled by the verifier at each round so far.
config: F::ConfigThe field configuration to which all the field elements belong to.
Implementations§
Source§impl<F: PrimeField> VerifierState<F>
impl<F: PrimeField> VerifierState<F>
Source§impl<F: FromPrimitiveWithConfig> VerifierState<F>
impl<F: FromPrimitiveWithConfig> VerifierState<F>
Sourcepub fn verify_round(
&mut self,
prover_msg: &ProverMsg<F>,
transcript: &mut impl Transcript,
) -> Fwhere
F::Inner: ConstTranscribable,
pub fn verify_round(
&mut self,
prover_msg: &ProverMsg<F>,
transcript: &mut impl Transcript,
) -> Fwhere
F::Inner: ConstTranscribable,
Run verifier at current round, given prover message.
Samples a Fiat-Shamir challenge from the transcript and delegates to
Self::verify_round_with_challenge. Returns the sampled challenge.
Sourcepub fn verify_round_with_challenge(
&mut self,
prover_msg: &ProverMsg<F>,
challenge: F,
)
pub fn verify_round_with_challenge( &mut self, prover_msg: &ProverMsg<F>, challenge: F, )
Processes one round of the sumcheck protocol given an explicit
challenge. Stores the prover’s round polynomial and the challenge, then
advances the round counter. Actual consistency checks are deferred
to Self::check_and_generate_subclaim.
Sourcepub fn check_and_generate_subclaim(
self,
asserted_sum: F,
) -> Result<Subclaim<F>, SumCheckError<F>>
pub fn check_and_generate_subclaim( self, asserted_sum: F, ) -> Result<Subclaim<F>, SumCheckError<F>>
Verify the sumcheck phase, and generate the subclaim.
The verifier reconstructs the missing constant term under the
assumption that P(0) + P(1) == expected. If the asserted sum is
correct, then the multilinear polynomial evaluated at subclaim.point
is subclaim.expected_evaluation.
Auto Trait Implementations§
impl<F> Freeze for VerifierState<F>where
<F as PrimeField>::Config: Freeze,
impl<F> RefUnwindSafe for VerifierState<F>where
<F as PrimeField>::Config: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for VerifierState<F>
impl<F> Sync for VerifierState<F>
impl<F> Unpin for VerifierState<F>
impl<F> UnsafeUnpin for VerifierState<F>where
<F as PrimeField>::Config: UnsafeUnpin,
impl<F> UnwindSafe for VerifierState<F>where
<F as PrimeField>::Config: UnwindSafe,
F: UnwindSafe,
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
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