pub struct SonicKZG10<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> { /* private fields */ }
Expand description

Polynomial commitment based on [KZG10], with degree enforcement and batching taken from [MBKM19, “Sonic”] (more precisely, their counterparts in [Gabizon19, “AuroraLight”] that avoid negative G1 powers). The (optional) hiding property of the commitment scheme follows the approach described in [CHMMVW20, “Marlin”].

Implementations§

source§

impl<E: PairingEngine, S: AlgebraicSponge<E::Fq, 2>> SonicKZG10<E, S>

source

pub fn load_srs(max_degree: usize) -> Result<UniversalParams<E>, PCError>

source

pub fn trim( pp: &UniversalParams<E>, supported_degree: usize, supported_lagrange_sizes: impl IntoIterator<Item = usize>, supported_hiding_bound: usize, enforced_degree_bounds: Option<&[usize]> ) -> Result<(CommitterKey<E>, UniversalVerifier<E>)>

source

pub fn commit<'b>( universal_prover: &UniversalProver<E>, ck: &CommitterUnionKey<'_, E>, polynomials: impl IntoIterator<Item = LabeledPolynomialWithBasis<'b, E::Fr>>, rng: Option<&mut dyn RngCore> ) -> Result<(Vec<LabeledCommitment<Commitment<E>>>, Vec<Randomness<E>>), PCError>

Outputs a commitments to polynomials.

If polynomials[i].is_hiding(), then the i-th commitment is hiding up to polynomials.hiding_bound() queries.

rng should not be None if polynomials[i].is_hiding() == true for any i.

If for some i, polynomials[i].is_hiding() == false, then the corresponding randomness is Randomness<E>::empty().

If for some i, polynomials[i].degree_bound().is_some(), then that polynomial will have the corresponding degree bound enforced.

source

pub fn combine_for_open<'a>( universal_prover: &UniversalProver<E>, ck: &CommitterUnionKey<'_, E>, labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>, rands: impl IntoIterator<Item = &'a Randomness<E>>, fs_rng: &mut S ) -> Result<(DensePolynomial<E::Fr>, Randomness<E>), PCError>where Randomness<E>: 'a, Commitment<E>: 'a,

source

pub fn batch_open<'a>( universal_prover: &UniversalProver<E>, ck: &CommitterUnionKey<'_, E>, labeled_polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>, query_set: &QuerySet<E::Fr>, rands: impl IntoIterator<Item = &'a Randomness<E>>, fs_rng: &mut S ) -> Result<BatchProof<E>, PCError>where Randomness<E>: 'a, Commitment<E>: 'a,

On input a list of labeled polynomials and a query set, open outputs a proof of evaluation of the polynomials at the points in the query set.

source

pub fn batch_check<'a>( vk: &UniversalVerifier<E>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>, query_set: &QuerySet<E::Fr>, values: &Evaluations<E::Fr>, proof: &BatchProof<E>, fs_rng: &mut S ) -> Result<bool, PCError>where Commitment<E>: 'a,

source

pub fn open_combinations<'a>( universal_prover: &UniversalProver<E>, ck: &CommitterUnionKey<'_, E>, linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>, polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::Fr>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>, query_set: &QuerySet<E::Fr>, rands: impl IntoIterator<Item = &'a Randomness<E>>, fs_rng: &mut S ) -> Result<BatchLCProof<E>, PCError>where Randomness<E>: 'a, Commitment<E>: 'a,

source

pub fn check_combinations<'a>( vk: &UniversalVerifier<E>, linear_combinations: impl IntoIterator<Item = &'a LinearCombination<E::Fr>>, commitments: impl IntoIterator<Item = &'a LabeledCommitment<Commitment<E>>>, query_set: &QuerySet<E::Fr>, evaluations: &Evaluations<E::Fr>, proof: &BatchLCProof<E>, fs_rng: &mut S ) -> Result<bool, PCError>where Commitment<E>: 'a,

Checks that values are the true evaluations at query_set of the polynomials committed in labeled_commitments.

Trait Implementations§

source§

impl<E: Clone + PairingEngine, S: Clone + AlgebraicSponge<E::Fq, 2>> Clone for SonicKZG10<E, S>

source§

fn clone(&self) -> SonicKZG10<E, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Debug + PairingEngine, S: Debug + AlgebraicSponge<E::Fq, 2>> Debug for SonicKZG10<E, S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E, S> RefUnwindSafe for SonicKZG10<E, S>where E: RefUnwindSafe, S: RefUnwindSafe,

§

impl<E, S> Send for SonicKZG10<E, S>where S: Send,

§

impl<E, S> Sync for SonicKZG10<E, S>where S: Sync,

§

impl<E, S> Unpin for SonicKZG10<E, S>where E: Unpin, S: Unpin,

§

impl<E, S> UnwindSafe for SonicKZG10<E, S>where E: UnwindSafe, S: 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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