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§
type Proof: CanonicalSerialize + CanonicalDeserialize
type ProvingKey: CanonicalSerialize + CanonicalDeserialize
type VerifyingKey: CanonicalSerialize + CanonicalDeserialize
Required Methods§
Sourcefn prove<C: ConstraintSynthesizer<CircuitField>>(
pk: &Self::ProvingKey,
circuit: C,
) -> Self::Proof
fn prove<C: ConstraintSynthesizer<CircuitField>>( pk: &Self::ProvingKey, circuit: C, ) -> Self::Proof
Generates proof for circuit using proving key pk
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§
Source§impl ProvingSystem for GM17
impl ProvingSystem for GM17
type Proof = <GM17<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::Proof
type ProvingKey = <GM17<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::ProvingKey
type VerifyingKey = <GM17<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::VerifyingKey
Source§impl ProvingSystem for Groth16
impl ProvingSystem for Groth16
type Proof = <Groth16<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::Proof
type ProvingKey = <Groth16<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::ProvingKey
type VerifyingKey = <Groth16<Bls12<Parameters>> as SNARK<Fp256<FrParameters>>>::VerifyingKey
Source§impl ProvingSystem for Marlin
Available on crate feature circuit only.
impl ProvingSystem for Marlin
Available on crate feature
circuit only.