1#![no_std]
5extern crate alloc;
6
7use elliptic_curve::{
8 bigint::U256, consts::U32, point::PointCompression, Curve, CurveArithmetic, PrimeCurve,
9};
10
11mod coord;
12mod internal;
13mod point;
14mod scalar;
15
16#[cfg(feature = "ecdsa-core")]
17pub mod ecdsa;
18
19pub use internal::{P256Coord, P256Point, P256Scalar};
21
22#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, PartialOrd, Ord)]
24pub struct NistP256;
25
26const ORDER_HEX: &str = "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551";
30
31const ORDER: U256 = U256::from_be_hex(ORDER_HEX);
33
34impl Curve for NistP256 {
35 type FieldBytesSize = U32;
37
38 type Uint = U256;
40
41 const ORDER: U256 = ORDER;
43}
44
45impl PrimeCurve for NistP256 {}
46
47impl CurveArithmetic for NistP256 {
48 type AffinePoint = P256Point;
49 type ProjectivePoint = P256Point;
51 type Scalar = P256Scalar;
52}
53
54impl PointCompression for NistP256 {
55 const COMPRESS_POINTS: bool = false;
57}
58
59pub type EncodedPoint = elliptic_curve::sec1::EncodedPoint<NistP256>;