nx_u4096_mul_test.nx
buildroot/runtime/nx_u4096_mul_test.nx
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
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
structs
| none |
consts
| none |
functions
| 23 | func main() -> i64 |