Trait snarkvm_wasm::SNARKGadget[][src]

pub trait SNARKGadget<F, CF, S> where
    F: PrimeField,
    S: SNARK,
    CF: PrimeField
{ type PreparedVerifyingKeyVar: AllocGadget<<S as SNARK>::PreparedVerifyingKey, CF> + Clone; type VerifyingKeyVar: AllocGadget<<S as SNARK>::VerifyingKey, CF> + ToBytesGadget<CF> + Clone; type InputVar: AllocGadget<Vec<F, Global>, CF> + Clone + FromFieldElementsGadget<F, CF>; type ProofVar: AllocGadget<<S as SNARK>::Proof, CF> + Clone; type VerifierSize: PartialOrd<Self::VerifierSize> + Clone + Debug; fn verifier_size(
        circuit_vk: &<S as SNARK>::VerifyingKey
    ) -> Self::VerifierSize;
fn verify_with_processed_vk<CS>(
        cs: CS,
        circuit_pvk: &Self::PreparedVerifyingKeyVar,
        x: &Self::InputVar,
        proof: &Self::ProofVar
    ) -> Result<Boolean, SynthesisError>
    where
        CS: ConstraintSystem<CF>
;
fn verify<CS>(
        cs: CS,
        circuit_vk: &Self::VerifyingKeyVar,
        x: &Self::InputVar,
        proof: &Self::ProofVar
    ) -> Result<Boolean, SynthesisError>
    where
        CS: ConstraintSystem<CF>
; }
Expand description

This implements constraints for SNARK verifiers.

Associated Types

Information about the R1CS constraints required to check proofs relative a given verification key. In the context of a LPCP-based pairing-based SNARK like that of [Groth16], this is independent of the R1CS matrices, whereas for more “complex” SNARKs like [Marlin], this can encode information about the highest degree of polynomials required to verify proofs.

Required methods

Returns information about the R1CS constraints required to check proofs relative to the verification key circuit_vk.

Implementors