code wiki / (root) / nx_u4096_mul_test.nx

nx_u4096_mul_test.nx

buildroot/runtime/nx_u4096_mul_test.nx

7191 B204 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic u4096
docsdependenciesstructsconstsfunctions

about

nx_u4096_mul_test.nx -- KAT for the 4096x4096 -> 8192 wide-multiply. Mirrors nx_u256_mul_test cases, scaled to 256-limb wide buffer. All five algebraic-identity cases that prove a schoolbook multiplier is correct: - 0 * 0 = 0 - 1 * 1 = 1 - 3 * 5 = 15 (small * small) - 0xFFFFFFFF * 0xFFFFFFFF = 0xFFFFFFFE00000001 (well-known limb-saturation square, exercises carry from limb 0 to limb 1) - 2^32 * 2^32 = 2^64 (single-bit cross-limb) - 2^4096 - 1 squared (exercises full 256-limb wide range; high limb 255 must be non-zero, exercising last carry-out) - shl1 round-trip on wide buffer expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_u4096.nx nx_u4096_mul.nx nx_u4096_mul_test.nx

imports: nx_syscalls.nxnx_u4096.nxnx_u4096_mul.nx

imported by: nobody (leaf or entry point)

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

main u4096_alloc sys_mmap u4096_wide_alloc sys_mmap ↻ u4096_zero u4096_mul_wide u4096_one u4096_zero ↻ u4096_wide_shl1 u4096_wide_get_bit u4096_wide_low_cmp u4096_wide_sub_low u4096_wide_copy_low sys_mmap ↻ sys_write

structs

none

consts

none

functions

23func main() -> i64