pub(crate) mod field;
pub(crate) mod scalar;
pub use self::scalar::Scalar;
pub use self::field::FieldElement;
use crate::BignP256;
pub use elliptic_curve::{CurveArithmetic, PrimeCurveArithmetic};
pub use primeorder::{PrimeCurveParams, point_arithmetic};
pub type AffinePoint = primeorder::AffinePoint<BignP256>;
pub type ProjectivePoint = primeorder::ProjectivePoint<BignP256>;
impl CurveArithmetic for BignP256 {
type AffinePoint = AffinePoint;
type ProjectivePoint = ProjectivePoint;
type Scalar = Scalar;
}
impl PrimeCurveArithmetic for BignP256 {
type CurveGroup = ProjectivePoint;
}
impl PrimeCurveParams for BignP256 {
type FieldElement = FieldElement;
type PointArithmetic = point_arithmetic::EquationAIsGeneric;
const EQUATION_A: Self::FieldElement = FieldElement::from_hex_vartime(
"40FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
);
const EQUATION_B: Self::FieldElement = FieldElement::from_hex_vartime(
"F1039CD66B7D2EB253928B976950F54CBEFBD8E4AB3AC1D2EDA8F315156CCE77",
);
const GENERATOR: (Self::FieldElement, Self::FieldElement) = (
FieldElement::ZERO,
FieldElement::from_hex_vartime(
"936A510418CF291E52F608C4663991785D83D651A3C9E45C9FD616FB3CFCF76B",
),
);
}