Struct kimchi::verifier_index::VerifierIndex
source · pub struct VerifierIndex<G: KimchiCurve, OpeningProof: OpenProof<G>> {Show 27 fields
pub domain: D<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, BerkeleyChallengeTerm>>, Column>,
pub powers_of_alpha: Alphas<G::ScalarField>,
}
Fields§
§domain: D<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, BerkeleyChallengeTerm>>, 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>
impl<G: KimchiCurve, OpeningProof: OpenProof<G>> VerifierIndex<G, OpeningProof>
sourcepub fn srs(&self) -> &Arc<OpeningProof::SRS>where
G::BaseField: PrimeField,
pub fn srs(&self) -> &Arc<OpeningProof::SRS>where G::BaseField: PrimeField,
Gets srs from VerifierIndex
lazily
sourcepub fn permutation_vanishing_polynomial_m(
&self
) -> &DensePolynomial<G::ScalarField>
pub fn permutation_vanishing_polynomial_m( &self ) -> &DensePolynomial<G::ScalarField>
Gets permutation_vanishing_polynomial_m from VerifierIndex
lazily
sourcepub fn w(&self) -> &G::ScalarField
pub fn w(&self) -> &G::ScalarField
Gets w from VerifierIndex
lazily
sourcepub fn from_file(
srs: Arc<OpeningProof::SRS>,
path: &Path,
offset: Option<u64>,
endo: G::ScalarField
) -> Result<Self, String>where
OpeningProof::SRS: Default,
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
.
sourcepub fn to_file(&self, path: &Path, append: Option<bool>) -> Result<(), String>
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.
sourcepub fn digest<EFqSponge: Clone + FqSponge<G::BaseField, G, G::ScalarField>>(
&self
) -> G::BaseField
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,
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>
fn clone(&self) -> VerifierIndex<G, OpeningProof>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more