arnaucube
arnaucube/ark-r1cs-stdPublic Self-hosted repository
ark-r1cs-std/crypto-primitives/src/nizk/constraints.rs
crypto-primitives/src/nizk/constraints.rsRaw
 1use algebra_core::Field;
 2use r1cs_core::{ConstraintSystem, SynthesisError};
 3use r1cs_std::prelude::*;
 4
 5use crate::nizk::NIZK;
 6
 7pub trait NIZKVerifierGadget<N: NIZK, ConstraintF: Field> {
 8    type VerificationKeyGadget: AllocGadget<N::VerificationParameters, ConstraintF>
 9        + ToBytesGadget<ConstraintF>;
10
11    type ProofGadget: AllocGadget<N::Proof, ConstraintF>;
12
13    fn check_verify<'a, CS, I, T>(
14        cs: CS,
15        verification_key: &Self::VerificationKeyGadget,
16        input: I,
17        proof: &Self::ProofGadget,
18    ) -> Result<(), SynthesisError>
19    where
20        CS: ConstraintSystem<ConstraintF>,
21        I: Iterator<Item = &'a T>,
22        T: 'a + ToBitsGadget<ConstraintF> + ?Sized;
23}