code wiki / (root) / nx_ed25519_scalar_test.nx

nx_ed25519_scalar_test.nx

buildroot/runtime/nx_ed25519_scalar_test.nx

4734 B153 linesdepth 8pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic ed25519
docsdependenciesstructsconstsfunctions

about

nx_ed25519_scalar_test.nx -- KAT for scalar reduction + mul. Verifies: sc_reduce side: A. sc_reduce(0^64) == 0^32 B. sc_reduce(L padded to 64) == 0^32 C. sc_reduce(L+1 padded to 64) == 1 (01 00 ... 00) D. sc_reduce(L-1 padded to 64) == L-1 (byte-exact) E. sc_reduce(2*L padded to 64) == 0 scalar mul side: F. [0]B == identity G. [1]B == B (byte-exact compressed) H. [2]B == double(B) I. [3]B == B + B + B Note: skipping [L]B == identity for this turn -- it requires 252 doublings + ~125 adds and exercises bit patterns most prone to off-by-one. It will land as part of Piece 4's verify KAT (which actually computes [s]B for non-trivial s). expect_exit: 0 license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_x25519.nx nx_ed25519_field.nx nx_ed25519_point.nx nx_ed25519_arith.nx nx_ed25519_scalar.nx nx_ed25519_scalar_test.nx

imports: nx_syscalls.nxnx_x25519.nxnx_ed25519_field.nxnx_ed25519_point.nxnx_ed25519_arith.nxnx_ed25519_scalar.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 sc_reduce sys_mmap ↻ sc_ge_l sys_mmap ↻ sc_l_limbs sc_sub_l sys_mmap ↻ sc_l_limbs ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ fe_zero ge_p3_decompress sys_mmap ↻ fe_from_bytes fe_alloc ↻ fe_sq fe_mul fe_one fe_zero ↻ fe_sub ed25519_d_fe sys_mmap ↻ ed25519_d_bytes fe_from_bytes ↻ fe_mul ↻ fe_add fe_pow22523 fe_alloc ↻ fe_sq ↻ fe_mul ↻

structs

none

consts

none

functions

32func main() -> i64