Struct ark_poly_commit::marlin::marlin_pc::MarlinKZG10
source · pub struct MarlinKZG10<E: Pairing, P: DenseUVPolynomial<E::ScalarField>, S: CryptographicSponge> { /* private fields */ }
Expand description
Polynomial commitment based on [KZG10], with degree enforcement, batching, and (optional) hiding property taken from [CHMMVW20, “Marlin”].
Degree bound enforcement requires that (at least one of) the points at which a committed polynomial is evaluated are from a distribution that is random conditioned on the polynomial. This is because degree bound enforcement relies on checking a polynomial identity at this point. More formally, the points must be sampled from an admissible query sampler, as detailed in [CHMMVW20].
Trait Implementations§
source§impl<E, P, S> PolynomialCommitment<<E as Pairing>::ScalarField, P, S> for MarlinKZG10<E, P, S>where
E: Pairing,
P: DenseUVPolynomial<E::ScalarField, Point = E::ScalarField>,
S: CryptographicSponge,
for<'a, 'b> &'a P: Div<&'b P, Output = P>,
impl<E, P, S> PolynomialCommitment<<E as Pairing>::ScalarField, P, S> for MarlinKZG10<E, P, S>where E: Pairing, P: DenseUVPolynomial<E::ScalarField, Point = E::ScalarField>, S: CryptographicSponge, for<'a, 'b> &'a P: Div<&'b P, Output = P>,
source§fn setup<R: RngCore>(
max_degree: usize,
_num_vars: Option<usize>,
rng: &mut R
) -> Result<Self::UniversalParams, Self::Error>
fn setup<R: RngCore>( max_degree: usize, _num_vars: Option<usize>, rng: &mut R ) -> Result<Self::UniversalParams, Self::Error>
Constructs public parameters when given as input the maximum degree max_degree
for the polynomial commitment scheme.
source§fn commit<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
rng: Option<&mut dyn RngCore>
) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Self::Error>where
P: 'a,
fn commit<'a>( ck: &Self::CommitterKey, polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>, rng: Option<&mut dyn RngCore> ) -> Result<(Vec<LabeledCommitment<Self::Commitment>>, Vec<Self::Randomness>), Self::Error>where P: 'a,
Outputs a commitment to polynomial
.
source§fn open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
_commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: &'a P::Point,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
_rng: Option<&mut dyn RngCore>
) -> Result<Self::Proof, Self::Error>where
P: 'a,
Self::Randomness: 'a,
Self::Commitment: 'a,
fn open<'a>( ck: &Self::CommitterKey, labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>, _commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, point: &'a P::Point, opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>, rands: impl IntoIterator<Item = &'a Self::Randomness>, _rng: Option<&mut dyn RngCore> ) -> Result<Self::Proof, Self::Error>where P: 'a, Self::Randomness: 'a, Self::Commitment: 'a,
On input a polynomial p
and a point point
, outputs a proof for the same.
source§fn check<'a>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: &'a P::Point,
values: impl IntoIterator<Item = E::ScalarField>,
proof: &Self::Proof,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
_rng: Option<&mut dyn RngCore>
) -> Result<bool, Self::Error>where
Self::Commitment: 'a,
fn check<'a>( vk: &Self::VerifierKey, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, point: &'a P::Point, values: impl IntoIterator<Item = E::ScalarField>, proof: &Self::Proof, opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>, _rng: Option<&mut dyn RngCore> ) -> Result<bool, Self::Error>where Self::Commitment: 'a,
Verifies that value
is the evaluation at x
of the polynomial
committed inside comm
.
source§fn check_combinations<'a, R: RngCore>(
vk: &Self::VerifierKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
evaluations: &Evaluations<E::ScalarField, P::Point>,
proof: &BatchLCProof<E::ScalarField, Self::BatchProof>,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
rng: &mut R
) -> Result<bool, Self::Error>where
Self::Commitment: 'a,
fn check_combinations<'a, R: RngCore>( vk: &Self::VerifierKey, lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>, query_set: &QuerySet<P::Point>, evaluations: &Evaluations<E::ScalarField, P::Point>, proof: &BatchLCProof<E::ScalarField, Self::BatchProof>, opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>, rng: &mut R ) -> Result<bool, Self::Error>where Self::Commitment: 'a,
Checks that values
are the true evaluations at query_set
of the polynomials
committed in labeled_commitments
.
source§fn batch_open<'a>(
ck: &CommitterKey<E>,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>,
query_set: &QuerySet<P::Point>,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
rng: Option<&mut dyn RngCore>
) -> Result<Vec<Proof<E>>, Error>where
P: 'a,
Self::Randomness: 'a,
Self::Commitment: 'a,
fn batch_open<'a>( ck: &CommitterKey<E>, labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>, query_set: &QuerySet<P::Point>, opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>, rands: impl IntoIterator<Item = &'a Self::Randomness>, rng: Option<&mut dyn RngCore> ) -> Result<Vec<Proof<E>>, Error>where P: 'a, 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.
§type UniversalParams = UniversalParams<E>
type UniversalParams = UniversalParams<E>
Self::CommitterKey
and Self::VerifierKey
by Self::trim
.§type CommitterKey = CommitterKey<E>
type CommitterKey = CommitterKey<E>
§type VerifierKey = VerifierKey<E>
type VerifierKey = VerifierKey<E>
§type PreparedVerifierKey = PreparedVerifierKey<E>
type PreparedVerifierKey = PreparedVerifierKey<E>
§type Commitment = Commitment<E>
type Commitment = Commitment<E>
§type PreparedCommitment = PreparedCommitment<E>
type PreparedCommitment = PreparedCommitment<E>
§type Randomness = Randomness<<E as Pairing>::ScalarField, P>
type Randomness = Randomness<<E as Pairing>::ScalarField, P>
§type BatchProof = Vec<<MarlinKZG10<E, P, S> as PolynomialCommitment<<E as Pairing>::ScalarField, P, S>>::Proof, Global>
type BatchProof = Vec<<MarlinKZG10<E, P, S> as PolynomialCommitment<<E as Pairing>::ScalarField, P, S>>::Proof, Global>
source§fn trim(
pp: &Self::UniversalParams,
supported_degree: usize,
supported_hiding_bound: usize,
enforced_degree_bounds: Option<&[usize]>
) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error>
fn trim( pp: &Self::UniversalParams, supported_degree: usize, supported_hiding_bound: usize, enforced_degree_bounds: Option<&[usize]> ) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error>
supported_degree
and for enforcing degree bounds in the range 1..=supported_degree
.