types.rs 608 B

123456789101112131415161718192021
  1. //! Type aliases used in the codebase.
  2. // Helpful for changing the curve and crypto we're using.
  3. use halo2_gadgets::ecc::FixedPoints;
  4. use pasta_curves as pasta;
  5. use super::{constants::OrchardFixedBases, util::mod_r_p};
  6. pub type DrkTokenId = pasta::Fp;
  7. pub type DrkSerial = pasta::Fp;
  8. pub type DrkCoinBlind = pasta::Fp;
  9. pub type DrkValueBlind = pasta::Fq;
  10. pub type DrkValueCommit = pasta::Ep;
  11. pub type DrkPublicKey = pasta::Ep;
  12. pub type DrkSecretKey = pasta::Fp;
  13. pub fn derive_publickey(s: DrkSecretKey) -> DrkPublicKey {
  14. let skrt = mod_r_p(s);
  15. OrchardFixedBases::SpendAuthG.generator() * skrt
  16. }