arnaucube
arnaucube/ark-ec-blind-signaturesPublic Self-hosted repository
Add BlindSigVerifyGadget R1CS constraints trait
arnaucube root@arnaucube.com
Wed, 04 Jan 2023 10:47:48 +0100
commit

cf682c2d95d69782690ffc2d84454409cd0c9178

parent

7a5ba6f56a307dd3e0013564dd32b2eebdcc7c85

2 files changed, 26 insertions(+), 0 deletions(-)

jump to
A 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<S: BlindSignatureScheme, ConstraintF: PrimeField> { + type ParametersVar: AllocVar<S::Parameters, ConstraintF> + Clone; + type PublicKeyVar: AllocVar<S::PublicKey, ConstraintF> + Clone; + type SignatureVar: AllocVar<S::Signature, ConstraintF> + Clone; + type Msg; + type MsgVar: AllocVar<Self::Msg, ConstraintF> + Clone; + + fn verify( + parameters: &Self::ParametersVar, + poseidon_hash: &PoseidonGadget<ConstraintF>, + m: &Self::MsgVar, + s: &Self::SignatureVar, + q: &Self::PublicKeyVar, + ) -> Result<Boolean<ConstraintF>, SynthesisError>; +}
M src/lib.rs → 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 @@ type ConstraintF: PrimeField;

type PointAffine; type SecretKey; type PublicKey; + // type Msg; type BlindedSignature; type Signature; type UserSecretData;