jf_pcs::univariate_kzg

Struct UnivariateKzgPCS

Source
pub struct UnivariateKzgPCS<E> { /* private fields */ }
Expand description

KZG Polynomial Commitment Scheme on univariate polynomial.

Trait Implementations§

Source§

impl<E: Pairing> PolynomialCommitmentScheme for UnivariateKzgPCS<E>

Source§

fn trim( srs: impl Borrow<Self::SRS>, supported_degree: usize, supported_num_vars: Option<usize>, ) -> Result<(UnivariateProverParam<E>, UnivariateVerifierParam<E>), PCSError>

Trim the universal parameters to specialize the public parameters. Input max_degree for univariate. supported_num_vars must be None or an error is returned.

Source§

fn commit( prover_param: impl Borrow<UnivariateProverParam<E>>, poly: &Self::Polynomial, ) -> Result<Self::Commitment, PCSError>

Generate a commitment for a polynomial Note that the scheme is not hiding

Source§

fn batch_commit( prover_param: impl Borrow<UnivariateProverParam<E>>, polys: &[Self::Polynomial], ) -> Result<Self::BatchCommitment, PCSError>

Generate a commitment for a list of polynomials

Source§

fn open( prover_param: impl Borrow<UnivariateProverParam<E>>, 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.

Source§

fn batch_open( prover_param: impl Borrow<UnivariateProverParam<E>>, _multi_commitment: &Self::BatchCommitment, polynomials: &[Self::Polynomial], points: &[Self::Point], ) -> Result<(Self::BatchProof, Vec<Self::Evaluation>), PCSError>

Input a list of polynomials, and the same number of points, compute a multi-opening for all the polynomials.

Source§

fn verify( verifier_param: &UnivariateVerifierParam<E>, 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.

Source§

fn batch_verify<R: RngCore + CryptoRng>( verifier_param: &UnivariateVerifierParam<E>, multi_commitment: &Self::BatchCommitment, points: &[Self::Point], values: &[E::ScalarField], batch_proof: &Self::BatchProof, rng: &mut R, ) -> Result<bool, PCSError>

Verifies that value_i is the evaluation at x_i of the polynomial poly_i committed inside comm.

Source§

fn multi_open( prover_param: impl Borrow<UnivariateProverParam<E>>, polynomial: &Self::Polynomial, points: &[Self::Point], ) -> Result<(Vec<Self::Proof>, Vec<Self::Evaluation>), PCSError>

Fast computation of batch opening for a single polynomial at multiple arbitrary points. Details see Sec 2.1~2.3 of FK23.

Only accept polynomial with power-of-two degree, no constraint on the size of points

Source§

type SRS = UnivariateUniversalParams<E>

Structured reference string
Source§

type Polynomial = DensePolynomial<<E as Pairing>::ScalarField>

Polynomial and its associated types
Source§

type Point = <E as Pairing>::ScalarField

Polynomial input domain
Source§

type Evaluation = <E as Pairing>::ScalarField

Polynomial Evaluation
Source§

type Commitment = Commitment<E>

Commitments
Source§

type BatchCommitment = Vec<<UnivariateKzgPCS<E> as PolynomialCommitmentScheme>::Commitment>

Batch commitments
Source§

type Proof = UnivariateKzgProof<E>

Proofs
Source§

type BatchProof = Vec<UnivariateKzgProof<E>>

Batch proofs
Source§

fn load_srs_from_file( supported_degree: usize, file: Option<&str>, ) -> Result<Self::SRS, PCSError>

Load public parameter in production environment. These parameters are loaded from files with serialized 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 more
Source§

impl<E: Pairing> UnivariatePCS for UnivariateKzgPCS<E>

Source§

fn multi_open_rou_evals( polynomial: &Self::Polynomial, num_points: usize, domain: &Radix2EvaluationDomain<Self::Evaluation>, ) -> Result<Vec<Self::Evaluation>, PCSError>

Compute the evaluations in Self::multi_open_rou().

Source§

fn multi_point_open( prover_param: impl Borrow<<Self::SRS as StructuredReferenceString>::ProverParam>, polynomial: &Self::Polynomial, points: &[Self::Point], ) -> Result<(Self::Proof, Vec<Self::Evaluation>), PCSError>

Input a polynomial, and multiple evaluation points, compute a batch opening proof for the multiple points of the same polynomial.

Warning: don’t use it when points.len() is large

Source§

fn multi_point_verify( verifier_param: impl Borrow<<Self::SRS as StructuredReferenceString>::VerifierParam>, commitment: &Self::Commitment, points: &[Self::Point], values: &[Self::Evaluation], proof: &Self::Proof, ) -> Result<bool, PCSError>

Verifies that values are the evaluation at the points of the polynomial committed inside comm.

Warning: don’t use it when points.len() is large

Source§

fn multi_open_rou_proofs( prover_param: impl Borrow<<Self::SRS as StructuredReferenceString>::ProverParam>, polynomial: &Self::Polynomial, num_points: usize, domain: &Radix2EvaluationDomain<Self::Evaluation>, ) -> Result<Vec<Self::Proof>, PCSError>

Compute the opening proofs in Self::multi_open_rou().
Source§

fn trim_fft_size( srs: impl Borrow<Self::SRS>, supported_degree: usize, ) -> Result<(<Self::SRS as StructuredReferenceString>::ProverParam, <Self::SRS as StructuredReferenceString>::VerifierParam), PCSError>

Similar to PolynomialCommitmentScheme::trim(), but trim to support the FFT operations, such as Self::multi_open_rou() or other operations that involves roots of unity.
Source§

fn multi_open_rou_eval_domain( degree: usize, num_points: usize, ) -> Result<Radix2EvaluationDomain<Self::Evaluation>, PCSError>

Given degree of the committed polynomial and num_points to open, return the evaluation domain for faster computation of opening proofs and evaluations (both using FFT).
Source§

fn multi_open_rou( prover_param: impl Borrow<<Self::SRS as StructuredReferenceString>::ProverParam>, polynomial: &Self::Polynomial, num_points: usize, domain: &Radix2EvaluationDomain<Self::Evaluation>, ) -> Result<(Vec<Self::Proof>, Vec<Self::Evaluation>), PCSError>

Same task as PolynomialCommitmentScheme::multi_open(), except the points are roots of unity. The first num_points of roots will be evaluated (in canonical order).

Auto Trait Implementations§

§

impl<E> Freeze for UnivariateKzgPCS<E>

§

impl<E> RefUnwindSafe for UnivariateKzgPCS<E>
where E: RefUnwindSafe,

§

impl<E> Send for UnivariateKzgPCS<E>
where E: Send,

§

impl<E> Sync for UnivariateKzgPCS<E>
where E: Sync,

§

impl<E> Unpin for UnivariateKzgPCS<E>
where E: Unpin,

§

impl<E> UnwindSafe for UnivariateKzgPCS<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

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 for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V