code wiki / (root) / nx_p256_scalar_mul_test.nx

nx_p256_scalar_mul_test.nx

buildroot/runtime/nx_p256_scalar_mul_test.nx

4156 B120 linesdepth 9pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_scalar_mul_test.nx -- KAT for P-256 scalar multiplication. Verifies for small k values: - 0 * G = O - 1 * G = G - 2 * G = double(G) - 3 * G = G + 2G - 4 * G = double(2G) = via scalar_mul(4, G) - 256 * G = 8 doublings of G - aliasing: out aliases p in scalar_mul - 0 * O = O, k * O = O for various k Larger k values are exercised indirectly via the ECDSA verify KAT (queued for piece 4) -- 256-bit scalars take ~2-3s each in the slow form and would push smoke runtime past budget. expect_exit: 0 license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_u256.nx nx_p256_field.nx nx_p256_point.nx nx_p256_point_add.nx nx_p256_scalar_mul.nx nx_p256_scalar_mul_test.nx

imports: nx_syscalls.nxnx_u256.nxnx_p256_field.nxnx_p256_point.nxnx_p256_point_add.nxnx_p256_scalar_mul.nx

imported by: nobody (leaf or entry point)

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

main p256_point_alloc nx_scratch nx_scratch_init sys_mmap nx_scratch_oom sys_write sys_exit sys_mmap ↻ u256_alloc nx_scratch ↻ p256_field_one u256_one u256_zero p256_field_zero u256_zero ↻ p256_point_load_g p256_field_one ↻ p256_point_zero p256_field_one ↻ p256_field_zero ↻ u256_alloc ↻ u256_zero ↻ p256_scalar_mul nx_scratch_save nx_scratch_init ↻ p256_point_alloc ↻ p256_point_copy u256_copy p256_point_zero ↻ p256_point_double p256_point_is_infinity u256_is_zero p256_point_zero ↻ u256_is_zero ↻ nx_scratch_save ↻ u256_alloc ↻ u256_copy ↻ p256_field_sq p256_field_mul

structs

none

consts

none

functions

27func main() -> i64