Struct snarkvm_polycommit::sonic_pc::SonicKZG10
source · [−]pub struct SonicKZG10<E: PairingEngine> { /* private fields */ }
Expand description
Polynomial commitment based on [KZG10], with degree enforcement and batching taken from [MBKM19, “Sonic”] (more precisely, their counterparts in [Gabizon19, “AuroraLight”] that avoid negative G1 powers). The (optional) hiding property of the commitment scheme follows the approach described in [CHMMVW20, “Marlin”].
Trait Implementations
sourceimpl<E: Clone + PairingEngine> Clone for SonicKZG10<E>
impl<E: Clone + PairingEngine> Clone for SonicKZG10<E>
sourcefn clone(&self) -> SonicKZG10<E>
fn clone(&self) -> SonicKZG10<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<E: Debug + PairingEngine> Debug for SonicKZG10<E>
impl<E: Debug + PairingEngine> Debug for SonicKZG10<E>
sourceimpl<TargetCurve, BaseCurve, PG> PCCheckVar<<TargetCurve as PairingEngine>::Fr, SonicKZG10<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for SonicKZG10Gadget<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine<Fq = <BaseCurve as PairingEngine>::Fr>,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
impl<TargetCurve, BaseCurve, PG> PCCheckVar<<TargetCurve as PairingEngine>::Fr, SonicKZG10<TargetCurve>, <BaseCurve as PairingEngine>::Fr> for SonicKZG10Gadget<TargetCurve, BaseCurve, PG> where
TargetCurve: PairingEngine<Fq = <BaseCurve as PairingEngine>::Fr>,
BaseCurve: PairingEngine,
PG: PairingGadget<TargetCurve, <BaseCurve as PairingEngine>::Fr>,
type BatchLCProofVar = BatchLCProofVar<TargetCurve, BaseCurve, PG>
type BatchLCProofVar = BatchLCProofVar<TargetCurve, BaseCurve, PG>
An allocated version of PC::BatchLCProof
.
type CommitmentVar = CommitmentVar<TargetCurve, BaseCurve, PG>
type CommitmentVar = CommitmentVar<TargetCurve, BaseCurve, PG>
An allocated version of PC::Commitment
.
type LabeledCommitmentVar = LabeledCommitmentVar<TargetCurve, BaseCurve, PG>
type LabeledCommitmentVar = LabeledCommitmentVar<TargetCurve, BaseCurve, PG>
An allocated version of LabeledCommitment<PC::Commitment>
.
type PreparedCommitmentVar = PreparedCommitmentVar<TargetCurve, BaseCurve, PG>
type PreparedCommitmentVar = PreparedCommitmentVar<TargetCurve, BaseCurve, PG>
An allocated version of PC::PreparedCommitment
.
type PreparedLabeledCommitmentVar = PreparedLabeledCommitmentVar<TargetCurve, BaseCurve, PG>
type PreparedLabeledCommitmentVar = PreparedLabeledCommitmentVar<TargetCurve, BaseCurve, PG>
A prepared, allocated version of LabeledCommitment<PC::Commitment>
.
type PreparedVerifierKeyVar = PreparedVerifierKeyVar<TargetCurve, BaseCurve, PG>
type PreparedVerifierKeyVar = PreparedVerifierKeyVar<TargetCurve, BaseCurve, PG>
An allocated version of PC::PreparedVerifierKey
.
type VerifierKeyVar = VerifierKeyVar<TargetCurve, BaseCurve, PG>
type VerifierKeyVar = VerifierKeyVar<TargetCurve, BaseCurve, PG>
An allocated version of PC::VerifierKey
.
sourcefn prepared_check_combinations<CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerifierKeyVar,
linear_combinations: &[LinearCombinationVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>],
prepared_commitments: &[Self::PreparedLabeledCommitmentVar],
query_set: &QuerySetVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>,
evaluations: &EvaluationsVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>,
proof: &Self::BatchLCProofVar,
rand_data: &PCCheckRandomDataVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>
) -> Result<Boolean, SynthesisError>
fn prepared_check_combinations<CS: ConstraintSystem<<BaseCurve as PairingEngine>::Fr>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerifierKeyVar,
linear_combinations: &[LinearCombinationVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>],
prepared_commitments: &[Self::PreparedLabeledCommitmentVar],
query_set: &QuerySetVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>,
evaluations: &EvaluationsVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>,
proof: &Self::BatchLCProofVar,
rand_data: &PCCheckRandomDataVar<<TargetCurve as PairingEngine>::Fr, <BaseCurve as PairingEngine>::Fr>
) -> Result<Boolean, SynthesisError>
Add to ConstraintSystem<ConstraintF>
new constraints that conditionally check that proof
is a valid evaluation
proof at the points in query_set
for the combinations linear_combinations
. Read more
sourcefn create_labeled_commitment(
label: String,
commitment: Self::CommitmentVar,
degree_bound: Option<FpGadget<<BaseCurve as PairingEngine>::Fr>>
) -> Self::LabeledCommitmentVar
fn create_labeled_commitment(
label: String,
commitment: Self::CommitmentVar,
degree_bound: Option<FpGadget<<BaseCurve as PairingEngine>::Fr>>
) -> Self::LabeledCommitmentVar
Create the labeled commitment gadget from the commitment gadget
sourcefn create_prepared_labeled_commitment(
label: String,
prepared_commitment: Self::PreparedCommitmentVar,
degree_bound: Option<FpGadget<<BaseCurve as PairingEngine>::Fr>>
) -> Self::PreparedLabeledCommitmentVar
fn create_prepared_labeled_commitment(
label: String,
prepared_commitment: Self::PreparedCommitmentVar,
degree_bound: Option<FpGadget<<BaseCurve as PairingEngine>::Fr>>
) -> Self::PreparedLabeledCommitmentVar
Create the prepared labeled commitment gadget from the commitment gadget
sourceimpl<E: PartialEq + PairingEngine> PartialEq<SonicKZG10<E>> for SonicKZG10<E>
impl<E: PartialEq + PairingEngine> PartialEq<SonicKZG10<E>> for SonicKZG10<E>
sourcefn eq(&self, other: &SonicKZG10<E>) -> bool
fn eq(&self, other: &SonicKZG10<E>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SonicKZG10<E>) -> bool
fn ne(&self, other: &SonicKZG10<E>) -> bool
This method tests for !=
.
sourceimpl<E: PairingEngine> PolynomialCommitment<<E as PairingEngine>::Fr, <E as PairingEngine>::Fq> for SonicKZG10<E>
impl<E: PairingEngine> PolynomialCommitment<<E as PairingEngine>::Fr, <E as PairingEngine>::Fq> for SonicKZG10<E>
sourcefn commit_with_terminator<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Error>
fn commit_with_terminator<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Error>
Outputs a commitment to polynomial
.
sourcefn check_combinations<'a, R: RngCore>(
vk: &Self::VerifierKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E::Fr, E::Fq, Self>,
opening_challenge: E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
fn check_combinations<'a, R: RngCore>(
vk: &Self::VerifierKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E::Fr, E::Fq, Self>,
opening_challenge: E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
Checks that values
are the true evaluations at query_set
of the polynomials
committed in labeled_commitments
.
sourcefn open_combinations_individual_opening_challenges<'a>(
ck: &Self::CommitterKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
opening_challenges: &dyn Fn(u64) -> E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>
) -> Result<BatchLCProof<E::Fr, E::Fq, Self>, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
fn open_combinations_individual_opening_challenges<'a>(
ck: &Self::CommitterKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
opening_challenges: &dyn Fn(u64) -> E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>
) -> Result<BatchLCProof<E::Fr, E::Fq, Self>, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
On input a list of polynomials, linear combinations of those polynomials,
and a query set, open_combination
outputs a proof of evaluation of
the combinations at the points in the query set.
sourcefn check_combinations_individual_opening_challenges<'a, R: RngCore>(
vk: &Self::VerifierKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E::Fr, E::Fq, Self>,
opening_challenges: &dyn Fn(u64) -> E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
fn check_combinations_individual_opening_challenges<'a, R: RngCore>(
vk: &Self::VerifierKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E::Fr, E::Fq, Self>,
opening_challenges: &dyn Fn(u64) -> E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
Check combinations with individual challenges.
type BatchProof = Vec<Self::Proof>
type BatchProof = Vec<Self::Proof>
The evaluation proof for a query set.
type Commitment = Commitment<E>
type Commitment = Commitment<E>
The commitment to a polynomial.
type CommitterKey = CommitterKey<E>
type CommitterKey = CommitterKey<E>
The committer key for the scheme; used to commit to a polynomial and then open the commitment to produce an evaluation proof. Read more
type PreparedCommitment = PreparedCommitment<E>
type PreparedCommitment = PreparedCommitment<E>
The prepared commitment to a polynomial.
type PreparedVerifierKey = PreparedVerifierKey<E>
type PreparedVerifierKey = PreparedVerifierKey<E>
The prepared verifier key for the scheme; used to check an evaluation proof.
type Randomness = Randomness<E>
type Randomness = Randomness<E>
The commitment randomness.
type UniversalParams = UniversalParams<E>
type UniversalParams = UniversalParams<E>
The universal parameters for the commitment scheme. These are “trimmed”
down to Self::CommitterKey
and Self::VerifierKey
by Self::trim
. Read more
type VerifierKey = VerifierKey<E>
type VerifierKey = VerifierKey<E>
The verifier key for the scheme; used to check an evaluation proof.
sourcefn setup<R: RngCore>(
max_degree: usize,
rng: &mut R
) -> Result<Self::UniversalParams, Error>
fn setup<R: RngCore>(
max_degree: usize,
rng: &mut R
) -> Result<Self::UniversalParams, Error>
Constructs public parameters when given as input the maximum degree degree
for the polynomial commitment scheme. Read more
sourcefn trim(
pp: &Self::UniversalParams,
supported_degree: usize,
supported_hiding_bound: usize,
enforced_degree_bounds: Option<&[usize]>
) -> Result<(Self::CommitterKey, Self::VerifierKey), Error>
fn trim(
pp: &Self::UniversalParams,
supported_degree: usize,
supported_hiding_bound: usize,
enforced_degree_bounds: Option<&[usize]>
) -> Result<(Self::CommitterKey, Self::VerifierKey), Error>
Specializes the public parameters for polynomials up to the given supported_degree
and for enforcing degree bounds in the range 1..=supported_degree
. Read more
sourcefn open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
_commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: E::Fr,
opening_challenge: E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
_rng: Option<&mut dyn RngCore>
) -> Result<Self::Proof, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
fn open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
_commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: E::Fr,
opening_challenge: E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
_rng: Option<&mut dyn RngCore>
) -> Result<Self::Proof, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
On input a list of labeled polynomials and a query point, open
outputs a proof of evaluation
of the polynomials at the query point. Read more
sourcefn check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: E::Fr,
values: impl IntoIterator<Item = E::Fr>,
proof: &Self::Proof,
opening_challenge: E::Fr,
_rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
fn check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: E::Fr,
values: impl IntoIterator<Item = E::Fr>,
proof: &Self::Proof,
opening_challenge: E::Fr,
_rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
Verifies that values
are the evaluations at point
of the polynomials
committed inside commitments
. Read more
sourcefn batch_check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
values: &Evaluations<'_, E::Fr>,
proof: &Self::BatchProof,
opening_challenge: E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
fn batch_check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
values: &Evaluations<'_, E::Fr>,
proof: &Self::BatchProof,
opening_challenge: E::Fr,
rng: &mut R
) -> Result<bool, Error> where
Self::Commitment: 'a,
Checks that values
are the true evaluations at query_set
of the polynomials
committed in labeled_commitments
. Read more
sourcefn open_combinations<'a>(
ck: &Self::CommitterKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
opening_challenge: E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
rng: Option<&mut dyn RngCore>
) -> Result<BatchLCProof<E::Fr, E::Fq, Self>, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
fn open_combinations<'a>(
ck: &Self::CommitterKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, E::Fr>,
opening_challenge: E::Fr,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
rng: Option<&mut dyn RngCore>
) -> Result<BatchLCProof<E::Fr, E::Fq, Self>, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
On input a list of polynomials, linear combinations of those polynomials,
and a query set, open_combination
outputs a proof of evaluation of
the combinations at the points in the query set. Read more
sourcefn commit<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F>>,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Error>
fn commit<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F>>,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Error>
Outputs a commitments to polynomials
. If polynomials[i].is_hiding()
,
then the i
-th commitment is hiding up to polynomials.hiding_bound()
queries.
rng
should not be None
if polynomials[i].is_hiding() == true
for any i
. Read more
sourcefn batch_open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, F>,
opening_challenge: F,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
_rng: Option<&mut dyn RngCore>
) -> Result<Self::BatchProof, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
fn batch_open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<'_, F>,
opening_challenge: F,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
_rng: Option<&mut dyn RngCore>
) -> Result<Self::BatchProof, Error> where
Self::Randomness: 'a,
Self::Commitment: 'a,
On input a list of labeled polynomials and a query set, open
outputs a proof of evaluation
of the polynomials at the points in the query set. Read more
impl<E: Eq + PairingEngine> Eq for SonicKZG10<E>
impl<E: PairingEngine> StructuralEq for SonicKZG10<E>
impl<E: PairingEngine> StructuralPartialEq for SonicKZG10<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for SonicKZG10<E> where
E: RefUnwindSafe,
impl<E> Send for SonicKZG10<E>
impl<E> Sync for SonicKZG10<E>
impl<E> Unpin for SonicKZG10<E> where
E: Unpin,
impl<E> UnwindSafe for SonicKZG10<E> where
E: 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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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