types.rs 835 B

1234567891011121314151617181920212223242526272829
  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::pallas;
  5. use crate::crypto::{constants::OrchardFixedBases, util::mod_r_p};
  6. pub type DrkCircuitField = pallas::Base;
  7. pub type DrkTokenId = pallas::Base;
  8. pub type DrkSerial = pallas::Base;
  9. pub type DrkCoin = pallas::Base;
  10. pub type DrkCoinBlind = pallas::Base;
  11. pub type DrkNullifier = pallas::Base;
  12. pub type DrkValue = pallas::Base;
  13. pub type DrkScalar = pallas::Scalar;
  14. pub type DrkValueBlind = pallas::Scalar;
  15. pub type DrkValueCommit = pallas::Point;
  16. pub type DrkPublicKey = pallas::Point;
  17. pub type DrkSecretKey = pallas::Base;
  18. // TODO: move this elsewhere
  19. pub fn derive_public_key(s: DrkSecretKey) -> DrkPublicKey {
  20. OrchardFixedBases::NullifierK.generator() * mod_r_p(s)
  21. }