You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
703 B

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