ark-r1cs-std/crypto-primitives/src/nizk/constraints.rs
crypto-primitives/src/nizk/constraints.rsRaw
1use algebra::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> + ToBytesGadget<ConstraintF>;
9
10 type ProofGadget: AllocGadget<N::Proof, ConstraintF>;
11
12 fn check_verify<'a, CS, I, T>(
13 cs: CS,
14 verification_key: &Self::VerificationKeyGadget,
15 input: I,
16 proof: &Self::ProofGadget,
17 ) -> Result<(), SynthesisError>
18 where
19 CS: ConstraintSystem<ConstraintF>,
20 I: Iterator<Item = &'a T>,
21 T: 'a + ToBitsGadget<ConstraintF> + ?Sized;
22}