Skip to main content

Module kzg

Module kzg 

Source
Expand description

KZG polynomial commitment scheme (KZG10).

This module implements the KZG protocol described in the paper Constant-Size Commitments to Polynomials and Their Applications by Kate, Zaverucha and Goldberg, often referred to as the KZG10 paper.

The protocol requires a structured reference string (SRS) that contains powers of a generator of a group, and a pairing friendly curve.

The pairing friendly curve requirement is hidden in the Pairing trait parameter.

Re-exportsยง

use crate::commitment::combine_commitments; ๐Ÿ”’
use crate::commitment::BatchEvaluationProof; ๐Ÿ”’
use crate::commitment::BlindedCommitment; ๐Ÿ”’
use crate::commitment::CommitmentCurve; ๐Ÿ”’
use crate::commitment::Evaluation; ๐Ÿ”’
use crate::commitment::PolyComm; ๐Ÿ”’
use crate::error::CommitmentError; ๐Ÿ”’
use crate::ipa::SRS; ๐Ÿ”’
use crate::utils::combine_polys; ๐Ÿ”’
use crate::PolynomialsToCombine; ๐Ÿ”’
use crate::SRS as SRSTrait; ๐Ÿ”’
use alloc::vec; ๐Ÿ”’
use alloc::vec; ๐Ÿ”’
use alloc::vec::Vec; ๐Ÿ”’
use ark_ec::pairing::Pairing; ๐Ÿ”’
use ark_ec::AffineRepr; ๐Ÿ”’
use ark_ec::VariableBaseMSM; ๐Ÿ”’
use ark_ff::One; ๐Ÿ”’
use ark_ff::PrimeField; ๐Ÿ”’
use ark_ff::Zero; ๐Ÿ”’
use ark_poly::univariate::DenseOrSparsePolynomial; ๐Ÿ”’
use ark_poly::univariate::DensePolynomial; ๐Ÿ”’
use ark_poly::DenseUVPolynomial; ๐Ÿ”’
use ark_poly::EvaluationDomain; ๐Ÿ”’
use ark_poly::Evaluations; ๐Ÿ”’
use ark_poly::Polynomial; ๐Ÿ”’
use ark_poly::Radix2EvaluationDomain as D; ๐Ÿ”’
use core::ops::Neg; ๐Ÿ”’
use mina_poseidon::FqSponge; ๐Ÿ”’
use rand::thread_rng; ๐Ÿ”’
use rand_core::CryptoRng; ๐Ÿ”’
use rand_core::RngCore; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde_with::serde_as; ๐Ÿ”’
use std::ops::Deref; ๐Ÿ”’

Structsยง

KZGProof
PairingSRS
Define a structured reference string for the KZG protocol.

Functionsยง

combine_evaluations
Combine the (chunked) evaluations of multiple polynomials.
divisor_polynomial ๐Ÿ”’
The polynomial that evaluates to 0 at the evaluation points.
eval_polynomial ๐Ÿ”’
The polynomial that evaluates to each of evals for the respective elms. For now, only works for 2 evaluations points. elm is the vector of evaluation points and evals is the vector of evaluations at those points.