jf_plonk::proof_system::structs

Struct VerifyingKey

Source
pub struct VerifyingKey<E: Pairing> {
    pub domain_size: usize,
    pub num_inputs: usize,
    pub sigma_comms: Vec<Commitment<E>>,
    pub selector_comms: Vec<Commitment<E>>,
    pub k: Vec<E::ScalarField>,
    pub open_key: OpenKey<E>,
    pub is_merged: bool,
    pub plookup_vk: Option<PlookupVerifyingKey<E>>,
}
Expand description

Preprocessed verifier parameters used to verify Plonk proofs for a certain circuit.

Fields§

§domain_size: usize

The size of the evaluation domain. Should be a power of two.

§num_inputs: usize

The number of public inputs.

§sigma_comms: Vec<Commitment<E>>

The permutation polynomial commitments. The commitments are not hiding.

§selector_comms: Vec<Commitment<E>>

The selector polynomial commitments. The commitments are not hiding.

§k: Vec<E::ScalarField>

The constants K0, …, K_num_wire_types that ensure wire subsets are disjoint.

§open_key: OpenKey<E>

KZG PCS opening key.

§is_merged: bool

A flag indicating whether the key is a merged key.

§plookup_vk: Option<PlookupVerifyingKey<E>>

Plookup verifying key, None if not support lookup.

Implementations§

Source§

impl<E, F, P> VerifyingKey<E>
where E: Pairing<BaseField = F, G1Affine = Affine<P>>, F: SWToTEConParam, P: SWCurveConfig<BaseField = F>,

Source

pub fn convert_te_coordinates_to_scalars(&self) -> Vec<F>

Convert the group elements to a list of scalars that represent the Twisted Edwards coordinates.

Source§

impl<E: Pairing> VerifyingKey<E>

Source

pub fn dummy(num_inputs: usize, domain_size: usize) -> Self

Create a dummy TurboPlonk verification key for a circuit with num_inputs public inputs and domain size domain_size.

Trait Implementations§

Source§

impl<E: Pairing> CanonicalDeserialize for VerifyingKey<E>

Source§

fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>

The general deserialize method that takes in customization flags.
§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_compressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_uncompressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

Source§

impl<E: Pairing> CanonicalSerialize for VerifyingKey<E>

Source§

fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>

The general serialize method that takes in customization flags.
Source§

fn serialized_size(&self, compress: Compress) -> usize

§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

§

fn compressed_size(&self) -> usize

§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

§

fn uncompressed_size(&self) -> usize

Source§

impl<E: Clone + Pairing> Clone for VerifyingKey<E>
where E::ScalarField: Clone,

Source§

fn clone(&self) -> VerifyingKey<E>

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<E: Debug + Pairing> Debug for VerifyingKey<E>
where E::ScalarField: Debug,

Source§

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

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

impl<E, F, P1, P2> From<VerifyingKey<E>> for Vec<E::BaseField>
where E: Pairing<G1Affine = Affine<P1>, G2Affine = Affine<P2>, TargetField = Fp2<F>>, F: Fp2Config<Fp = E::BaseField>, P1: SWCurveConfig<BaseField = E::BaseField, ScalarField = E::ScalarField>, P2: SWCurveConfig<BaseField = E::TargetField, ScalarField = E::ScalarField>,

Source§

fn from(vk: VerifyingKey<E>) -> Self

Converts to this type from the input type.
Source§

impl<E: PartialEq + Pairing> PartialEq for VerifyingKey<E>
where E::ScalarField: PartialEq,

Source§

fn eq(&self, other: &VerifyingKey<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E: Pairing> Valid for VerifyingKey<E>

Source§

fn check(&self) -> Result<(), SerializationError>

Source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Self> + Send, ) -> Result<(), SerializationError>
where Self: 'a,

Source§

impl<E: Eq + Pairing> Eq for VerifyingKey<E>
where E::ScalarField: Eq,

Source§

impl<E: Pairing> StructuralPartialEq for VerifyingKey<E>

Auto Trait Implementations§

§

impl<E> Freeze for VerifyingKey<E>
where <E as Pairing>::G1Affine: Freeze, <E as Pairing>::G2Affine: Freeze,

§

impl<E> RefUnwindSafe for VerifyingKey<E>
where <E as Pairing>::G1Affine: RefUnwindSafe, <E as Pairing>::G2Affine: RefUnwindSafe, <E as Pairing>::ScalarField: RefUnwindSafe,

§

impl<E> Send for VerifyingKey<E>

§

impl<E> Sync for VerifyingKey<E>

§

impl<E> Unpin for VerifyingKey<E>
where <E as Pairing>::G1Affine: Unpin, <E as Pairing>::G2Affine: Unpin, <E as Pairing>::ScalarField: Unpin,

§

impl<E> UnwindSafe for VerifyingKey<E>
where <E as Pairing>::G1Affine: UnwindSafe, <E as Pairing>::G2Affine: UnwindSafe, <E as Pairing>::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
§

impl<T> CanonicalSerializeHashExt for T
where T: CanonicalSerialize,

§

fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

§

fn hash_uncompressed<H>( &self, ) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>
where H: Digest,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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<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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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