1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use crate::utilities::{
alloc::{AllocBytesGadget, AllocGadget},
ToBitsBEGadget,
ToBytesGadget,
};
use snarkvm_algorithms::traits::SNARK;
use snarkvm_fields::Field;
use snarkvm_r1cs::{errors::SynthesisError, ConstraintSystem};
pub trait SNARKVerifierGadget<N: SNARK, F: Field> {
type VerificationKeyGadget: AllocGadget<N::VerificationParameters, F>
+ AllocBytesGadget<Vec<u8>, F>
+ ToBytesGadget<F>;
type ProofGadget: AllocGadget<N::Proof, F> + AllocBytesGadget<Vec<u8>, F>;
fn check_verify<'a, CS: ConstraintSystem<F>, I: Iterator<Item = &'a T>, T: 'a + ToBitsBEGadget<F> + ?Sized>(
cs: CS,
verification_key: &Self::VerificationKeyGadget,
input: I,
proof: &Self::ProofGadget,
) -> Result<(), SynthesisError>;
}