pub trait CommitmentEvaluationProof {
type Scalar: Scalar + Serialize + for<'a> Deserialize<'a>;
type Commitment: for<'a> Commitment<Scalar = Self::Scalar, PublicSetup<'a> = Self::ProverPublicSetup<'a>> + Serialize + for<'a> Deserialize<'a>;
type Error;
type ProverPublicSetup<'a>: Copy;
type VerifierPublicSetup<'a>: Copy;
// Required methods
fn new(
transcript: &mut impl Transcript,
a: &[Self::Scalar],
b_point: &[Self::Scalar],
generators_offset: u64,
setup: &Self::ProverPublicSetup<'_>,
) -> Self;
fn verify_batched_proof(
&self,
transcript: &mut impl Transcript,
commit_batch: &[Self::Commitment],
batching_factors: &[Self::Scalar],
evaluations: &[Self::Scalar],
b_point: &[Self::Scalar],
generators_offset: u64,
table_length: usize,
setup: &Self::VerifierPublicSetup<'_>,
) -> Result<(), Self::Error>;
// Provided method
fn verify_proof(
&self,
transcript: &mut impl Transcript,
a_commit: &Self::Commitment,
product: &Self::Scalar,
b_point: &[Self::Scalar],
generators_offset: u64,
table_length: usize,
setup: &Self::VerifierPublicSetup<'_>,
) -> Result<(), Self::Error> { ... }
}
Expand description
A trait for using commitment schemes generically. Specifically, this trait is for the evaluation proof of a commitment scheme.
Required Associated Types§
Sourcetype Scalar: Scalar + Serialize + for<'a> Deserialize<'a>
type Scalar: Scalar + Serialize + for<'a> Deserialize<'a>
The associated scalar that the commitment is for.
Sourcetype Commitment: for<'a> Commitment<Scalar = Self::Scalar, PublicSetup<'a> = Self::ProverPublicSetup<'a>> + Serialize + for<'a> Deserialize<'a>
type Commitment: for<'a> Commitment<Scalar = Self::Scalar, PublicSetup<'a> = Self::ProverPublicSetup<'a>> + Serialize + for<'a> Deserialize<'a>
The associated commitment type.
Sourcetype ProverPublicSetup<'a>: Copy
type ProverPublicSetup<'a>: Copy
The public setup parameters required by the prover. This is simply precomputed data that is required by the prover to create a proof.
Sourcetype VerifierPublicSetup<'a>: Copy
type VerifierPublicSetup<'a>: Copy
The public setup parameters required by the verifier. This is simply precomputed data that is required by the verifier to verify a proof.
Required Methods§
Sourcefn new(
transcript: &mut impl Transcript,
a: &[Self::Scalar],
b_point: &[Self::Scalar],
generators_offset: u64,
setup: &Self::ProverPublicSetup<'_>,
) -> Self
fn new( transcript: &mut impl Transcript, a: &[Self::Scalar], b_point: &[Self::Scalar], generators_offset: u64, setup: &Self::ProverPublicSetup<'_>, ) -> Self
Create a new proof.
Note: b_point
must have length nu
, where 2^nu
is at least the length of a
.
b_point
are the values for the variables that are being evaluated.
The resulting evaluation is the inner product of a
and b
, where b
is the expanded vector form of b_point
.
Sourcefn verify_batched_proof(
&self,
transcript: &mut impl Transcript,
commit_batch: &[Self::Commitment],
batching_factors: &[Self::Scalar],
evaluations: &[Self::Scalar],
b_point: &[Self::Scalar],
generators_offset: u64,
table_length: usize,
setup: &Self::VerifierPublicSetup<'_>,
) -> Result<(), Self::Error>
fn verify_batched_proof( &self, transcript: &mut impl Transcript, commit_batch: &[Self::Commitment], batching_factors: &[Self::Scalar], evaluations: &[Self::Scalar], b_point: &[Self::Scalar], generators_offset: u64, table_length: usize, setup: &Self::VerifierPublicSetup<'_>, ) -> Result<(), Self::Error>
Verify a batch proof. This can be more efficient than verifying individual proofs for some schemes.
Provided Methods§
Sourcefn verify_proof(
&self,
transcript: &mut impl Transcript,
a_commit: &Self::Commitment,
product: &Self::Scalar,
b_point: &[Self::Scalar],
generators_offset: u64,
table_length: usize,
setup: &Self::VerifierPublicSetup<'_>,
) -> Result<(), Self::Error>
fn verify_proof( &self, transcript: &mut impl Transcript, a_commit: &Self::Commitment, product: &Self::Scalar, b_point: &[Self::Scalar], generators_offset: u64, table_length: usize, setup: &Self::VerifierPublicSetup<'_>, ) -> Result<(), Self::Error>
Verify a proof.
Note: b_point
must have length nu
, where 2^nu
is at least the length of a
.
b_point
are the values for the variables that are being evaluated.
The resulting evaluation is the inner product of a
and b
, where b
is the expanded vector form of b_point
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.