diff --git a/src/constraints.rs b/src/constraints.rs new file mode 100644 index 0000000..8116548 --- /dev/null +++ b/src/constraints.rs @@ -0,0 +1,22 @@ +use ark_r1cs_std::prelude::*; +use ark_relations::r1cs::SynthesisError; + +use crate::BlindSignatureScheme; +use ark_ff::PrimeField; +use arkworks_r1cs_gadgets::poseidon::PoseidonGadget; + +pub trait BlindSigVerifyGadget { + type ParametersVar: AllocVar + Clone; + type PublicKeyVar: AllocVar + Clone; + type SignatureVar: AllocVar + Clone; + type Msg; + type MsgVar: AllocVar + Clone; + + fn verify( + parameters: &Self::ParametersVar, + poseidon_hash: &PoseidonGadget, + m: &Self::MsgVar, + s: &Self::SignatureVar, + q: &Self::PublicKeyVar, + ) -> Result, SynthesisError>; +} diff --git a/src/lib.rs b/src/lib.rs index 073a8ba..5a7d97d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,8 @@ use ark_std::rand::Rng; +// #[cfg(feature="r1cs")] +pub mod constraints; + pub mod mala_nezhadansari; pub mod schnorr_blind; @@ -14,6 +17,7 @@ pub trait BlindSignatureScheme { type PointAffine; type SecretKey; type PublicKey; + // type Msg; type BlindedSignature; type Signature; type UserSecretData;