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.

46 lines
1.6 KiB

4 years ago
4 years ago
4 years ago
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 the MNT4_298 curve generated by
  11. //! [\[BCTV14\]](https://eprint.iacr.org/2014/595). The name denotes that it is a
  12. //! Miyaji--Nakabayashi--Takano curve of embedding degree 4, defined over a
  13. //! 298-bit (prime) field. The main feature of this curve is that its scalar
  14. //! field and base field respectively equal the base field and scalar field of
  15. //! MNT6_298.
  16. //!
  17. //!
  18. //! Curve information:
  19. //! * Base field: q =
  20. //! 475922286169261325753349249653048451545124879242694725395555128576210262817955800483758081
  21. //! * Scalar field: r =
  22. //! 475922286169261325753349249653048451545124878552823515553267735739164647307408490559963137
  23. //! * valuation(q - 1, 2) = 17
  24. //! * valuation(r - 1, 2) = 34
  25. //! * G1 curve equation: y^2 = x^3 + ax + b, where
  26. //! * a = 2
  27. //! * b = 423894536526684178289416011533888240029318103673896002803341544124054745019340795360841685
  28. //! * G2 curve equation: y^2 = x^3 + Ax + B, where
  29. //! * A = Fq2 = (a * NON_RESIDUE, 0)
  30. //! * B = Fq2(0, b * NON_RESIDUE)
  31. //! * NON_RESIDUE = 17 is the quadratic non-residue used for constructing the
  32. //! extension field Fq2
  33. #[cfg(feature = "curve")]
  34. mod curves;
  35. #[cfg(any(feature = "scalar_field", feature = "base_field"))]
  36. mod fields;
  37. #[cfg(feature = "r1cs")]
  38. pub mod constraints;
  39. #[cfg(feature = "curve")]
  40. pub use curves::*;
  41. #[cfg(any(feature = "scalar_field", feature = "base_field"))]
  42. pub use fields::*;