pub struct KZGProof<Pair: Pairing> {
    pub quotient: Pair::G1Affine,
    pub blinding: <Pair::G1Affine as AffineRepr>::ScalarField,
}

Fields§

§quotient: Pair::G1Affine§blinding: <Pair::G1Affine as AffineRepr>::ScalarField

A blinding factor used to hide the polynomial, if necessary

Implementations§

source§

impl<F: PrimeField, G: CommitmentCurve<ScalarField = F>, G2: CommitmentCurve<ScalarField = F>, Pair: Pairing<G1Affine = G, G2Affine = G2>> KZGProof<Pair>

source

pub fn create<D: EvaluationDomain<F>>( srs: &PairingSRS<Pair>, plnms: &'_ [(DensePolynomialOrEvaluations<'_, G::ScalarField, D>, PolyComm<G::ScalarField>)], elm: &[F], polyscale: F ) -> Option<Self>

Create a KZG proof. Parameters:

  • srs: the structured reference string used to commit to the polynomials
  • plnms: the list of polynomials to open. The type is simply an alias to handle the polynomials in evaluations or coefficients forms.
  • elm: vector of evaluation points. Note that it only works for two elements for now.
  • polyscale: a challenge to batch the polynomials.
source

pub fn verify( &self, srs: &PairingSRS<Pair>, evaluations: &Vec<Evaluation<G>>, polyscale: F, elm: &[F] ) -> bool

Verify a proof. Note that it only works for two elements for now, i.e. elm must be of size 2. Also, chunking is not supported.

Trait Implementations§

source§

impl<Pair: Pairing> Clone for KZGProof<Pair>

source§

fn clone(&self) -> Self

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<Pair: Debug + Pairing> Debug for KZGProof<Pair>where Pair::G1Affine: Debug,

source§

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

Formats the value using the given formatter. Read more
source§

impl<Pair: Pairing> Default for KZGProof<Pair>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, Pair: Pairing> Deserialize<'de> for KZGProof<Pair>where Pair::G1Affine: CanonicalDeserialize + CanonicalSerialize,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<F: PrimeField, G: CommitmentCurve<ScalarField = F>, G2: CommitmentCurve<ScalarField = F>, Pair: Pairing<G1Affine = G, G2Affine = G2>> OpenProof<G> for KZGProof<Pair>

source§

fn open<EFqSponge, RNG, D: EvaluationDomain<F>>( srs: &Self::SRS, _group_map: &<G as CommitmentCurve>::Map, plnms: &'_ [(DensePolynomialOrEvaluations<'_, G::ScalarField, D>, PolyComm<G::ScalarField>)], elm: &[<G as AffineRepr>::ScalarField], polyscale: <G as AffineRepr>::ScalarField, _evalscale: <G as AffineRepr>::ScalarField, _sponge: EFqSponge, _rng: &mut RNG ) -> Selfwhere EFqSponge: Clone + FqSponge<<G as AffineRepr>::BaseField, G, F>, RNG: RngCore + CryptoRng,

Parameters:

  • srs: the structured reference string
  • plnms: vector of polynomials with optional degree bound and commitment randomness
  • elm: vector of evaluation points
  • polyscale: scaling factor for polynoms group_maps, sponge, rng and evalscale are not used. The parameters are kept to fit the trait and to be used generically.
§

type SRS = PairingSRS<Pair>

source§

fn verify<EFqSponge, RNG>( srs: &Self::SRS, _group_map: &G::Map, batch: &mut [BatchEvaluationProof<'_, G, EFqSponge, Self>], _rng: &mut RNG ) -> boolwhere EFqSponge: FqSponge<G::BaseField, G, F>, RNG: RngCore + CryptoRng,

Verify the opening proof
source§

impl<Pair: Pairing> Serialize for KZGProof<Pair>where Pair::G1Affine: CanonicalDeserialize + CanonicalSerialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<Pair> RefUnwindSafe for KZGProof<Pair>where <Pair as Pairing>::G1Affine: RefUnwindSafe, <Pair as Pairing>::ScalarField: RefUnwindSafe,

§

impl<Pair> Send for KZGProof<Pair>

§

impl<Pair> Sync for KZGProof<Pair>

§

impl<Pair> Unpin for KZGProof<Pair>where <Pair as Pairing>::G1Affine: Unpin, <Pair as Pairing>::ScalarField: Unpin,

§

impl<Pair> UnwindSafe for KZGProof<Pair>where <Pair as Pairing>::G1Affine: UnwindSafe, <Pair as Pairing>::ScalarField: 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

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,