types.rs 765 B

12345678910111213141516171819202122232425262728
  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 crate::crypto::{constants::OrchardFixedBases, util::mod_r_p};
  6. pub type DrkCircuitField = pasta::Fp;
  7. pub type DrkTokenId = pasta::Fp;
  8. pub type DrkSerial = pasta::Fp;
  9. pub type DrkCoin = pasta::Fp;
  10. pub type DrkCoinBlind = pasta::Fp;
  11. pub type DrkNullifier = pasta::Fp;
  12. pub type DrkValue = pasta::Fp;
  13. pub type DrkScalar = pasta::Fq;
  14. pub type DrkValueBlind = pasta::Fq;
  15. pub type DrkValueCommit = pasta::Ep;
  16. pub type DrkPublicKey = pasta::Ep;
  17. pub type DrkSecretKey = pasta::Fp;
  18. pub fn derive_public_key(s: DrkSecretKey) -> DrkPublicKey {
  19. OrchardFixedBases::SpendAuthG.generator() * mod_r_p(s)
  20. }