Struct snarkvm_polycommit::sonic_pc::VerifierKey
source · [−]pub struct VerifierKey<E: PairingEngine> {
pub vk: VerifierKey<E>,
pub degree_bounds_and_neg_powers_of_h: Option<Vec<(usize, E::G2Affine)>>,
pub degree_bounds_and_prepared_neg_powers_of_h: Option<Vec<(usize, <E::G2Affine as PairingCurve>::Prepared)>>,
pub supported_degree: usize,
pub max_degree: usize,
}
Expand description
VerifierKey
is used to check evaluation proofs for a given commitment.
Fields
vk: VerifierKey<E>
The verification key for the underlying KZG10 scheme.
degree_bounds_and_neg_powers_of_h: Option<Vec<(usize, E::G2Affine)>>
Pairs a degree_bound with its corresponding G2 element.
Each pair is in the form (degree_bound, \beta^{degree_bound - max_degree} h),
where h
is the generator of G2 above
degree_bounds_and_prepared_neg_powers_of_h: Option<Vec<(usize, <E::G2Affine as PairingCurve>::Prepared)>>
The prepared version of degree_bounds_and_neg_powers_of_h
.
supported_degree: usize
The maximum degree supported by the trimmed parameters that self
is
a part of.
max_degree: usize
The maximum degree supported by the UniversalParams
self
was derived
from.
Implementations
sourceimpl<E: PairingEngine> VerifierKey<E>
impl<E: PairingEngine> VerifierKey<E>
sourcepub fn get_shift_power(&self, degree_bound: usize) -> Option<E::G2Affine>
pub fn get_shift_power(&self, degree_bound: usize) -> Option<E::G2Affine>
Find the appropriate shift for the degree bound.
pub fn get_prepared_shift_power(
&self,
degree_bound: usize
) -> Option<<E::G2Affine as PairingCurve>::Prepared>
Trait Implementations
sourceimpl<TargetCurve, BaseCurve, PG> AllocGadget<VerifierKey<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for PreparedVerifierKeyVar<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
impl<TargetCurve, BaseCurve, PG> AllocGadget<VerifierKey<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for PreparedVerifierKeyVar<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
_cs: CS,
_value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
_cs: CS,
_value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<V>,
CS: ConstraintSystem<F>,
fn alloc_input_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<V>,
CS: ConstraintSystem<F>,
sourceimpl<TargetCurve, BaseCurve, PG> AllocGadget<VerifierKey<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for VerifierKeyVar<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
impl<TargetCurve, BaseCurve, PG> AllocGadget<VerifierKey<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for VerifierKeyVar<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<VerifierKey<TargetCurve>>, CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<V>,
CS: ConstraintSystem<F>,
fn alloc_input_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<V>,
CS: ConstraintSystem<F>,
sourceimpl<E: PairingEngine> CanonicalDeserialize for VerifierKey<E>
impl<E: PairingEngine> CanonicalDeserialize for VerifierKey<E>
sourcefn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
fn deserialize<R: Read>(reader: &mut R) -> Result<Self, SerializationError>
Reads Self
from reader
.
sourcefn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
fn deserialize_uncompressed<R: Read>(
reader: &mut R
) -> Result<Self, SerializationError>
Reads Self
from reader
without compression.
sourceimpl<E: PairingEngine> CanonicalSerialize for VerifierKey<E>
impl<E: PairingEngine> CanonicalSerialize for VerifierKey<E>
sourcefn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), SerializationError>
Serializes self
into writer
.
fn serialized_size(&self) -> usize
sourcefn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
fn serialize_uncompressed<W: Write>(
&self,
writer: &mut W
) -> Result<(), SerializationError>
Serializes self
into writer
without compression.
fn uncompressed_size(&self) -> usize
sourceimpl<E: PairingEngine> Clone for VerifierKey<E>
impl<E: PairingEngine> Clone for VerifierKey<E>
sourceimpl<E: PairingEngine> Debug for VerifierKey<E>
impl<E: PairingEngine> Debug for VerifierKey<E>
sourceimpl<E: PairingEngine> Default for VerifierKey<E>
impl<E: PairingEngine> Default for VerifierKey<E>
sourceimpl<E: PairingEngine> FromBytes for VerifierKey<E>
impl<E: PairingEngine> FromBytes for VerifierKey<E>
sourceimpl<E: PairingEngine> PCVerifierKey for VerifierKey<E>
impl<E: PairingEngine> PCVerifierKey for VerifierKey<E>
sourcefn max_degree(&self) -> usize
fn max_degree(&self) -> usize
Outputs the maximum degree supported by the universal parameters
Self
was derived from. Read more
sourcefn supported_degree(&self) -> usize
fn supported_degree(&self) -> usize
Outputs the maximum degree supported by the verifier key.
sourceimpl<E: PairingEngine> Prepare<PreparedVerifierKey<E>> for VerifierKey<E>
impl<E: PairingEngine> Prepare<PreparedVerifierKey<E>> for VerifierKey<E>
sourcefn prepare(&self) -> PreparedVerifierKey<E>
fn prepare(&self) -> PreparedVerifierKey<E>
prepare PreparedVerifierKey
from VerifierKey
sourceimpl<E: PairingEngine> ToBytes for VerifierKey<E>
impl<E: PairingEngine> ToBytes for VerifierKey<E>
sourceimpl<E: PairingEngine> ToConstraintField<<E as PairingEngine>::Fq> for VerifierKey<E>
impl<E: PairingEngine> ToConstraintField<<E as PairingEngine>::Fq> for VerifierKey<E>
fn to_field_elements(&self) -> Result<Vec<E::Fq>, ConstraintFieldError>
Auto Trait Implementations
impl<E> RefUnwindSafe for VerifierKey<E> where
<E as PairingEngine>::G1Affine: RefUnwindSafe,
<E as PairingEngine>::G2Affine: RefUnwindSafe,
<<E as PairingEngine>::G2Affine as PairingCurve>::Prepared: RefUnwindSafe,
impl<E> Send for VerifierKey<E>
impl<E> Sync for VerifierKey<E>
impl<E> Unpin for VerifierKey<E> where
<E as PairingEngine>::G1Affine: Unpin,
<E as PairingEngine>::G2Affine: Unpin,
<<E as PairingEngine>::G2Affine as PairingCurve>::Prepared: Unpin,
impl<E> UnwindSafe for VerifierKey<E> where
<E as PairingEngine>::G1Affine: UnwindSafe,
<E as PairingEngine>::G2Affine: UnwindSafe,
<<E as PairingEngine>::G2Affine as PairingCurve>::Prepared: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more