arnaucube
arnaucube/ark-r1cs-stdPublic Self-hosted repository
ark-r1cs-std/crypto-primitives/src/signature/constraints.rs
crypto-primitives/src/signature/constraints.rsRaw
 1use algebra::Field;
 2use r1cs_core::{ConstraintSystem, SynthesisError};
 3use r1cs_std::prelude::*;
 4
 5use crate::signature::SignatureScheme;
 6
 7pub trait SigRandomizePkGadget<S: SignatureScheme, ConstraintF: Field> {
 8    type ParametersGadget: AllocGadget<S::Parameters, ConstraintF> + Clone;
 9
10    type PublicKeyGadget: ToBytesGadget<ConstraintF> + EqGadget<ConstraintF> + AllocGadget<S::PublicKey, ConstraintF> + Clone;
11
12    fn check_randomization_gadget<CS: ConstraintSystem<ConstraintF>>(
13        cs: CS,
14        parameters: &Self::ParametersGadget,
15        public_key: &Self::PublicKeyGadget,
16        randomness: &[UInt8],
17    ) -> Result<Self::PublicKeyGadget, SynthesisError>;
18}