pub struct MarlinKZG10<E: Pairing, P: DenseUVPolynomial<E::ScalarField>> { /* 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> PolynomialCommitment<<E as Pairing>::ScalarField, P> for MarlinKZG10<E, P>where
E: Pairing,
P: DenseUVPolynomial<E::ScalarField, Point = E::ScalarField>,
for<'a, 'b> &'a P: Div<&'b P, Output = P>,
impl<E, P> PolynomialCommitment<<E as Pairing>::ScalarField, P> for MarlinKZG10<E, P>where
E: Pairing,
P: DenseUVPolynomial<E::ScalarField, Point = E::ScalarField>,
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::CommitmentState>), 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::CommitmentState>), 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,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
_rng: Option<&mut dyn RngCore>,
) -> Result<Self::Proof, Self::Error>where
P: 'a,
Self::CommitmentState: '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,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
_rng: Option<&mut dyn RngCore>,
) -> Result<Self::Proof, Self::Error>where
P: 'a,
Self::CommitmentState: '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,
sponge: &mut impl CryptographicSponge,
_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,
sponge: &mut impl CryptographicSponge,
_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>,
sponge: &mut impl CryptographicSponge,
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>,
sponge: &mut impl CryptographicSponge,
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>,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
rng: Option<&mut dyn RngCore>,
) -> Result<Vec<Proof<E>>, Error>where
P: 'a,
Self::CommitmentState: '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>,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
rng: Option<&mut dyn RngCore>,
) -> Result<Vec<Proof<E>>, Error>where
P: 'a,
Self::CommitmentState: '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.
Source§type UniversalParams = UniversalParams<E>
type UniversalParams = UniversalParams<E>
Self::CommitterKey and Self::VerifierKey by Self::trim.Source§type CommitterKey = CommitterKey<E>
type CommitterKey = CommitterKey<E>
Source§type VerifierKey = VerifierKey<E>
type VerifierKey = VerifierKey<E>
Source§type Commitment = Commitment<E>
type Commitment = Commitment<E>
Source§type CommitmentState = Randomness<<E as Pairing>::ScalarField, P>
type CommitmentState = Randomness<<E as Pairing>::ScalarField, P>
commit phase.
It contains information that can be reused by the committer
during the open phase, such as the commitment randomness.
Not to be shared with the verifier.Source§type BatchProof = Vec<<MarlinKZG10<E, P> as PolynomialCommitment<<E as Pairing>::ScalarField, P>>::Proof>
type BatchProof = Vec<<MarlinKZG10<E, P> as PolynomialCommitment<<E as Pairing>::ScalarField, P>>::Proof>
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.Source§fn batch_check<'a, R: RngCore>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
values: &Evaluations<E::ScalarField, P::Point>,
proof: &Self::BatchProof,
sponge: &mut impl CryptographicSponge,
rng: &mut R,
) -> Result<bool, Self::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<P::Point>,
values: &Evaluations<E::ScalarField, P::Point>,
proof: &Self::BatchProof,
sponge: &mut impl CryptographicSponge,
rng: &mut R,
) -> Result<bool, Self::Error>where
Self::Commitment: 'a,
Source§fn open_combinations<'a>(
ck: &Self::CommitterKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
rng: Option<&mut dyn RngCore>,
) -> Result<BatchLCProof<E::ScalarField, Self::BatchProof>, Self::Error>where
P: 'a,
Self::CommitmentState: 'a,
Self::Commitment: 'a,
fn open_combinations<'a>(
ck: &Self::CommitterKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
sponge: &mut impl CryptographicSponge,
states: impl IntoIterator<Item = &'a Self::CommitmentState>,
rng: Option<&mut dyn RngCore>,
) -> Result<BatchLCProof<E::ScalarField, Self::BatchProof>, Self::Error>where
P: 'a,
Self::CommitmentState: 'a,
Self::Commitment: 'a,
Auto Trait Implementations§
impl<E, P> Freeze for MarlinKZG10<E, P>
impl<E, P> RefUnwindSafe for MarlinKZG10<E, P>where
E: RefUnwindSafe,
P: RefUnwindSafe,
impl<E, P> Send for MarlinKZG10<E, P>where
P: Send,
impl<E, P> Sync for MarlinKZG10<E, P>
impl<E, P> Unpin for MarlinKZG10<E, P>
impl<E, P> UnsafeUnpin for MarlinKZG10<E, P>
impl<E, P> UnwindSafe for MarlinKZG10<E, P>where
E: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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