Struct snarkvm_algorithms::polycommit::sonic_pc::SonicKZG10
source · pub struct SonicKZG10<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> { /* 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”].
Implementations
sourceimpl<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> SonicKZG10<E, S>
impl<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> SonicKZG10<E, S>
pub fn load_srs(max_degree: usize) -> Result<UniversalParams<E>, PCError>
pub fn trim(
pp: &UniversalParams<E>,
supported_degree: usize,
supported_lagrange_sizes: impl IntoIterator<Item = usize>,
supported_hiding_bound: usize,
enforced_degree_bounds: Option<&[usize]>
) -> Result<(CommitterKey<E>, VerifierKey<E>), PCError>
sourcepub fn commit<'b>(
ck: &CommitterKey<E>,
polynomials: impl IntoIterator<Item = LabeledPolynomialWithBasis<'b, E::Fr>>,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Commitment<E>>>, Vec<Randomness<E>>), PCError>
pub fn commit<'b>(
ck: &CommitterKey<E>,
polynomials: impl IntoIterator<Item = LabeledPolynomialWithBasis<'b, E::Fr>>,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Commitment<E>>>, Vec<Randomness<E>>), PCError>
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
.
If for some i
, polynomials[i].is_hiding() == false
, then the
corresponding randomness is Randomness<E>::empty()
.
If for some i
, polynomials[i].degree_bound().is_some()
, then that
polynomial will have the corresponding degree bound enforced.
sourcepub fn commit_with_terminator<'a>(
ck: &CommitterKey<E>,
polynomials: impl IntoIterator<Item = LabeledPolynomialWithBasis<'a, E::Fr>>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Commitment<E>>>, Vec<Randomness<E>>), PCError>
pub fn commit_with_terminator<'a>(
ck: &CommitterKey<E>,
polynomials: impl IntoIterator<Item = LabeledPolynomialWithBasis<'a, E::Fr>>,
terminator: &AtomicBool,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Commitment<E>>>, Vec<Randomness<E>>), PCError>
Outputs a commitment to polynomial
.
pub fn combine_for_open<'a>(
ck: &CommitterKey<E>,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
rands: impl IntoIterator<Item = &'a Randomness<E>>,
fs_rng: &mut S
) -> Result<(DensePolynomial<E::Fr>, Randomness<E>), PCError>where
Randomness<E>: 'a,
Commitment<E>: 'a,
sourcepub fn batch_open<'a>(
ck: &CommitterKey<E>,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
rands: impl IntoIterator<Item = &'a Randomness<E>>,
fs_rng: &mut S
) -> Result<BatchProof<E>, PCError>where
Randomness<E>: 'a,
Commitment<E>: 'a,
pub fn batch_open<'a>(
ck: &CommitterKey<E>,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
rands: impl IntoIterator<Item = &'a Randomness<E>>,
fs_rng: &mut S
) -> Result<BatchProof<E>, PCError>where
Randomness<E>: 'a,
Commitment<E>: '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.
pub fn batch_check<'a>(
vk: &VerifierKey<E>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
values: &Evaluations<'_, E::Fr>,
proof: &BatchProof<E>,
fs_rng: &mut S
) -> Result<bool, PCError>where
Commitment<E>: 'a,
pub fn open_combinations<'a>(
ck: &CommitterKey<E>,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
rands: impl IntoIterator<Item = &'a Randomness<E>>,
fs_rng: &mut S
) -> Result<BatchLCProof<E>, PCError>where
Randomness<E>: 'a,
Commitment<E>: 'a,
sourcepub fn check_combinations<'a>(
vk: &VerifierKey<E>,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E>,
fs_rng: &mut S
) -> Result<bool, PCError>where
Commitment<E>: 'a,
pub fn check_combinations<'a>(
vk: &VerifierKey<E>,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<'_, E::Fr>,
evaluations: &Evaluations<'_, E::Fr>,
proof: &BatchLCProof<E>,
fs_rng: &mut S
) -> Result<bool, PCError>where
Commitment<E>: 'a,
Checks that values
are the true evaluations at query_set
of the polynomials
committed in labeled_commitments
.
Trait Implementations
sourceimpl<E: Clone + PairingEngine, S: Clone + AlgebraicSponge<E::Fq, 2>> Clone for SonicKZG10<E, S>
impl<E: Clone + PairingEngine, S: Clone + AlgebraicSponge<E::Fq, 2>> Clone for SonicKZG10<E, S>
sourcefn clone(&self) -> SonicKZG10<E, S>
fn clone(&self) -> SonicKZG10<E, S>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more