1pub(crate) mod field;
8#[cfg(feature = "hash2curve")]
9mod hash2curve;
10pub(crate) mod scalar;
11mod util;
12
13pub use self::scalar::Scalar;
14
15use self::field::FieldElement;
16use crate::NistP521;
17use elliptic_curve::{CurveArithmetic, PrimeCurveArithmetic};
18use primeorder::{point_arithmetic, PrimeCurveParams};
19
20pub type AffinePoint = primeorder::AffinePoint<NistP521>;
22
23pub type ProjectivePoint = primeorder::ProjectivePoint<NistP521>;
25
26impl CurveArithmetic for NistP521 {
27    type AffinePoint = AffinePoint;
28    type ProjectivePoint = ProjectivePoint;
29    type Scalar = Scalar;
30}
31
32impl PrimeCurveArithmetic for NistP521 {
33    type CurveGroup = ProjectivePoint;
34}
35
36impl PrimeCurveParams for NistP521 {
40    type FieldElement = FieldElement;
41    type PointArithmetic = point_arithmetic::EquationAIsMinusThree;
42
43    const EQUATION_A: FieldElement = FieldElement::from_u64(3).neg();
47
48    const EQUATION_B: FieldElement =
52        FieldElement::from_hex("0000000000000051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00");
53
54    const GENERATOR: (FieldElement, FieldElement) = (
65        FieldElement::from_hex("00000000000000c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),
66        FieldElement::from_hex("000000000000011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),
67    );
68}