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>
impl<E: Clone + Pairing> Clone for KZGAmortized<E>
Source§fn clone(&self) -> KZGAmortized<E>
fn clone(&self) -> KZGAmortized<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<E: Pairing> VectorCommitment for KZGAmortized<E>
impl<E: Pairing> VectorCommitment for KZGAmortized<E>
Source§type UniversalParams = KZGKey<<E as Pairing>::ScalarField, <E as Pairing>::G1, <E as Pairing>::G2>
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>
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>
type Commitment = KZGCommitment<<E as Pairing>::G1>
The Commitment to a vector.
Source§type Proof = KZGProof<<E as Pairing>::ScalarField, <E as Pairing>::G1>
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>
type BatchProof = KZGBatchProof<<E as Pairing>::ScalarField, <E as Pairing>::G1>
The proof for multiple members of a vector.
Source§fn setup<R: RngCore>(
max_items: usize,
rng: &mut R,
) -> Result<Self::UniversalParams, Self::Error>
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 itemsSource§fn commit(
key: &Self::UniversalParams,
data: &Self::PreparedData,
) -> Result<Self::Commitment, Self::Error>
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>
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>
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>
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 commitmentSource§fn verify_batch(
key: &Self::UniversalParams,
commitment: &Self::Commitment,
proof: &Self::BatchProof,
) -> Result<bool, Self::Error>
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
fn convert_commitment_to_data( commit: &Self::Commitment, ) -> <Self::PreparedData as VCPreparedData>::Item
Converts a commitment to
PreparedData::Itemimpl<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> 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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