pub struct VerifierIndex<G: KimchiCurve, OpeningProof: OpenProof<G>> {
Show 27 fields pub domain: Radix2EvaluationDomain<G::ScalarField>, pub max_poly_size: usize, pub zk_rows: u64, pub srs: Arc<OpeningProof::SRS>, pub public: usize, pub prev_challenges: usize, pub sigma_comm: [PolyComm<G>; 7], pub coefficients_comm: [PolyComm<G>; 15], pub generic_comm: PolyComm<G>, pub psm_comm: PolyComm<G>, pub complete_add_comm: PolyComm<G>, pub mul_comm: PolyComm<G>, pub emul_comm: PolyComm<G>, pub endomul_scalar_comm: PolyComm<G>, pub range_check0_comm: Option<PolyComm<G>>, pub range_check1_comm: Option<PolyComm<G>>, pub foreign_field_add_comm: Option<PolyComm<G>>, pub foreign_field_mul_comm: Option<PolyComm<G>>, pub xor_comm: Option<PolyComm<G>>, pub rot_comm: Option<PolyComm<G>>, pub shift: [G::ScalarField; 7], pub permutation_vanishing_polynomial_m: OnceCell<DensePolynomial<G::ScalarField>>, pub w: OnceCell<G::ScalarField>, pub endo: G::ScalarField, pub lookup_index: Option<LookupVerifierIndex<G>>, pub linearization: Linearization<Vec<PolishToken<G::ScalarField, Column>>, Column>, pub powers_of_alpha: Alphas<G::ScalarField>,
}

Fields§

§domain: Radix2EvaluationDomain<G::ScalarField>

evaluation domain

§max_poly_size: usize

maximal size of polynomial section

§zk_rows: u64

the number of randomized rows to achieve zero knowledge

§srs: Arc<OpeningProof::SRS>

polynomial commitment keys

§public: usize

number of public inputs

§prev_challenges: usize

number of previous evaluation challenges, for recursive proving

§sigma_comm: [PolyComm<G>; 7]

permutation commitment array

§coefficients_comm: [PolyComm<G>; 15]

coefficient commitment array

§generic_comm: PolyComm<G>

coefficient commitment array

§psm_comm: PolyComm<G>

poseidon constraint selector polynomial commitment

§complete_add_comm: PolyComm<G>

EC addition selector polynomial commitment

§mul_comm: PolyComm<G>

EC variable base scalar multiplication selector polynomial commitment

§emul_comm: PolyComm<G>

endoscalar multiplication selector polynomial commitment

§endomul_scalar_comm: PolyComm<G>

endoscalar multiplication scalar computation selector polynomial commitment

§range_check0_comm: Option<PolyComm<G>>

RangeCheck0 polynomial commitments

§range_check1_comm: Option<PolyComm<G>>

RangeCheck1 polynomial commitments

§foreign_field_add_comm: Option<PolyComm<G>>

Foreign field addition gates polynomial commitments

§foreign_field_mul_comm: Option<PolyComm<G>>

Foreign field multiplication gates polynomial commitments

§xor_comm: Option<PolyComm<G>>

Xor commitments

§rot_comm: Option<PolyComm<G>>

Rot commitments

§shift: [G::ScalarField; 7]

wire coordinate shifts

§permutation_vanishing_polynomial_m: OnceCell<DensePolynomial<G::ScalarField>>

zero-knowledge polynomial

§w: OnceCell<G::ScalarField>

domain offset for zero-knowledge

§endo: G::ScalarField

endoscalar coefficient

§lookup_index: Option<LookupVerifierIndex<G>>§linearization: Linearization<Vec<PolishToken<G::ScalarField, Column>>, Column>§powers_of_alpha: Alphas<G::ScalarField>

The mapping between powers of alpha and constraints

Implementations§

source§

impl<G: KimchiCurve, OpeningProof: OpenProof<G>> VerifierIndex<G, OpeningProof>

source

pub fn srs(&self) -> &Arc<OpeningProof::SRS>
where G::BaseField: PrimeField,

Gets srs from VerifierIndex lazily

source

pub fn permutation_vanishing_polynomial_m( &self ) -> &DensePolynomial<G::ScalarField>

Gets permutation_vanishing_polynomial_m from VerifierIndex lazily

source

pub fn w(&self) -> &G::ScalarField

Gets w from VerifierIndex lazily

source

pub fn from_file( srs: Arc<OpeningProof::SRS>, path: &Path, offset: Option<u64>, endo: G::ScalarField ) -> Result<Self, String>
where OpeningProof::SRS: Default,

Deserializes a VerifierIndex from a file, given a pointer to an SRS and an optional offset in the file.

Errors

Will give error if it fails to deserialize from file or unable to set srs in verifier_index.

source

pub fn to_file(&self, path: &Path, append: Option<bool>) -> Result<(), String>

Writes a VerifierIndex to a file, potentially appending it to the already-existing content (if append is set to true)

Errors

Will give error if it fails to open a file or writes to the file.

Panics

Will panic if path is invalid or file serialization has issue.

source

pub fn digest<EFqSponge: Clone + FqSponge<G::BaseField, G, G::ScalarField>>( &self ) -> G::BaseField

Compute the digest of the VerifierIndex, which can be used for the Fiat-Shamir transformation while proving / verifying.

Trait Implementations§

source§

impl<G: Clone + KimchiCurve, OpeningProof: Clone + OpenProof<G>> Clone for VerifierIndex<G, OpeningProof>
where G::ScalarField: Clone, OpeningProof::SRS: Clone,

source§

fn clone(&self) -> VerifierIndex<G, OpeningProof>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<G: Debug + KimchiCurve, OpeningProof: Debug + OpenProof<G>> Debug for VerifierIndex<G, OpeningProof>
where G::ScalarField: Debug, OpeningProof::SRS: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, G: KimchiCurve, OpeningProof: OpenProof<G>> Deserialize<'de> for VerifierIndex<G, OpeningProof>
where OpeningProof::SRS: Default, PolyComm<G>: Serialize + DeserializeOwned, Option<PolyComm<G>>: Serialize + DeserializeOwned, G::ScalarField: Default,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<G: KimchiCurve, OpeningProof: OpenProof<G>> Serialize for VerifierIndex<G, OpeningProof>
where PolyComm<G>: Serialize + DeserializeOwned, Option<PolyComm<G>>: Serialize + DeserializeOwned,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<G, OpeningProof> RefUnwindSafe for VerifierIndex<G, OpeningProof>
where G: RefUnwindSafe, <OpeningProof as OpenProof<G>>::SRS: RefUnwindSafe, <G as AffineCurve>::ScalarField: UnwindSafe + RefUnwindSafe,

§

impl<G, OpeningProof> Send for VerifierIndex<G, OpeningProof>
where <OpeningProof as OpenProof<G>>::SRS: Sync + Send,

§

impl<G, OpeningProof> Sync for VerifierIndex<G, OpeningProof>
where <OpeningProof as OpenProof<G>>::SRS: Sync + Send,

§

impl<G, OpeningProof> Unpin for VerifierIndex<G, OpeningProof>
where G: Unpin, <G as AffineCurve>::ScalarField: Unpin,

§

impl<G, OpeningProof> UnwindSafe for VerifierIndex<G, OpeningProof>
where G: UnwindSafe, <OpeningProof as OpenProof<G>>::SRS: RefUnwindSafe, <G as AffineCurve>::ScalarField: 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.

§

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,