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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

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

§

fn vzip(self) -> V