snark_verifier/
verifier.rs
1use crate::{
4 loader::Loader,
5 util::{arithmetic::CurveAffine, transcript::TranscriptRead},
6 Error,
7};
8use std::fmt::Debug;
9
10pub mod plonk;
11
12pub trait SnarkVerifier<C, L>
14where
15 C: CurveAffine,
16 L: Loader<C>,
17{
18 type VerifyingKey: Clone + Debug;
20 type Protocol: Clone + Debug;
22 type Proof: Clone + Debug;
24 type Output: Clone + Debug;
26
27 fn read_proof<T>(
29 vk: &Self::VerifyingKey,
30 protocol: &Self::Protocol,
31 instances: &[Vec<L::LoadedScalar>],
32 transcript: &mut T,
33 ) -> Result<Self::Proof, Error>
34 where
35 T: TranscriptRead<C, L>;
36
37 fn verify(
39 vk: &Self::VerifyingKey,
40 protocol: &Self::Protocol,
41 instances: &[Vec<L::LoadedScalar>],
42 proof: &Self::Proof,
43 ) -> Result<Self::Output, Error>;
44}