code wiki / (root) / nx_p256_field_test.nx

nx_p256_field_test.nx

buildroot/runtime/nx_p256_field_test.nx

5928 B179 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_field_test.nx -- KAT for P-256 prime field add/sub/neg. Verifies modular arithmetic correctness using: - 0 + 0, 1 + 1, p-1 + 1 (boundary wrap) - p-1 + p-1 = p-2 (general wrap) - p-1 - p-1 = 0 - 0 - 1 = p-1 (underflow + add-p) - -0 = 0 - -1 = p-1 - -(p-1) = 1 - -(-a) = a (involutive) - a + (-a) = 0 (definition) - load_p produces the correct byte sequence expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_u256.nx nx_p256_field.nx nx_p256_field_test.nx

imports: nx_syscalls.nxnx_u256.nxnx_p256_field.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main u256_alloc nx_scratch nx_scratch_init sys_mmap nx_scratch_oom sys_write sys_exit sys_mmap ↻ p256_field_load_p sys_mmap ↻ u256_store_be p256_field_zero u256_zero p256_field_add nx_scratch_save nx_scratch_init ↻ u256_alloc ↻ p256_field_load_p ↻ u256_add_with_carry u256_sub_with_borrow u256_copy nx_scratch_restore u256_is_zero p256_field_one u256_one u256_zero ↻ u256_copy ↻ u256_zero ↻ p256_field_sub nx_scratch_save ↻ u256_alloc ↻ p256_field_load_p ↻ u256_sub_with_borrow ↻ u256_add_with_carry ↻ nx_scratch_restore ↻ u256_cmp p256_field_eq u256_eq p256_field_neg

structs

none

consts

none

functions

22func main() -> i64