pub struct MultilinearKzgPCS<E: Pairing> { /* private fields */ }Expand description
KZG Polynomial Commitment Scheme on multilinear polynomials.
Trait Implementations§
Source§impl<E: Pairing> PolynomialCommitmentScheme for MultilinearKzgPCS<E>
impl<E: Pairing> PolynomialCommitmentScheme for MultilinearKzgPCS<E>
Source§fn trim(
srs: impl Borrow<Self::SRS>,
supported_log_degree: usize,
supported_num_vars: Option<usize>,
) -> Result<(<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam, <(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam), PCSError>
fn trim( srs: impl Borrow<Self::SRS>, supported_log_degree: usize, supported_num_vars: Option<usize>, ) -> Result<(<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam, <(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam), PCSError>
Trim the universal parameters to specialize the public parameters.
Input both supported_log_degree for univariate and
supported_num_vars for multilinear.
Source§fn commit(
prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>,
poly: &Self::Polynomial,
) -> Result<Self::Commitment, PCSError>
fn commit( prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>, poly: &Self::Polynomial, ) -> Result<Self::Commitment, PCSError>
Generate a commitment for a polynomial.
This function takes 2^num_vars number of scalar multiplications over
G1.
Source§fn batch_commit(
prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>,
polys: &[Self::Polynomial],
) -> Result<Self::Commitment, PCSError>
fn batch_commit( prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>, polys: &[Self::Polynomial], ) -> Result<Self::Commitment, PCSError>
Batch commit a list of polynomials.
This function takes 2^(num_vars + log(polys.len()) number of scalar
multiplications over G1.
Source§fn open(
prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>,
polynomial: &Self::Polynomial,
point: &Self::Point,
) -> Result<(Self::Proof, Self::Evaluation), PCSError>
fn open( prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>, polynomial: &Self::Polynomial, point: &Self::Point, ) -> Result<(Self::Proof, Self::Evaluation), PCSError>
On input a polynomial p and a point point, outputs a proof for the
same. This function does not need to take the evaluation value as an
input.
This function takes 2^{num_var +1} number of scalar multiplications over G1:
- it proceeds with
num_varnumber of rounds, - at round i, we compute an MSM for
2^{num_var - i + 1}number of G2 elements.
Source§fn batch_open(
prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>,
batch_commitment: &Self::BatchCommitment,
polynomials: &[Self::Polynomial],
points: &[Self::Point],
) -> Result<(Self::BatchProof, Vec<Self::Evaluation>), PCSError>
fn batch_open( prover_param: impl Borrow<<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::ProverParam>, batch_commitment: &Self::BatchCommitment, polynomials: &[Self::Polynomial], points: &[Self::Point], ) -> Result<(Self::BatchProof, Vec<Self::Evaluation>), PCSError>
Input
- the prover parameters for univariate KZG,
- the prover parameters for multilinear KZG,
- a list of polynomials,
- a (batch) commitment to all polynomials,
- and the same number of points, compute a batch opening for all the polynomials.
For simplicity, this API requires each MLE to have only one point. If the caller wish to use more than one point per MLE, it should be handled at the caller layer.
Returns an error if the lengths do not match.
Returns the proof, consists of
- the multilinear KZG opening
- the univariate KZG commitment to q(x)
- the openings and evaluations of q(x) at omega^i and r
Steps:
- build
l(points)which is a list of univariate polynomials that goes through the points - build MLE
wwhich is the merge of all MLEs. - build
q(x)which is a univariate polynomialW circ l - commit to q(x) and sample r from transcript transcript contains: w commitment, points, q(x)’s commitment
- build q(omega^i) and their openings
- build q(r) and its opening
- get a point
p := l(r) - output an opening of
wover pointp - output
w(p)
Source§fn verify(
verifier_param: &<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam,
commitment: &Self::Commitment,
point: &Self::Point,
value: &E::ScalarField,
proof: &Self::Proof,
) -> Result<bool, PCSError>
fn verify( verifier_param: &<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam, commitment: &Self::Commitment, point: &Self::Point, value: &E::ScalarField, proof: &Self::Proof, ) -> Result<bool, PCSError>
Verifies that value is the evaluation at x of the polynomial
committed inside comm.
This function takes
- num_var number of pairing product.
- num_var number of MSM
Source§fn batch_verify<R: RngCore + CryptoRng>(
verifier_param: &<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam,
batch_commitment: &Self::BatchCommitment,
points: &[Self::Point],
values: &[E::ScalarField],
batch_proof: &Self::BatchProof,
_rng: &mut R,
) -> Result<bool, PCSError>
fn batch_verify<R: RngCore + CryptoRng>( verifier_param: &<(MultilinearUniversalParams<E>, UnivariateUniversalParams<E>) as StructuredReferenceString>::VerifierParam, batch_commitment: &Self::BatchCommitment, points: &[Self::Point], values: &[E::ScalarField], batch_proof: &Self::BatchProof, _rng: &mut R, ) -> Result<bool, PCSError>
Verifies that value is the evaluation at x_i of the polynomial
poly_i committed inside commitment.
steps:
- put
q(x)’s evaluations over(1, omega,...)into transcript - sample
rfrom transcript - check
q(r) == value - build
l(points)which is a list of univariate polynomials that goes through the points - get a point
p := l(r) - verifies
pis verifies against proof
Source§type SRS = (MultilinearUniversalParams<E>, UnivariateUniversalParams<E>)
type SRS = (MultilinearUniversalParams<E>, UnivariateUniversalParams<E>)
Source§type Polynomial = Arc<DenseMultilinearExtension<<E as Pairing>::ScalarField>>
type Polynomial = Arc<DenseMultilinearExtension<<E as Pairing>::ScalarField>>
Source§type Evaluation = <E as Pairing>::ScalarField
type Evaluation = <E as Pairing>::ScalarField
Source§type Commitment = Commitment<E>
type Commitment = Commitment<E>
Source§type BatchCommitment = Commitment<E>
type BatchCommitment = Commitment<E>
Source§type Proof = MultilinearKzgProof<E>
type Proof = MultilinearKzgProof<E>
Source§type BatchProof = MultilinearKzgBatchProof<E>
type BatchProof = MultilinearKzgBatchProof<E>
Source§fn load_srs_from_file(
supported_degree: usize,
file: Option<&str>,
) -> Result<Self::SRS, PCSError>
fn load_srs_from_file( supported_degree: usize, file: Option<&str>, ) -> Result<Self::SRS, PCSError>
pp bytes, and
the actual setup is usually carried out via MPC and should be
implemented else where. We only load them into memory here. Read moreSource§fn multi_open(
prover_param: impl Borrow<<Self::SRS as StructuredReferenceString>::ProverParam>,
polynomial: &Self::Polynomial,
points: &[Self::Point],
) -> Result<(Vec<Self::Proof>, Vec<Self::Evaluation>), PCSError>
fn multi_open( prover_param: impl Borrow<<Self::SRS as StructuredReferenceString>::ProverParam>, polynomial: &Self::Polynomial, points: &[Self::Point], ) -> Result<(Vec<Self::Proof>, Vec<Self::Evaluation>), PCSError>
Auto Trait Implementations§
impl<E> Freeze for MultilinearKzgPCS<E>
impl<E> RefUnwindSafe for MultilinearKzgPCS<E>where
E: RefUnwindSafe,
impl<E> Send for MultilinearKzgPCS<E>
impl<E> Sync for MultilinearKzgPCS<E>
impl<E> Unpin for MultilinearKzgPCS<E>where
E: Unpin,
impl<E> UnwindSafe for MultilinearKzgPCS<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
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>
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>
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