KZGAmortized

Struct KZGAmortized 

Source
pub struct KZGAmortized<E: Pairing> { /* private fields */ }
Expand description

Implementation of the Feist-Khovratovich technique of “Fast Amortized KZG proofs”.

Trait Implementations§

Source§

impl<E: Clone + Pairing> Clone for KZGAmortized<E>

Source§

fn clone(&self) -> KZGAmortized<E>

Returns a duplicate 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: PartialEq + Pairing> PartialEq for KZGAmortized<E>

Source§

fn eq(&self, other: &KZGAmortized<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E: Pairing> VectorCommitment for KZGAmortized<E>

Source§

type UniversalParams = KZGKey<<E as Pairing>::ScalarField, <E as Pairing>::G1, <E as Pairing>::G2>

The universal parameters for the vector commitment scheme. CURRENTLY this API does not support differing committing, proving and verifying keys
Source§

type PreparedData = KZGPreparedData<<E as Pairing>::ScalarField>

The vector dataset that has gone through preparation to use with the Vector Commitment.
Source§

type Commitment = KZGCommitment<<E as Pairing>::G1>

The Commitment to a vector.
Source§

type Proof = KZGProof<<E as Pairing>::ScalarField, <E as Pairing>::G1>

The proof for a single member of a vector.
Source§

type BatchProof = KZGBatchProof<<E as Pairing>::ScalarField, <E as Pairing>::G1>

The proof for multiple members of a vector.
Source§

type Error = KZGError

The error type for the scheme.
Source§

fn setup<R: RngCore>( max_items: usize, rng: &mut R, ) -> Result<Self::UniversalParams, Self::Error>

Constructs the Universal parameters for the scheme, which allows committing and proving inclusion of vectors up to max_items items
Source§

fn commit( key: &Self::UniversalParams, data: &Self::PreparedData, ) -> Result<Self::Commitment, Self::Error>

Commit a prepared data vector (data) to the key UniversalParams.
Source§

fn prove( key: &Self::UniversalParams, commitment: &Self::Commitment, index: usize, data: &Self::PreparedData, ) -> Result<Self::Proof, Self::Error>

Prove that a piece of data exists inside of commitment. The index represents the index of the data inside of data.
Source§

fn prove_all( key: &Self::UniversalParams, commitment: &Self::Commitment, data: &Self::PreparedData, ) -> Result<Self::BatchProof, Self::Error>

Generate all proofs of the dataset using the Feist-Khovratovich techique
Source§

fn verify( key: &Self::UniversalParams, commitment: &Self::Commitment, proof: &Self::Proof, ) -> Result<bool, Self::Error>

Verify that the proof is valid with respect to the key and commitment
Source§

fn verify_batch( key: &Self::UniversalParams, commitment: &Self::Commitment, proof: &Self::BatchProof, ) -> Result<bool, Self::Error>

Verify multiple proofs are valid TODO: Keep this as boolean return value, or number of valid proofs? Once compression is implemeneted then will be boolean
Source§

fn convert_commitment_to_data( commit: &Self::Commitment, ) -> <Self::PreparedData as VCPreparedData>::Item

Converts a commitment to PreparedData::Item
Source§

impl<E: Pairing> StructuralPartialEq for KZGAmortized<E>

Auto Trait Implementations§

§

impl<E> Freeze for KZGAmortized<E>

§

impl<E> RefUnwindSafe for KZGAmortized<E>
where E: RefUnwindSafe,

§

impl<E> Send for KZGAmortized<E>

§

impl<E> Sync for KZGAmortized<E>

§

impl<E> Unpin for KZGAmortized<E>
where E: Unpin,

§

impl<E> UnwindSafe for KZGAmortized<E>
where E: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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