MCPcopy Create free account
hub / github.com/arkworks-rs/poly-commit / PolynomialCommitment

Interface PolynomialCommitment

poly-commit/src/lib.rs:164–577  ·  view source on GitHub ↗

Describes the interface for a polynomial commitment scheme that allows a sender to commit to multiple polynomials and later provide a succinct proof of evaluation for the corresponding commitments at a query set `Q`, while enforcing per-polynomial degree bounds.

Source from the content-addressed store, hash-verified

162/// of evaluation for the corresponding commitments at a query set `Q`, while
163/// enforcing per-polynomial degree bounds.
164pub trait PolynomialCommitment<F: PrimeField, P: Polynomial<F>>: Sized {
165 /// The universal parameters for the commitment scheme. These are "trimmed"
166 /// down to `Self::CommitterKey` and `Self::VerifierKey` by `Self::trim`.
167 type UniversalParams: PCUniversalParams;
168 /// The committer key for the scheme; used to commit to a polynomial and then
169 /// open the commitment to produce an evaluation proof.
170 type CommitterKey: PCCommitterKey;
171 /// The verifier key for the scheme; used to check an evaluation proof.
172 type VerifierKey: PCVerifierKey;
173 /// The commitment to a polynomial.
174 type Commitment: PCCommitment + Default;
175 /// Auxiliary state of the commitment, output by the `commit` phase.
176 /// It contains information that can be reused by the committer
177 /// during the `open` phase, such as the commitment randomness.
178 /// Not to be shared with the verifier.
179 type CommitmentState: PCCommitmentState;
180 /// The evaluation proof for a single point.
181 type Proof: Clone;
182 /// The evaluation proof for a query set.
183 type BatchProof: Clone
184 + From<Vec<Self::Proof>>
185 + Into<Vec<Self::Proof>>
186 + CanonicalSerialize
187 + CanonicalDeserialize;
188 /// The error type for the scheme.
189 type Error: ark_std::error::Error + From<Error>;
190
191 /// Constructs public parameters when given as input the maximum degree `degree`
192 /// for the polynomial commitment scheme. `num_vars` specifies the number of
193 /// variables for multivariate setup
194 fn setup<R: RngCore>(
195 max_degree: usize,
196 num_vars: Option<usize>,
197 rng: &mut R,
198 ) -> Result<Self::UniversalParams, Self::Error>;
199
200 /// Specializes the public parameters for polynomials up to the given `supported_degree`
201 /// and for enforcing degree bounds in the range `1..=supported_degree`.
202 fn trim(
203 pp: &Self::UniversalParams,
204 supported_degree: usize,
205 supported_hiding_bound: usize,
206 enforced_degree_bounds: Option<&[usize]>,
207 ) -> Result<(Self::CommitterKey, Self::VerifierKey), Self::Error>;
208
209 /// Outputs a list of commitments to `polynomials`. If `polynomials[i].is_hiding()`,
210 /// then the `i`-th commitment is hiding up to `polynomials.hiding_bound()` queries.
211 /// `rng` should not be `None` if `polynomials[i].is_hiding() == true` for any `i`.
212 ///
213 /// If for some `i`, `polynomials[i].is_hiding() == false`, then the
214 /// corresponding randomness is `Self::Randomness::empty()`.
215 ///
216 /// If for some `i`, `polynomials[i].degree_bound().is_some()`, then that
217 /// polynomial will have the corresponding degree bound enforced.
218 fn commit<'a>(
219 ck: &Self::CommitterKey,
220 polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<F, P>>,
221 rng: Option<&mut dyn RngCore>,

Callers

nothing calls this directly

Implementers 6

mod.rspoly-commit/src/marlin/marlin_pst13_pc
mod.rspoly-commit/src/marlin/marlin_pc/mod.r
mod.rspoly-commit/src/linear_codes/mod.rs
mod.rspoly-commit/src/ipa_pc/mod.rs
mod.rspoly-commit/src/sonic_pc/mod.rs
mod.rspoly-commit/src/hyrax/mod.rs

Calls

no outgoing calls

Tested by

no test coverage detected