nx_u4096_mul.nx
buildroot/runtime/nx_u4096_mul.nx
about
nx_u4096_mul.nx -- 4096x4096 -> 8192-bit schoolbook multiplication
+ wide-buffer helpers. Mirrors nx_u2048_mul on 256-limb wide buffers.
Foundation for nx_rsa4096_mod (which Barrett-reduces against the
ISRG Root X1 4096-bit modulus).
API:
u4096_wide_alloc() -> *i64 256-limb buffer (zeroed)
u4096_mul_wide(out_256, a, b) -- out = a * b (no reduction)
u4096_wide_shl1(out_256) -- in-place left shift by 1 bit
u4096_wide_get_bit(a_256, bit) -- bit 0..8191
u4096_wide_sub_low(out_256, sub_128) -- out[0..128) -= sub
u4096_wide_low_cmp(a_256, n_128) -- cmp low 128 limbs
u4096_wide_copy_low(out_128, src_256)
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_8017
lineage_id: nishi_u4096_mul_q1
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_u4096.nx
imported by: nx_rsa4096_mod.nxnx_rsa4096_mod_exp.nxnx_rsa4096_mod_test.nxnx_u4096_mul_test.nx
structs
| none |
consts
| 28 | const NX_U4096_WIDE_LIMBS: i64 = 256 |
| 29 | const NX_U4096_WIDE_BYTES: i64 = 1024 |
functions
| 31 | func u4096_wide_alloc() -> *i64 |
| 44 | func u4096_mul_wide(out_256: *i64, a: *i64, b: *i64) -> i64 |
| 71 | func u4096_wide_shl1(out_256: *i64) -> i64 called by 1: main |
| 85 | func u4096_wide_get_bit(a_256: *i64, bit: i64) -> i64 |
| 93 | func u4096_wide_sub_low(out_256: *i64, sub: *i64) -> i64 called by 1: main |
| 113 | func u4096_wide_low_cmp(a_256: *i64, n: *i64) -> i64 called by 1: main |
| 125 | func u4096_wide_copy_low(out_128: *i64, src_256: *i64) -> i64 called by 1: main |
| 134 | func main() -> i64 |