snarkvm_algorithms::snark::varuna

Struct VarunaSNARK

Source
pub struct VarunaSNARK<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, SM: SNARKMode>(/* private fields */);
Expand description

The Varuna proof system.

Implementations§

Source§

impl<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, SM: SNARKMode> VarunaSNARK<E, FS, SM>

Source

pub const PROTOCOL_NAME: &'static [u8] = b"VARUNA-2023"

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, SM>, CircuitVerifyingKey<E>)>>

Trait Implementations§

Source§

impl<E: Clone + PairingEngine, FS: Clone + AlgebraicSponge<E::Fq, 2>, SM: Clone + SNARKMode> Clone for VarunaSNARK<E, FS, SM>

Source§

fn clone(&self) -> VarunaSNARK<E, FS, SM>

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>, SM: Debug + SNARKMode> Debug for VarunaSNARK<E, FS, SM>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<E: PairingEngine, FS, SM> SNARK for VarunaSNARK<E, FS, SM>
where E::Fr: PrimeField, E::Fq: PrimeField, FS: AlgebraicSponge<E::Fq, 2>, SM: SNARKMode,

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>

Prove that the verifying key commitments commit to the indexed circuit’s 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>

Verify that the verifying key commitments commit to the indexed circuit’s polynomials Verify that the verifying key’s circuit_info is correct

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, SM>, &[C]>, zk_rng: &mut R, ) -> Result<Self::Proof>

This is the main entrypoint for creating proofs. You can find a specification of the prover algorithm in: https://github.com/AleoNet/protocol-docs

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>

This is the main entrypoint for verifying proofs. You can find a specification of the verifier algorithm in: https://github.com/AleoNet/protocol-docs

Source§

type BaseField = <E as PairingEngine>::Fq

Source§

type Certificate = Certificate<E>

A certificate that the indexing was performed correctly.
Source§

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

Source§

type FiatShamirRng = FS

Source§

type Proof = Proof<E>

Source§

type ProvingKey = CircuitProvingKey<E, SM>

Source§

type ScalarField = <E as PairingEngine>::Fr

Source§

type UniversalProver = UniversalProver<E>

Source§

type UniversalSRS = UniversalParams<E>

Source§

type UniversalVerifier = UniversalVerifier<E>

Source§

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

Source§

type VerifyingKey = CircuitVerifyingKey<E>

Source§

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

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>

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>

Auto Trait Implementations§

§

impl<E, FS, SM> Freeze for VarunaSNARK<E, FS, SM>

§

impl<E, FS, SM> RefUnwindSafe for VarunaSNARK<E, FS, SM>

§

impl<E, FS, SM> Send for VarunaSNARK<E, FS, SM>
where FS: Send,

§

impl<E, FS, SM> Sync for VarunaSNARK<E, FS, SM>
where FS: Sync,

§

impl<E, FS, SM> Unpin for VarunaSNARK<E, FS, SM>
where E: Unpin, FS: Unpin, SM: Unpin,

§

impl<E, FS, SM> UnwindSafe for VarunaSNARK<E, FS, SM>
where E: UnwindSafe, FS: UnwindSafe, SM: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V