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>
11        + EqGadget<ConstraintF>
12        + AllocGadget<S::PublicKey, ConstraintF>
13        + Clone;
14
15    fn check_randomization_gadget<CS: ConstraintSystem<ConstraintF>>(
16        cs: CS,
17        parameters: &Self::ParametersGadget,
18        public_key: &Self::PublicKeyGadget,
19        randomness: &[UInt8],
20    ) -> Result<Self::PublicKeyGadget, SynthesisError>;
21}