nx_p384_point.nx
buildroot/runtime/nx_p384_point.nx
about
nx_p384_point.nx -- NIST P-384 elliptic curve point operations.
Curve: y^2 = x^3 - 3x + b mod p (same form as P-256, just larger
field). Stored in Jacobian (X, Y, Z) coordinates.
Mirrors nx_p256_point.nx 1:1. Doubling formula is unchanged
(a = -3 special form valid for both NIST P-256 and P-384).
API:
struct P384Point { x: *i64, y: *i64, z: *i64 }
p384_point_alloc() -> *P384Point
p384_point_zero(p) set p to canonical infinity (1,1,0)
p384_point_is_infinity(p) -> 0|1 (Z == 0)
p384_point_copy(dst, src)
p384_point_set_affine(p, x, y)
p384_point_load_b(out) curve constant b
p384_point_load_g(out_g) base point G (Z=1)
p384_point_on_curve(p) requires p in affine
p384_point_to_affine(p) normalize in place
p384_point_eq(a, b) affine-equality test
p384_point_double(out, in_pt) Jacobian doubling
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/nist/fips_186_5
lineage_id: nishi_p384_point_q10
dependencies 5 imports · 8 importers
imports: nx_syscalls.nxnx_u384.nxnx_p384_field.nxnx_p384_field_mul_fast.nxnx_p384_field_inv.nx
imported by: nx_ecdsa_p384.nxnx_ecdsa_p384_bisect_test.nxnx_p384_ecdh.nxnx_p384_point_add.nxnx_p384_point_test.nxnx_p384_scalar_mul.nxnx_p384_scalar_mul_gate.nxnx_p384_scalar_mul_test.nx
structs
| 39 | struct P384Point |
consts
| 45 | const NX_P384_POINT_OK: i64 = 1 |
| 46 | const NX_P384_POINT_BAD: i64 = 2 |
| 47 | const NX_P384_POINT_VERDICT_N: i64 = 3 |
functions
| 49 | func nx_p384_point_verdict_is_valid(v: i64) -> i64 |
| 55 | func p384_point_alloc() -> *P384Point |
| 67 | func p384_point_zero(p: *P384Point) -> i64 |
| 74 | func p384_point_is_infinity(p: *P384Point) -> i64 |
| 78 | func p384_point_copy(dst: *P384Point, src: *P384Point) -> i64 called by 6: mainp384_point_eqp384_point_addp384_scalar_mul_dbladdp384_scalar_mulmain calls 1: u384_copy |
| 85 | func p384_point_set_affine(p: *P384Point, x: *i64, y: *i64) -> i64 |
| 96 | func p384_point_load_b(out: *i64) -> i64 called by 1: p384_point_on_curve |
| 117 | func p384_point_load_g(out_g: *P384Point) -> i64 |
| 150 | func p384_point_on_curve(p: *P384Point) -> i64 |
| 178 | func p384_point_to_affine(p: *P384Point) -> i64 |
| 195 | func p384_point_eq(a: *P384Point, b: *P384Point) -> i64 |
| 224 | func p384_point_double(out: *P384Point, in_pt: *P384Point) -> i64 |
| 288 | func main() -> i64 |