ark-ec-blind-signatures/src/constraints.rs
src/constraints.rsRaw
1use ark_r1cs_std::prelude::*;
2use ark_relations::r1cs::SynthesisError;
3
4use crate::BlindSignatureScheme;
5use ark_ff::PrimeField;
6use arkworks_r1cs_gadgets::poseidon::PoseidonGadget;
7
8pub trait BlindSigVerifyGadget<S: BlindSignatureScheme, ConstraintF: PrimeField> {
9 type ParametersVar: AllocVar<S::Parameters, ConstraintF> + Clone;
10 type PublicKeyVar: AllocVar<S::PublicKey, ConstraintF> + Clone;
11 type SignatureVar: AllocVar<S::Signature, ConstraintF> + Clone;
12 type Msg;
13 type MsgVar: AllocVar<Self::Msg, ConstraintF> + Clone;
14
15 fn verify(
16 parameters: &Self::ParametersVar,
17 poseidon_hash: &PoseidonGadget<ConstraintF>,
18 m: &Self::MsgVar,
19 s: &Self::SignatureVar,
20 q: &Self::PublicKeyVar,
21 ) -> Result<Boolean<ConstraintF>, SynthesisError>;
22}