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>>
pub fn batch_commit<J>(&self, polynomials: J) -> Vec<Commitment<E>>
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.
Trait Implementations§
Source§impl<'a, E: Pairing> From<&'a CommitterKey<E>> for CommitterKeyStream<E, Reverse<&'a [E::G1Affine]>>
impl<'a, E: Pairing> From<&'a CommitterKey<E>> for CommitterKeyStream<E, Reverse<&'a [E::G1Affine]>>
Source§fn from(ck: &'a CommitterKey<E>) -> Self
fn from(ck: &'a CommitterKey<E>) -> Self
Source§impl<E: Pairing> From<&CommitterKey<E>> for VerifierKey<E>
impl<E: Pairing> From<&CommitterKey<E>> for VerifierKey<E>
Source§fn from(ck: &CommitterKey<E>) -> VerifierKey<E>
fn from(ck: &CommitterKey<E>) -> VerifierKey<E>
Auto Trait Implementations§
impl<E> Freeze for CommitterKey<E>
impl<E> RefUnwindSafe for CommitterKey<E>
impl<E> Send for CommitterKey<E>
impl<E> Sync for CommitterKey<E>
impl<E> Unpin for CommitterKey<E>
impl<E> UnwindSafe for CommitterKey<E>
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