Struct snarkvm_algorithms::snark::marlin::MarlinSNARK
source · pub struct MarlinSNARK<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, MM: MarlinMode>(_);
Expand description
The Marlin proof system.
Implementations§
source§impl<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, MM: MarlinMode> MarlinSNARK<E, FS, MM>
impl<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, MM: MarlinMode> MarlinSNARK<E, FS, MM>
sourcepub const PROTOCOL_NAME: &'static [u8] = b"MARLIN-2019"
pub const PROTOCOL_NAME: &'static [u8] = b"MARLIN-2019"
The personalization string for this protocol. Used to personalize the Fiat-Shamir RNG.
pub fn batch_circuit_setup<C: ConstraintSynthesizer<E::Fr>>( universal_srs: &UniversalSRS<E>, circuits: &[&C] ) -> Result<Vec<(CircuitProvingKey<E, MM>, CircuitVerifyingKey<E>)>>
Trait Implementations§
source§impl<E: Clone + PairingEngine, FS: Clone + AlgebraicSponge<E::Fq, 2>, MM: Clone + MarlinMode> Clone for MarlinSNARK<E, FS, MM>
impl<E: Clone + PairingEngine, FS: Clone + AlgebraicSponge<E::Fq, 2>, MM: Clone + MarlinMode> Clone for MarlinSNARK<E, FS, MM>
source§fn clone(&self) -> MarlinSNARK<E, FS, MM>
fn clone(&self) -> MarlinSNARK<E, FS, MM>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<E: Debug + PairingEngine, FS: Debug + AlgebraicSponge<E::Fq, 2>, MM: Debug + MarlinMode> Debug for MarlinSNARK<E, FS, MM>
impl<E: Debug + PairingEngine, FS: Debug + AlgebraicSponge<E::Fq, 2>, MM: Debug + MarlinMode> Debug for MarlinSNARK<E, FS, MM>
source§impl<E: PairingEngine, FS, MM> SNARK for MarlinSNARK<E, FS, MM>where
E::Fr: PrimeField,
E::Fq: PrimeField,
FS: AlgebraicSponge<E::Fq, 2>,
MM: MarlinMode,
impl<E: PairingEngine, FS, MM> SNARK for MarlinSNARK<E, FS, MM>where E::Fr: PrimeField, E::Fq: PrimeField, FS: AlgebraicSponge<E::Fq, 2>, MM: MarlinMode,
source§fn circuit_setup<C: ConstraintSynthesizer<E::Fr>>(
universal_srs: &Self::UniversalSRS,
circuit: &C
) -> Result<(Self::ProvingKey, Self::VerifyingKey)>
fn circuit_setup<C: ConstraintSynthesizer<E::Fr>>( universal_srs: &Self::UniversalSRS, circuit: &C ) -> Result<(Self::ProvingKey, Self::VerifyingKey)>
Generates the circuit proving and verifying keys. This is a deterministic algorithm that anyone can rerun.
source§fn prove_vk(
universal_prover: &Self::UniversalProver,
fs_parameters: &Self::FSParameters,
verifying_key: &Self::VerifyingKey,
proving_key: &Self::ProvingKey
) -> Result<Self::Certificate, SNARKError>
fn prove_vk( universal_prover: &Self::UniversalProver, fs_parameters: &Self::FSParameters, verifying_key: &Self::VerifyingKey, proving_key: &Self::ProvingKey ) -> Result<Self::Certificate, SNARKError>
Prove that the verifying key indeed includes a part of the reference string, as well as the indexed circuit (i.e. the circuit as a set of linear-sized polynomials).
source§fn verify_vk<C: ConstraintSynthesizer<Self::ScalarField>>(
universal_verifier: &Self::UniversalVerifier,
fs_parameters: &Self::FSParameters,
circuit: &C,
verifying_key: &Self::VerifyingKey,
certificate: &Self::Certificate
) -> Result<bool, SNARKError>
fn verify_vk<C: ConstraintSynthesizer<Self::ScalarField>>( universal_verifier: &Self::UniversalVerifier, fs_parameters: &Self::FSParameters, circuit: &C, verifying_key: &Self::VerifyingKey, certificate: &Self::Certificate ) -> Result<bool, SNARKError>
Verify that the verifying key indeed includes a part of the reference string, as well as the indexed circuit (i.e. the circuit as a set of linear-sized polynomials).
source§fn prove_batch<C: ConstraintSynthesizer<E::Fr>, R: Rng + CryptoRng>(
universal_prover: &Self::UniversalProver,
fs_parameters: &Self::FSParameters,
keys_to_constraints: &BTreeMap<&CircuitProvingKey<E, MM>, &[C]>,
zk_rng: &mut R
) -> Result<Self::Proof, SNARKError>
fn prove_batch<C: ConstraintSynthesizer<E::Fr>, R: Rng + CryptoRng>( universal_prover: &Self::UniversalProver, fs_parameters: &Self::FSParameters, keys_to_constraints: &BTreeMap<&CircuitProvingKey<E, MM>, &[C]>, zk_rng: &mut R ) -> Result<Self::Proof, SNARKError>
This is the main entrypoint for creating proofs. You can find a specification of the prover algorithm in: https://github.com/AleoHQ/protocol-docs/tree/main/marlin
source§fn verify_batch<B: Borrow<Self::VerifierInput>>(
universal_verifier: &Self::UniversalVerifier,
fs_parameters: &Self::FSParameters,
keys_to_inputs: &BTreeMap<&Self::VerifyingKey, &[B]>,
proof: &Self::Proof
) -> Result<bool, SNARKError>
fn verify_batch<B: Borrow<Self::VerifierInput>>( universal_verifier: &Self::UniversalVerifier, fs_parameters: &Self::FSParameters, keys_to_inputs: &BTreeMap<&Self::VerifyingKey, &[B]>, proof: &Self::Proof ) -> Result<bool, SNARKError>
This is the main entrypoint for verifying proofs. You can find a specification of the verifier algorithm in: https://github.com/AleoHQ/protocol-docs/tree/main/marlin