pub trait SNARK {
    type ScalarField: Clone + PrimeField;
    type BaseField: Clone + PrimeField;
    type Certificate: CanonicalSerialize + CanonicalDeserialize + Clone + Debug + ToBytes + FromBytes + PartialEq + Eq + Send + Sync;
    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 + for<'a> From<&'a Self::ProvingKey> + From<Self::ProvingKey> + ToConstraintField<Self::BaseField> + ToMinimalBits;
    type FiatShamirRng: AlgebraicSponge<Self::BaseField, 2, Parameters = Self::FSParameters>;
    type FSParameters;

    fn universal_setup<R: Rng + CryptoRng>(
        config: &Self::UniversalSetupConfig,
        rng: &mut R
    ) -> Result<Self::UniversalSetupParameters, SNARKError>; 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_vk(
        fs_parameters: &Self::FSParameters,
        verifying_key: &Self::VerifyingKey,
        proving_key: &Self::ProvingKey
    ) -> Result<Self::Certificate, SNARKError>; fn prove_batch_with_terminator<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        fs_parameters: &Self::FSParameters,
        proving_key: &Self::ProvingKey,
        input_and_witness: &[C],
        terminator: &AtomicBool,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError>; fn verify_vk<C: ConstraintSynthesizer<Self::ScalarField>>(
        fs_parameters: &Self::FSParameters,
        circuit: &C,
        verifying_key: &Self::VerifyingKey,
        certificate: &Self::Certificate
    ) -> Result<bool, SNARKError>; fn verify_batch_prepared<B: Borrow<Self::VerifierInput>>(
        fs_parameters: &Self::FSParameters,
        prepared_verifying_key: &<Self::VerifyingKey as Prepare>::Prepared,
        input: &[B],
        proof: &Self::Proof
    ) -> Result<bool, SNARKError>; fn prove_batch<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        fs_parameters: &Self::FSParameters,
        proving_key: &Self::ProvingKey,
        input_and_witness: &[C],
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError> { ... } fn prove<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        fs_parameters: &Self::FSParameters,
        proving_key: &Self::ProvingKey,
        input_and_witness: &C,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError> { ... } fn prove_with_terminator<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>(
        fs_parameters: &Self::FSParameters,
        proving_key: &Self::ProvingKey,
        input_and_witness: &C,
        terminator: &AtomicBool,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError> { ... } fn verify_batch<B: Borrow<Self::VerifierInput>>(
        fs_parameters: &Self::FSParameters,
        verifying_key: &Self::VerifyingKey,
        input: &[B],
        proof: &Self::Proof
    ) -> Result<bool, SNARKError> { ... } fn verify<B: Borrow<Self::VerifierInput>>(
        fs_parameters: &Self::FSParameters,
        verifying_key: &Self::VerifyingKey,
        input: B,
        proof: &Self::Proof
    ) -> Result<bool, SNARKError> { ... } }

Required Associated Types

Required Methods

Provided Methods

Implementors