pub trait SNARK: Clone + Debug {
    type ScalarField: Clone + PrimeField;
    type BaseField: Clone + PrimeField;
    type PreparedVerifyingKey: Clone;
    type Proof: Clone + Debug + ToBytes + FromBytes + PartialEq + Eq + Send + Sync;
    type ProvingKey: Clone + ToBytes + FromBytes + Send + Sync;
    type UniversalSetupConfig: Clone;
    type UniversalSetupParameters: FromBytes + ToBytes + Clone;
    type VerifierInput: ?Sized;
    type VerifyingKey: Clone + Send + Sync + ToBytes + FromBytes + Prepare<Self::PreparedVerifyingKey> + From<Self::PreparedVerifyingKey> + From<Self::ProvingKey> + ToConstraintField<Self::BaseField> + ToMinimalBits;
    fn setup<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        circuit: &C,
        srs: &mut SRS<'_, R, Self::UniversalSetupParameters>
    ) -> Result<(Self::ProvingKey, Self::VerifyingKey), SNARKError>;
fn prove_with_terminator<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        proving_key: &Self::ProvingKey,
        input_and_witness: &C,
        terminator: &AtomicBool,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError>;
fn verify_prepared(
        prepared_verifying_key: &Self::PreparedVerifyingKey,
        input: &Self::VerifierInput,
        proof: &Self::Proof
    ) -> Result<bool, SNARKError>; fn universal_setup<R: Rng + CryptoRng>(
        _config: &Self::UniversalSetupConfig,
        _rng: &mut R
    ) -> Result<Self::UniversalSetupParameters, SNARKError> { ... }
fn prove<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        proving_key: &Self::ProvingKey,
        input_and_witness: &C,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError> { ... }
fn verify(
        verifying_key: &Self::VerifyingKey,
        input: &Self::VerifierInput,
        proof: &Self::Proof
    ) -> Result<bool, SNARKError> { ... } }

Associated Types

Required methods

Provided methods

Implementors