mirror of
https://github.com/arnaucube/ark-ec-blind-signatures.git
synced 2026-01-12 00:21:29 +01:00
Add BlindSigVerifyGadget R1CS constraints trait
This commit is contained in:
22
src/constraints.rs
Normal file
22
src/constraints.rs
Normal file
@@ -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>;
|
||||||
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
use ark_std::rand::Rng;
|
use ark_std::rand::Rng;
|
||||||
|
|
||||||
|
// #[cfg(feature="r1cs")]
|
||||||
|
pub mod constraints;
|
||||||
|
|
||||||
pub mod mala_nezhadansari;
|
pub mod mala_nezhadansari;
|
||||||
pub mod schnorr_blind;
|
pub mod schnorr_blind;
|
||||||
|
|
||||||
@@ -14,6 +17,7 @@ pub trait BlindSignatureScheme {
|
|||||||
type PointAffine;
|
type PointAffine;
|
||||||
type SecretKey;
|
type SecretKey;
|
||||||
type PublicKey;
|
type PublicKey;
|
||||||
|
// type Msg;
|
||||||
type BlindedSignature;
|
type BlindedSignature;
|
||||||
type Signature;
|
type Signature;
|
||||||
type UserSecretData;
|
type UserSecretData;
|
||||||
|
|||||||
Reference in New Issue
Block a user