Skip to main content

VerifierState

Struct VerifierState 

Source
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: usize

The current round number.

§nv: usize

The number of variables the sumcheck polynomial is in.

§max_multiplicands: usize

The degree of the polynomial.

§finished: bool

true 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::Config

The field configuration to which all the field elements belong to.

Implementations§

Source§

impl<F: PrimeField> VerifierState<F>

Source

pub fn new(nvars: usize, degree: usize, config: &F::Config) -> Self

Initialize the verifier state.

Source§

impl<F: FromPrimitiveWithConfig> VerifierState<F>

Source

pub fn verify_round( &mut self, prover_msg: &ProverMsg<F>, transcript: &mut impl Transcript, ) -> F
where 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.

Source

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.

Source

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>
where <F as PrimeField>::Config: Unpin, F: Unpin,

§

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> 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> 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<F, T> IntoWithConfig<F> for T
where F: PrimeField + FromWithConfig<T>,

§

fn into_with_cfg(self, cfg: &<F as PrimeField>::Config) -> F

§

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