Trait Proof

Source
pub trait Proof: Sized {
    type ProvingKey;
    type VerifyingKey;
    type Instance;
    type Witness;
    type Error;

    // Required methods
    fn create<R: RngCore>(
        pk: &Self::ProvingKey,
        instance: &Self::Instance,
        witness: &Self::Witness,
        rng: R,
    ) -> Result<Self, Self::Error>;
    fn verify(
        &self,
        vk: &Self::VerifyingKey,
        instance: &Self::Instance,
    ) -> Result<(), Self::Error>;
}
Expand description

Trait for a zero-knowledge proof about some statement.

Required Associated Types§

Source

type ProvingKey

The parameters necessary to create a proof.

Source

type VerifyingKey

The parameters necessary to verify a proof.

Source

type Instance

The input commonly known to both the prover and verifier.

Source

type Witness

The private input to the prover.

Source

type Error

Errors that may occur while creating or verifying proofs.

Required Methods§

Source

fn create<R: RngCore>( pk: &Self::ProvingKey, instance: &Self::Instance, witness: &Self::Witness, rng: R, ) -> Result<Self, Self::Error>

Creates a proof that the given instance and witness satisfy the statement.

Source

fn verify( &self, vk: &Self::VerifyingKey, instance: &Self::Instance, ) -> Result<(), Self::Error>

Verifies that this proof satisfies the statement for the given instance.

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§