pub struct ProverIndex<G: KimchiCurve, OpeningProof: OpenProof<G>> {
    pub cs: ConstraintSystem<G::ScalarField>,
    pub linearization: Linearization<Vec<PolishToken<G::ScalarField, Column>>, Column>,
    pub powers_of_alpha: Alphas<G::ScalarField>,
    pub srs: Arc<OpeningProof::SRS>,
    pub max_poly_size: usize,
    pub column_evaluations: ColumnEvaluations<G::ScalarField>,
    pub verifier_index: Option<VerifierIndex<G, OpeningProof>>,
    pub verifier_index_digest: Option<G::BaseField>,
}
Expand description

The index used by the prover

Fields§

§cs: ConstraintSystem<G::ScalarField>

constraints system polynomials

§linearization: Linearization<Vec<PolishToken<G::ScalarField, Column>>, Column>

The symbolic linearization of our circuit, which can compile to concrete types once certain values are learned in the protocol.

§powers_of_alpha: Alphas<G::ScalarField>

The mapping between powers of alpha and constraints

§srs: Arc<OpeningProof::SRS>

polynomial commitment keys

§max_poly_size: usize

maximal size of polynomial section

§column_evaluations: ColumnEvaluations<G::ScalarField>§verifier_index: Option<VerifierIndex<G, OpeningProof>>

The verifier index corresponding to this prover index

§verifier_index_digest: Option<G::BaseField>

The verifier index digest corresponding to this prover index

Implementations§

source§

impl<F: PrimeField + SquareRootField, G: KimchiCurve<ScalarField = F>, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>

source

pub fn verify( &self, witness: &[Vec<F>; 15], public: &[F] ) -> Result<(), GateError>

This function verifies the consistency of the wire assignments (witness) against the constraints witness: wire assignment witness RETURN: verification status

source§

impl<F: PrimeField, G: KimchiCurve<ScalarField = F>, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>

source

pub fn verify_generic( &self, witness: &[DensePolynomial<F>; 15], public: &DensePolynomial<F> ) -> bool

Function to verify the generic polynomials with a witness.

source§

impl<F: PrimeField, G: KimchiCurve<ScalarField = F>, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>

source

pub fn perm_quot( &self, lagrange: &WitnessOverDomains<F>, beta: F, gamma: F, z: &DensePolynomial<F>, alphas: impl Iterator<Item = F> ) -> Result<(Evaluations<F, D<F>>, DensePolynomial<F>), ProverError>

permutation quotient poly contribution computation

Errors

Will give error if polynomial division fails.

Panics

Will panic if power of alpha is missing.

source

pub fn perm_lnrz( &self, e: &ProofEvaluations<PointEvaluations<F>>, zeta: F, beta: F, gamma: F, alphas: impl Iterator<Item = F> ) -> Evaluations<F, D<F>>

permutation linearization poly contribution computation

source§

impl<F: PrimeField, G: KimchiCurve<ScalarField = F>, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>

source

pub fn perm_aggreg( &self, witness: &[Vec<F>; 15], beta: &F, gamma: &F, rng: &mut (impl RngCore + CryptoRng) ) -> Result<DensePolynomial<F>, ProverError>

permutation aggregation polynomial computation

Errors

Will give error if permutation result is not correct.

Panics

Will panic if first element is not 1.

source§

impl<G: KimchiCurve, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>
where G::BaseField: PrimeField,

source

pub fn create( cs: ConstraintSystem<G::ScalarField>, endo_q: G::ScalarField, srs: Arc<OpeningProof::SRS> ) -> Self

this function compiles the index from constraints

source

pub fn compute_verifier_index_digest<EFqSponge: Clone + FqSponge<G::BaseField, G, G::ScalarField>>( &mut self ) -> G::BaseField
where VerifierIndex<G, OpeningProof>: Clone,

Retrieve or compute the digest for the corresponding verifier index. If the digest is not already cached inside the index, store it.

source

pub fn verifier_index_digest<EFqSponge: Clone + FqSponge<G::BaseField, G, G::ScalarField>>( &self ) -> G::BaseField
where VerifierIndex<G, OpeningProof>: Clone,

Retrieve or compute the digest for the corresponding verifier index.

source§

impl<G: KimchiCurve, OpeningProof: OpenProof<G>> ProverIndex<G, OpeningProof>
where G::BaseField: PrimeField,

source

pub fn verifier_index(&self) -> VerifierIndex<G, OpeningProof>
where VerifierIndex<G, OpeningProof>: Clone,

Produces the VerifierIndex from the prover’s ProverIndex.

Panics

Will panic if srs cannot be in cell.

Trait Implementations§

source§

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

source§

fn clone(&self) -> ProverIndex<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 ProverIndex<G, OpeningProof>
where G::ScalarField: Debug, OpeningProof::SRS: Debug, G::BaseField: Debug,

source§

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

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

impl<'de, G, OpeningProof> Deserialize<'de> for ProverIndex<G, OpeningProof>
where ConstraintSystem<G::ScalarField>: Serialize + DeserializeOwned, OpeningProof::SRS: Default, ColumnEvaluations<G::ScalarField>: Serialize + DeserializeOwned, G: Default + KimchiCurve, OpeningProof: Default + OpenProof<G>,

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 ProverIndex<G, OpeningProof>

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 ProverIndex<G, OpeningProof>
where G: RefUnwindSafe, <G as AffineCurve>::BaseField: RefUnwindSafe, <OpeningProof as OpenProof<G>>::SRS: RefUnwindSafe, <G as AffineCurve>::ScalarField: UnwindSafe + RefUnwindSafe,

§

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

§

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

§

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

§

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

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