pub(crate) mod field;
pub(crate) mod scalar;
pub use self::scalar::Scalar;
use self::field::FieldElement;
use crate::NistP224;
use elliptic_curve::{CurveArithmetic, PrimeCurveArithmetic};
use primeorder::{point_arithmetic, PrimeCurveParams};
pub type AffinePoint = primeorder::AffinePoint<NistP224>;
pub type ProjectivePoint = primeorder::ProjectivePoint<NistP224>;
impl CurveArithmetic for NistP224 {
type AffinePoint = AffinePoint;
type ProjectivePoint = ProjectivePoint;
type Scalar = Scalar;
}
impl PrimeCurveArithmetic for NistP224 {
type CurveGroup = ProjectivePoint;
}
impl PrimeCurveParams for NistP224 {
type FieldElement = FieldElement;
type PointArithmetic = point_arithmetic::EquationAIsMinusThree;
const EQUATION_A: FieldElement = FieldElement::from_u64(3).neg();
#[cfg(target_pointer_width = "32")]
const EQUATION_B: FieldElement =
FieldElement::from_hex("b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4");
#[cfg(target_pointer_width = "64")]
const EQUATION_B: FieldElement =
FieldElement::from_hex("00000000b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4");
#[cfg(target_pointer_width = "32")]
const GENERATOR: (FieldElement, FieldElement) = (
FieldElement::from_hex("b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21"),
FieldElement::from_hex("bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"),
);
#[cfg(target_pointer_width = "64")]
const GENERATOR: (FieldElement, FieldElement) = (
FieldElement::from_hex("00000000b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21"),
FieldElement::from_hex("00000000bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"),
);
}