code wiki / bin / nx_p256_modn_mont_test.nx

nx_p256_modn_mont_test.nx

buildroot/runtime/bin/nx_p256_modn_mont_test.nx

2501 B81 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_modn_mont_test.nx -- oracle test for the Montgomery fast p256_modn_inv vs the slow Fermat reference, plus the a*a^-1 == 1 identity. Run on the NAS (x86_64). Expect: all PASS, 0 mismatches.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_p256_modn.nx nx_p256_modn_mont_test.nx

imports: nx_syscalls.nxnx_csprng.nxnx_p256_modn.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ p256_modn_one u256_one u256_zero check_one u256_alloc ↻ p256_modn_inv nx_scratch_save nx_scratch_init ↻ u256_alloc ↻ p256_modn_load_n_minus_2 p256_modn_load_R2 p256_modn_one ↻ p256_modn_mul_mont nx_scratch_save ↻ u256_alloc ↻ p256_modn_load_n u256_wide_alloc nx_scratch ↻ u256_mul_wide nx_scratch ↻ u256_sub_with_borrow u256_cmp u256_copy nx_scratch_restore p256_modn_bit_at nx_scratch_restore ↻ p256_modn_inv_slow nx_scratch_save ↻ u256_alloc ↻ p256_modn_load_n_minus_2 ↻

structs

none

consts

none

functions

8func t_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 { n = n + 1 } return n }
called by 1: t_print_num
10func t_print_num(label: *u8, v: i64) -> i64
called by 1: main calls 3: sys_writet_strlensys_mmap
29func rand_scalar(k: *i64) -> i64
38func check_one(k: *i64, mismatch_box: *i64, identity_fail_box: *i64) -> i64
53func main() -> i64