Struct ark_poly_commit::streaming_kzg::CommitterKey
source · pub struct CommitterKey<E: Pairing> { /* private fields */ }
Expand description
The SRS for the polynomial commitment scheme for a max
The SRS consists of the max_degree
powers of \(\tau\) in \(\GG_1\)
plus the max_eval_degree
powers over \(\GG_2\),
where max_degree
is the max polynomial degree to commit to,
and max_eval_degree
is the max number of different points to open simultaneously.
Implementations§
source§impl<E: Pairing> CommitterKey<E>
impl<E: Pairing> CommitterKey<E>
sourcepub fn new(
max_degree: usize,
max_eval_points: usize,
rng: &mut impl RngCore
) -> Self
pub fn new( max_degree: usize, max_eval_points: usize, rng: &mut impl RngCore ) -> Self
The setup algorithm for the commitment scheme.
Given a degree bound max_degree
,
an evaluation point bound max_eval_points
,
and a cryptographically-secure random number generator rng
,
construct the committer key.
sourcepub fn max_eval_points(&self) -> usize
pub fn max_eval_points(&self) -> usize
Return the bound on evaluation points.
sourcepub fn commit(&self, polynomial: &[E::ScalarField]) -> Commitment<E>
pub fn commit(&self, polynomial: &[E::ScalarField]) -> Commitment<E>
Given a polynomial polynomial
of degree less than max_degree
, return a commitment to polynomial
.
sourcepub fn index_by(&self, indices: &[usize]) -> Self
pub fn index_by(&self, indices: &[usize]) -> Self
Obtain a new preprocessed committer key defined by the indices indices
.
sourcepub fn batch_commit<J>(&self, polynomials: J) -> Vec<Commitment<E>>where
J: IntoIterator,
J::Item: Borrow<Vec<E::ScalarField>>,
pub fn batch_commit<J>(&self, polynomials: J) -> Vec<Commitment<E>>where J: IntoIterator, J::Item: Borrow<Vec<E::ScalarField>>,
Given an iterator over polynomials
, expressed as vectors of coefficients, return a vector of commitmetns to all of them.
sourcepub fn open(
&self,
polynomial: &[E::ScalarField],
evalualtion_point: &E::ScalarField
) -> (E::ScalarField, EvaluationProof<E>)
pub fn open( &self, polynomial: &[E::ScalarField], evalualtion_point: &E::ScalarField ) -> (E::ScalarField, EvaluationProof<E>)
Given a polynomial polynomial
and an evaluation point evaluation_point
,
return the evaluation of polynomial in
evaluation_point`,
together with an evaluation proof.
sourcepub fn open_multi_points(
&self,
polynomial: &[E::ScalarField],
eval_points: &[E::ScalarField]
) -> EvaluationProof<E>
pub fn open_multi_points( &self, polynomial: &[E::ScalarField], eval_points: &[E::ScalarField] ) -> EvaluationProof<E>
Evaluate a single polynomial at a set of points eval_points
, and provide a single evaluation proof.
sourcepub fn batch_open_multi_points(
&self,
polynomials: &[&Vec<E::ScalarField>],
eval_points: &[E::ScalarField],
eval_chal: &E::ScalarField
) -> EvaluationProof<E>
pub fn batch_open_multi_points( &self, polynomials: &[&Vec<E::ScalarField>], eval_points: &[E::ScalarField], eval_chal: &E::ScalarField ) -> EvaluationProof<E>
Evaluate a set of polynomials at a set of points eval_points
, and provide a single batched evaluation proof.
eval_chal
is the random challenge for batching evaluation proofs across different polynomials.