Struct 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>

Source

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.

Source

pub fn max_eval_points(&self) -> usize

Return the bound on evaluation points.

Source

pub fn commit(&self, polynomial: &[E::ScalarField]) -> Commitment<E>

Given a polynomial polynomial of degree less than max_degree, return a commitment to polynomial.

Source

pub fn index_by(&self, indices: &[usize]) -> Self

Obtain a new preprocessed committer key defined by the indices indices.

Source

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.

Source

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.

Source

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.

Source

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]>>

Source§

fn from(ck: &'a CommitterKey<E>) -> Self

Converts to this type from the input type.
Source§

impl<E: Pairing> From<&CommitterKey<E>> for VerifierKey<E>

Source§

fn from(ck: &CommitterKey<E>) -> VerifierKey<E>

Converts to this type from the input type.

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>
where <E as Pairing>::G1Affine: Unpin, <E as Pairing>::G2Affine: Unpin,

§

impl<E> UnwindSafe for CommitterKey<E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V