pub struct KZGCommitmentScheme<P: Pairing> {
pub public_parameter_group_1: Vec<P::G1>,
pub public_parameter_group_2: Vec<P::G2>,
}Expand description
KZG commitment scheme about PairingEngine.
Fields§
§public_parameter_group_1: Vec<P::G1>public parameter about G1.
public_parameter_group_2: Vec<P::G2>public parameter about G1.
Implementations§
Source§impl<P: Pairing> KZGCommitmentScheme<P>
impl<P: Pairing> KZGCommitmentScheme<P>
Sourcepub fn new<R: CryptoRng + RngCore>(
max_degree: usize,
prng: &mut R,
) -> KZGCommitmentScheme<P>
pub fn new<R: CryptoRng + RngCore>( max_degree: usize, prng: &mut R, ) -> KZGCommitmentScheme<P>
Create a new instance of a KZG polynomial commitment scheme.
max_degree - max degree of the polynomial,
prng - pseudo-random generator.
Sourcepub fn to_unchecked_bytes(&self) -> Result<Vec<u8>, UzkgeError>
pub fn to_unchecked_bytes(&self) -> Result<Vec<u8>, UzkgeError>
Serialize the parameters to unchecked bytes.
Sourcepub fn from_unchecked_bytes(bytes: &[u8]) -> Result<Self, UzkgeError>
pub fn from_unchecked_bytes(bytes: &[u8]) -> Result<Self, UzkgeError>
Deserialize the parameters from unchecked bytes.
Trait Implementations§
Source§impl<P: Clone + Pairing> Clone for KZGCommitmentScheme<P>
impl<P: Clone + Pairing> Clone for KZGCommitmentScheme<P>
Source§fn clone(&self) -> KZGCommitmentScheme<P>
fn clone(&self) -> KZGCommitmentScheme<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, P: Pairing> Deserialize<'de> for KZGCommitmentScheme<P>
impl<'de, P: Pairing> Deserialize<'de> for KZGCommitmentScheme<P>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<P: Eq + Pairing> Eq for KZGCommitmentScheme<P>
Source§impl<P: PartialEq + Pairing> PartialEq for KZGCommitmentScheme<P>
impl<P: PartialEq + Pairing> PartialEq for KZGCommitmentScheme<P>
Source§fn eq(&self, other: &KZGCommitmentScheme<P>) -> bool
fn eq(&self, other: &KZGCommitmentScheme<P>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<P: Pairing> Serialize for KZGCommitmentScheme<P>
impl<P: Pairing> Serialize for KZGCommitmentScheme<P>
impl<P: Pairing> StructuralPartialEq for KZGCommitmentScheme<P>
Auto Trait Implementations§
impl<P> Freeze for KZGCommitmentScheme<P>
impl<P> RefUnwindSafe for KZGCommitmentScheme<P>
impl<P> Send for KZGCommitmentScheme<P>
impl<P> Sync for KZGCommitmentScheme<P>
impl<P> Unpin for KZGCommitmentScheme<P>
impl<P> UnsafeUnpin for KZGCommitmentScheme<P>
impl<P> UnwindSafe for KZGCommitmentScheme<P>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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