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>
impl<E: PairingEngine, FS: AlgebraicSponge<E::Fq, 2>, SM: SNARKMode> VarunaSNARK<E, FS, SM>
Sourcepub const PROTOCOL_NAME: &'static [u8] = b"VARUNA-2023"
pub const PROTOCOL_NAME: &'static [u8] = b"VARUNA-2023"
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, 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>
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>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<E: Debug + PairingEngine, FS: Debug + AlgebraicSponge<E::Fq, 2>, SM: Debug + SNARKMode> Debug for VarunaSNARK<E, FS, SM>
impl<E: Debug + PairingEngine, FS: Debug + AlgebraicSponge<E::Fq, 2>, SM: Debug + SNARKMode> Debug for VarunaSNARK<E, FS, SM>
Source§impl<E: PairingEngine, FS, SM> SNARK for VarunaSNARK<E, FS, SM>
impl<E: PairingEngine, FS, SM> SNARK for VarunaSNARK<E, FS, SM>
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>
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>
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>
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>
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
type BaseField = <E as PairingEngine>::Fq
Source§type Certificate = Certificate<E>
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, SM>
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>
fn universal_setup(max_degree: usize) -> Result<Self::UniversalSRS>
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>
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>
impl<E, FS, SM> UnwindSafe for VarunaSNARK<E, FS, SM>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more