1#[macro_use]
8mod macros;
9
10pub(crate) mod field;
11#[cfg(feature = "hash2curve")]
12mod hash2curve;
13pub(crate) mod scalar;
14
15use self::{field::FieldElement, scalar::Scalar};
16use crate::NistP384;
17use elliptic_curve::{CurveArithmetic, PrimeCurveArithmetic};
18use primeorder::{point_arithmetic, PrimeCurveParams};
19
20pub type AffinePoint = primeorder::AffinePoint<NistP384>;
22
23pub type ProjectivePoint = primeorder::ProjectivePoint<NistP384>;
25
26impl CurveArithmetic for NistP384 {
27 type AffinePoint = AffinePoint;
28 type ProjectivePoint = ProjectivePoint;
29 type Scalar = Scalar;
30}
31
32impl PrimeCurveArithmetic for NistP384 {
33 type CurveGroup = ProjectivePoint;
34}
35
36impl PrimeCurveParams for NistP384 {
40 type FieldElement = FieldElement;
41 type PointArithmetic = point_arithmetic::EquationAIsMinusThree;
42
43 const EQUATION_A: FieldElement = FieldElement::from_u64(3).neg();
45
46 const EQUATION_B: FieldElement = FieldElement::from_hex("b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef");
49
50 const GENERATOR: (FieldElement, FieldElement) = (
61 FieldElement::from_hex("aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),
62 FieldElement::from_hex("3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),
63 );
64}