Trait snarkvm_algorithms::traits::snark::SNARK[][src]

pub trait SNARK {
    type AllocatedCircuit;
    type Circuit;
    type PreparedVerifyingKey: Clone + From<Self::ProvingKey> + From<Self::VerifyingKey>;
    type Proof: Clone + Debug + ToBytes + FromBytes;
    type ProvingKey: Clone + ToBytes + FromBytes;
    type VerifierInput: ?Sized;
    type VerifyingKey: Clone + ToBytes + FromBytes + From<Self::PreparedVerifyingKey> + From<Self::ProvingKey>;
    fn setup<R: Rng>(
        circuit: &Self::Circuit,
        rng: &mut R
    ) -> Result<(Self::ProvingKey, Self::PreparedVerifyingKey), SNARKError>;
fn prove<R: Rng>(
        proving_key: &Self::ProvingKey,
        input_and_witness: &Self::AllocatedCircuit,
        rng: &mut R
    ) -> Result<Self::Proof, SNARKError>;
fn verify(
        verifying_key: &Self::PreparedVerifyingKey,
        input: &Self::VerifierInput,
        proof: &Self::Proof
    ) -> Result<bool, SNARKError>; }

Associated Types

Required methods

fn setup<R: Rng>(
    circuit: &Self::Circuit,
    rng: &mut R
) -> Result<(Self::ProvingKey, Self::PreparedVerifyingKey), SNARKError>
[src]

fn prove<R: Rng>(
    proving_key: &Self::ProvingKey,
    input_and_witness: &Self::AllocatedCircuit,
    rng: &mut R
) -> Result<Self::Proof, SNARKError>
[src]

fn verify(
    verifying_key: &Self::PreparedVerifyingKey,
    input: &Self::VerifierInput,
    proof: &Self::Proof
) -> Result<bool, SNARKError>
[src]

Implementors

impl<E: PairingEngine, C: ConstraintSynthesizer<E::Fr>, V: ToConstraintField<E::Fr> + ?Sized> SNARK for GM17<E, C, V>[src]

type AllocatedCircuit = C

type Circuit = C

type PreparedVerifyingKey = PreparedVerifyingKey<E>

type Proof = Proof<E>

type ProvingKey = ProvingKey<E>

type VerifierInput = V

type VerifyingKey = VerifyingKey<E>

fn setup<R: Rng>(
    circuit: &Self::Circuit,
    rng: &mut R
) -> Result<(Self::ProvingKey, Self::PreparedVerifyingKey), SNARKError>
[src]

fn prove<R: Rng>(
    proving_key: &Self::ProvingKey,
    input_and_witness: &Self::AllocatedCircuit,
    rng: &mut R
) -> Result<Self::Proof, SNARKError>
[src]

fn verify(
    verifying_key: &Self::PreparedVerifyingKey,
    input: &Self::VerifierInput,
    proof: &Self::Proof
) -> Result<bool, SNARKError>
[src]

impl<E: PairingEngine, C: ConstraintSynthesizer<E::Fr>, V: ToConstraintField<E::Fr> + ?Sized> SNARK for Groth16<E, C, V>[src]

type AllocatedCircuit = C

type Circuit = C

type PreparedVerifyingKey = PreparedVerifyingKey<E>

type Proof = Proof<E>

type ProvingKey = ProvingKey<E>

type VerifierInput = V

type VerifyingKey = VerifyingKey<E>

fn setup<R: Rng>(
    circuit: &Self::Circuit,
    rng: &mut R
) -> Result<(Self::ProvingKey, Self::PreparedVerifyingKey), SNARKError>
[src]

fn prove<R: Rng>(
    proving_key: &Self::ProvingKey,
    input_and_witness: &Self::AllocatedCircuit,
    rng: &mut R
) -> Result<Self::Proof, SNARKError>
[src]

fn verify(
    verifying_key: &Self::PreparedVerifyingKey,
    input: &Self::VerifierInput,
    proof: &Self::Proof
) -> Result<bool, SNARKError>
[src]