nx_p384_field.nx
buildroot/runtime/nx_p384_field.nx
about
nx_p384_field.nx -- NIST P-384 field arithmetic mod p.
p = 2^384 - 2^128 - 2^96 + 2^32 - 1 (FIPS 186-5 D.1.2.4)
= 0xffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
ffffffff fffffffe ffffffff 00000000 00000000 ffffffff
Mirrors nx_p256_field.nx structure on the 12-limb u384 layout.
Provides add / sub / neg mod p, plus shipped u384 wrappers under
the field name. Mul + invert ship separately as
nx_p384_field_mul + nx_p384_field_inv (matching the P-256 split).
API:
p384_field_load_p(out)
p384_field_zero/one/copy/eq (wrappers over u384_*)
p384_field_add(r, a, b) r = (a + b) mod p
p384_field_sub(r, a, b) r = (a - b) mod p
p384_field_neg(r, a) r = (-a) mod p
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/nist/fips_186_5
lineage_id: nishi_p384_field_q10
dependencies 2 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: nx_syscalls.nxnx_u384.nx
imported by: nx_ecdsa_p384_bisect_test.nxnx_p384_ecdh.nxnx_p384_field_inv.nxnx_p384_field_inv_test.nxnx_p384_field_mul.nxnx_p384_field_mul_fast.nxnx_p384_field_mul_fast_gate.nxnx_p384_field_mul_test.nxnx_p384_field_test.nxnx_p384_point.nxnx_p384_point_add.nxnx_p384_point_test.nxnx_p384_scalar_mul.nx
structs
| none |
consts
| 32 | const NX_P384_FIELD_OK: i64 = 1 |
| 33 | const NX_P384_FIELD_BAD: i64 = 2 |
| 34 | const NX_P384_FIELD_VERDICT_N: i64 = 3 |
functions
| 36 | func nx_p384_field_verdict_is_valid(v: i64) -> i64 |
| 52 | func p384_field_load_p(out: *i64) -> i64 |
| 69 | func p384_field_zero(out: *i64) -> i64 { return u384_zero(out) } |
| 70 | func p384_field_one(out: *i64) -> i64 { return u384_one(out) } |
| 71 | func p384_field_copy(out: *i64, src: *i64) -> i64 { return u384_copy(out, src) } calls 1: u384_copy |
| 72 | func p384_field_eq(a: *i64, b: *i64) -> i64 { return u384_eq(a, b) } |
| 79 | func p384_field_add(r: *i64, a: *i64, b: *i64) -> i64 |
| 96 | func p384_field_sub(r: *i64, a: *i64, b: *i64) -> i64 |
| 107 | func p384_field_neg(r: *i64, a: *i64) -> i64 |
| 118 | func main() -> i64 |