pub struct InnerProductArgPC<G: AffineRepr, D: Digest, P: DenseUVPolynomial<G::ScalarField>> { /* private fields */ }
Expand description
A polynomial commitment scheme based on the hardness of the discrete logarithm problem in prime-order groups. The construction is described in detail in [BCMS20].
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].
Implementations§
Source§impl<G, D, P> InnerProductArgPC<G, D, P>where
G: AffineRepr,
G::Group: VariableBaseMSM<MulBase = G>,
D: Digest,
P: DenseUVPolynomial<G::ScalarField>,
impl<G, D, P> InnerProductArgPC<G, D, P>where
G: AffineRepr,
G::Group: VariableBaseMSM<MulBase = G>,
D: Digest,
P: DenseUVPolynomial<G::ScalarField>,
Sourcepub const PROTOCOL_NAME: &'static [u8] = b"PC-DL-2020"
pub const PROTOCOL_NAME: &'static [u8] = b"PC-DL-2020"
PROTOCOL_NAME
is used as a seed for the setup function.
Trait Implementations§
Source§impl<G, D, P> PolynomialCommitment<<G as AffineRepr>::ScalarField, P> for InnerProductArgPC<G, D, P>where
G: AffineRepr,
G::Group: VariableBaseMSM<MulBase = G>,
D: Digest,
P: DenseUVPolynomial<G::ScalarField, Point = G::ScalarField>,
impl<G, D, P> PolynomialCommitment<<G as AffineRepr>::ScalarField, P> for InnerProductArgPC<G, D, P>where
G: AffineRepr,
G::Group: VariableBaseMSM<MulBase = G>,
D: Digest,
P: DenseUVPolynomial<G::ScalarField, Point = G::ScalarField>,
Source§fn commit<'a>(
ck: &Self::CommitterKey,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<G::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<G::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 check_combinations<'a, R: RngCore>(
vk: &Self::VerifierKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<G::ScalarField>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
eqn_query_set: &QuerySet<P::Point>,
eqn_evaluations: &Evaluations<P::Point, G::ScalarField>,
proof: &BatchLCProof<G::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,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<G::ScalarField>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
eqn_query_set: &QuerySet<P::Point>,
eqn_evaluations: &Evaluations<P::Point, G::ScalarField>,
proof: &BatchLCProof<G::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§type UniversalParams = UniversalParams<G>
type UniversalParams = UniversalParams<G>
The universal parameters for the commitment scheme. These are “trimmed”
down to
Self::CommitterKey
and Self::VerifierKey
by Self::trim
.Source§type CommitterKey = CommitterKey<G>
type CommitterKey = CommitterKey<G>
The committer key for the scheme; used to commit to a polynomial and then
open the commitment to produce an evaluation proof.
Source§type VerifierKey = CommitterKey<G>
type VerifierKey = CommitterKey<G>
The verifier key for the scheme; used to check an evaluation proof.
Source§type Commitment = Commitment<G>
type Commitment = Commitment<G>
The commitment to a polynomial.
Source§type CommitmentState = Randomness<G>
type CommitmentState = Randomness<G>
Auxiliary state of the commitment, output by the
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<<InnerProductArgPC<G, D, P> as PolynomialCommitment<<G as AffineRepr>::ScalarField, P>>::Proof>
type BatchProof = Vec<<InnerProductArgPC<G, D, P> as PolynomialCommitment<<G as AffineRepr>::ScalarField, P>>::Proof>
The evaluation proof for a query set.
Source§fn setup<R: RngCore>(
max_degree: usize,
_: Option<usize>,
_rng: &mut R,
) -> Result<Self::UniversalParams, Self::Error>
fn setup<R: RngCore>( max_degree: usize, _: Option<usize>, _rng: &mut R, ) -> Result<Self::UniversalParams, Self::Error>
Constructs public parameters when given as input the maximum degree
degree
for the polynomial commitment scheme. num_vars
specifies the number of
variables for multivariate setupSource§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>
Specializes the public parameters for polynomials up to the given
supported_degree
and for enforcing degree bounds in the range 1..=supported_degree
.Source§fn open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<G::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
Self::Commitment: 'a,
Self::CommitmentState: 'a,
P: 'a,
fn open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<G::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
Self::Commitment: 'a,
Self::CommitmentState: 'a,
P: 'a,
open but with individual challenges
Source§fn check<'a>(
vk: &Self::VerifierKey,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
point: &'a P::Point,
values: impl IntoIterator<Item = G::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 = G::ScalarField>,
proof: &Self::Proof,
sponge: &mut impl CryptographicSponge,
_rng: Option<&mut dyn RngCore>,
) -> Result<bool, Self::Error>where
Self::Commitment: 'a,
check but with individual challenges
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<G::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<G::ScalarField, P::Point>,
proof: &Self::BatchProof,
sponge: &mut impl CryptographicSponge,
rng: &mut R,
) -> Result<bool, Self::Error>where
Self::Commitment: 'a,
Verify opening proofs for several polynomials at one or more points
each (possibly different for each polynomial). Each entry in
the query set of points contains the label of the polynomial which
was queried at that point. Read more
Source§fn open_combinations<'a>(
ck: &Self::CommitterKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<G::ScalarField>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<G::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<G::ScalarField, Self::BatchProof>, Self::Error>where
Self::CommitmentState: 'a,
Self::Commitment: 'a,
P: 'a,
fn open_combinations<'a>(
ck: &Self::CommitterKey,
linear_combinations: impl IntoIterator<Item = &'a LinearCombination<G::ScalarField>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<G::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<G::ScalarField, Self::BatchProof>, Self::Error>where
Self::CommitmentState: 'a,
Self::Commitment: 'a,
P: 'a,
Open commitments to all polynomials involved in a number of linear
combinations (LC) simultaneously.
Source§fn batch_open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, 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<Self::BatchProof, Self::Error>where
P: 'a,
Self::CommitmentState: 'a,
Self::Commitment: 'a,
fn batch_open<'a>(
ck: &Self::CommitterKey,
labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, 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<Self::BatchProof, Self::Error>where
P: 'a,
Self::CommitmentState: 'a,
Self::Commitment: 'a,
Open several polynomials at one or more points each (possibly different
for each polynomial). Each entry in the in the query set of points
contains the label of the polynomial which should be queried at that
point. Read more
Auto Trait Implementations§
impl<G, D, P> Freeze for InnerProductArgPC<G, D, P>
impl<G, D, P> RefUnwindSafe for InnerProductArgPC<G, D, P>
impl<G, D, P> Send for InnerProductArgPC<G, D, P>
impl<G, D, P> Sync for InnerProductArgPC<G, D, P>where
D: Sync,
impl<G, D, P> Unpin for InnerProductArgPC<G, D, P>
impl<G, D, P> UnwindSafe for InnerProductArgPC<G, D, P>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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