pub trait Pcs<Challenge, Challenger>{
type Domain: PolynomialSpace;
type Commitment: Clone + Serialize + DeserializeOwned;
type ProverData;
type Proof: Clone + Serialize + DeserializeOwned;
type Error: Debug;
type ProverError: Debug;
// Required methods
fn natural_domain_for_degree(&self, degree: usize) -> Self::Domain;
fn commit(
&self,
evaluations: impl IntoIterator<Item = (Self::Domain, RowMajorMatrix<Val<Self::Domain>>)>,
) -> Result<(Self::Commitment, Self::ProverData), Self::ProverError>;
fn open(
&self,
commitment_data_with_opening_points: Vec<OpeningRequest<'_, Self::ProverData, Challenge>>,
fiat_shamir_challenger: &mut Challenger,
) -> Result<(OpenedValues<Challenge>, Self::Proof), Self::ProverError>;
fn verify(
&self,
commitments_with_opening_points: Vec<CommitmentOpening<Challenge, Self::Commitment, Self::Domain>>,
proof: &Self::Proof,
fiat_shamir_challenger: &mut Challenger,
) -> Result<(), Self::Error>;
}Expand description
A polynomial commitment scheme, for committing to batches of polynomials defined by their evaluations over some domain.
In general this does not have to be a hiding commitment scheme but it might be for some implementations.
Required Associated Types§
Sourcetype Domain: PolynomialSpace
type Domain: PolynomialSpace
The class of evaluation domains that this commitment scheme works over.
Sourcetype Commitment: Clone + Serialize + DeserializeOwned
type Commitment: Clone + Serialize + DeserializeOwned
The commitment that’s sent to the verifier.
Sourcetype ProverData
type ProverData
Data that the prover stores for committed polynomials, to help the prover with opening.
Sourcetype Proof: Clone + Serialize + DeserializeOwned
type Proof: Clone + Serialize + DeserializeOwned
The opening argument.
Sourcetype ProverError: Debug
type ProverError: Debug
Configuration or budget failure during commitment or opening.
Required Methods§
Sourcefn natural_domain_for_degree(&self, degree: usize) -> Self::Domain
fn natural_domain_for_degree(&self, degree: usize) -> Self::Domain
This should return a domain such that Domain::next_point returns Some.
Sourcefn commit(
&self,
evaluations: impl IntoIterator<Item = (Self::Domain, RowMajorMatrix<Val<Self::Domain>>)>,
) -> Result<(Self::Commitment, Self::ProverData), Self::ProverError>
fn commit( &self, evaluations: impl IntoIterator<Item = (Self::Domain, RowMajorMatrix<Val<Self::Domain>>)>, ) -> Result<(Self::Commitment, Self::ProverData), Self::ProverError>
Given a collection of evaluation matrices, produce a binding commitment to the polynomials defined by those evaluations. Hiding implementations may randomize their encoding before committing.
Returns both the commitment which should be sent to the verifier and the prover data which can be used to produce opening proofs. Configuration and budget failures are returned before consuming private randomness.
Sourcefn open(
&self,
commitment_data_with_opening_points: Vec<OpeningRequest<'_, Self::ProverData, Challenge>>,
fiat_shamir_challenger: &mut Challenger,
) -> Result<(OpenedValues<Challenge>, Self::Proof), Self::ProverError>
fn open( &self, commitment_data_with_opening_points: Vec<OpeningRequest<'_, Self::ProverData, Challenge>>, fiat_shamir_challenger: &mut Challenger, ) -> Result<(OpenedValues<Challenge>, Self::Proof), Self::ProverError>
Open each requested commitment, matrix and point in caller order.
Each request must supply one point vector per committed matrix. Columns are
interpreted as polynomials evaluated over the domain supplied to Self::commit.
The returned values retain request, matrix, point and column order.
Configuration and budget rejection leaves the challenger, private randomness, and any single-use opening state unchanged. This does not undo earlier successful calls.
Sourcefn verify(
&self,
commitments_with_opening_points: Vec<CommitmentOpening<Challenge, Self::Commitment, Self::Domain>>,
proof: &Self::Proof,
fiat_shamir_challenger: &mut Challenger,
) -> Result<(), Self::Error>
fn verify( &self, commitments_with_opening_points: Vec<CommitmentOpening<Challenge, Self::Commitment, Self::Domain>>, proof: &Self::Proof, fiat_shamir_challenger: &mut Challenger, ) -> Result<(), Self::Error>
Verify the claimed column evaluations for each commitment, matrix and point.
Claims supply the original evaluation domains and must retain the ordering used to construct the opening proof. The proof and transcript formats are backend-specific.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".