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>

source

pub const PROTOCOL_NAME: &'static [u8] = b"MARLIN-2019"

The personalization string for this protocol. Used to personalize the Fiat-Shamir RNG.

source

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>

source§

fn clone(&self) -> MarlinSNARK<E, FS, MM>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Debug + PairingEngine, FS: Debug + AlgebraicSponge<E::Fq, 2>, MM: Debug + MarlinMode> Debug for MarlinSNARK<E, FS, MM>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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,

source§

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>

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>

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>

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>

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

§

type BaseField = <E as PairingEngine>::Fq

§

type Certificate = Certificate<E>

A certificate that the indexing was performed correctly.
§

type FSParameters = <FS as AlgebraicSponge<<E as PairingEngine>::Fq, 2>>::Parameters

§

type FiatShamirRng = FS

§

type Proof = Proof<E>

§

type ProvingKey = CircuitProvingKey<E, MM>

§

type ScalarField = <E as PairingEngine>::Fr

§

type UniversalProver = UniversalProver<E>

§

type UniversalSRS = UniversalParams<E>

§

type UniversalVerifier = UniversalVerifier<E>

§

type VerifierInput = [<E as PairingEngine>::Fr]

§

type VerifyingKey = CircuitVerifyingKey<E>

source§

fn universal_setup(max_degree: usize) -> Result<Self::UniversalSRS, SNARKError>

source§

fn prove<C: ConstraintSynthesizer<Self::ScalarField>, R: Rng + CryptoRng>( universal_prover: &Self::UniversalProver, fs_parameters: &Self::FSParameters, proving_key: &Self::ProvingKey, constraints: &C, rng: &mut R ) -> Result<Self::Proof, SNARKError>

source§

fn verify<B: Borrow<Self::VerifierInput>>( universal_verifier: &Self::UniversalVerifier, fs_parameters: &Self::FSParameters, verifying_key: &Self::VerifyingKey, input: B, proof: &Self::Proof ) -> Result<bool, SNARKError>

Auto Trait Implementations§

§

impl<E, FS, MM> RefUnwindSafe for MarlinSNARK<E, FS, MM>where E: RefUnwindSafe, FS: RefUnwindSafe, MM: RefUnwindSafe,

§

impl<E, FS, MM> Send for MarlinSNARK<E, FS, MM>where FS: Send,

§

impl<E, FS, MM> Sync for MarlinSNARK<E, FS, MM>where FS: Sync,

§

impl<E, FS, MM> Unpin for MarlinSNARK<E, FS, MM>where E: Unpin, FS: Unpin, MM: Unpin,

§

impl<E, FS, MM> UnwindSafe for MarlinSNARK<E, FS, MM>where E: UnwindSafe, FS: UnwindSafe, MM: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V