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.

31 lines
1.1 KiB

4 years ago
4 years ago
  1. #![cfg_attr(not(feature = "std"), no_std)]
  2. #![deny(
  3. warnings,
  4. unused,
  5. future_incompatible,
  6. nonstandard_style,
  7. rust_2018_idioms
  8. )]
  9. #![forbid(unsafe_code)]
  10. //! This library implements a twisted Edwards curve whose base field is the scalar field of the
  11. //! curve BN254. This allows defining cryptographic primitives that use elliptic curves over
  12. //! the scalar field of the latter curve. This curve is also known as [Baby-Jubjub](https://github.com/barryWhiteHat/baby_jubjub).
  13. //!
  14. //! Curve information:
  15. //! * Base field: q = 21888242871839275222246405745257275088548364400416034343698204186575808495617
  16. //! * Scalar field: r = 2736030358979909402780800718157159386076813972158567259200215660948447373041
  17. //! * Valuation(q - 1, 2) = 28
  18. //! * Valuation(r - 1, 2) = 4
  19. //! * Curve equation: ax^2 + y^2 =1 + dx^2y^2, where
  20. //! * a = 1
  21. //! * d = 168696/168700 mod q
  22. //! = 9706598848417545097372247223557719406784115219466060233080913168975159366771
  23. #[cfg(feature = "r1cs")]
  24. pub mod constraints;
  25. mod curves;
  26. mod fields;
  27. pub use curves::*;
  28. pub use fields::*;