ProvingSystem

Trait ProvingSystem 

Source
pub trait ProvingSystem {
    type Proof: CanonicalSerialize + CanonicalDeserialize;
    type ProvingKey: CanonicalSerialize + CanonicalDeserialize;
    type VerifyingKey: CanonicalSerialize + CanonicalDeserialize;

    // Required methods
    fn prove<C: ConstraintSynthesizer<CircuitField>>(
        pk: &Self::ProvingKey,
        circuit: C,
    ) -> Self::Proof;
    fn verify(
        vk: &Self::VerifyingKey,
        proof: &Self::Proof,
        public_input: Vec<CircuitField>,
    ) -> Result<bool, Error>;
}
Expand description

Common API for every proving system.

Required Associated Types§

Required Methods§

Source

fn prove<C: ConstraintSynthesizer<CircuitField>>( pk: &Self::ProvingKey, circuit: C, ) -> Self::Proof

Generates proof for circuit using proving key pk

Source

fn verify( vk: &Self::VerifyingKey, proof: &Self::Proof, public_input: Vec<CircuitField>, ) -> Result<bool, Error>

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.

Implementors§