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
type PreparedVerifyingKey: Clone + From<Self::ProvingKey> + From<Self::VerifyingKey>type ProvingKey: Clone + ToBytes + FromBytestype VerifierInput: ?Sizedtype VerifyingKey: Clone + ToBytes + FromBytes + From<Self::PreparedVerifyingKey> + From<Self::ProvingKey>Required methods
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>Implementors
impl<E: PairingEngine, C: ConstraintSynthesizer<E::Fr>, V: ToConstraintField<E::Fr> + ?Sized> SNARK for GM17<E, C, V>impl<E: PairingEngine, C: ConstraintSynthesizer<E::Fr>, V: ToConstraintField<E::Fr> + ?Sized> SNARK for Groth16<E, C, V>