nx_p256_field_mul_test.nx
buildroot/runtime/nx_p256_field_mul_test.nx
about
nx_p256_field_mul_test.nx -- KAT for P-256 field multiplication.
Verifies:
- 0 * 0 = 0
- 0 * a = 0
- 1 * a = a (identity)
- 2 * 3 = 6 (small)
- 2 * (p+1)/2 = 1 (where (p+1)/2 is the modular inverse of 2)
- (p-1) * (p-1) = 1 (since -1 * -1 = 1 mod p)
- (p-1) * 2 = p-2 (no boundary cross)
- 2 * 2^255 = 2^256 = (p + 2^224 - 2^192 - 2^96 + 1) mod p =
2^224 - 2^192 - 2^96 + 1
- associativity spot-check: (a*b)*c == a*(b*c) for 3 values
- commutativity: a*b == b*a
- distributivity: a*(b+c) == a*b + a*c
- sq matches mul-with-self
expect_exit: 0
license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_u256.nxnx_p256_field.nxnx_p256_field_mul.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 26 | func main() -> i64 |