nx_rsa4096_mod_exp.nx
buildroot/runtime/nx_rsa4096_mod_exp.nx
about
nx_rsa4096_mod_exp.nx -- RSA mod-exp s^e mod n for 4096-bit modulus.
Mirrors nx_rsa2048_mod_exp scaled to u4096. For RSA-PKCS#1 v1.5
signature verification, the public exponent e is small (commonly
65537 = 2^16 + 1). Square-and-multiply MSB-first over bits of e.
API:
rsa4096_mod_exp(out, s, e: i64, n) -- out = s^e mod n
Caller responsibilities:
- s < n (range-checked here; returns nonzero verdict if s >= n)
- n is 4096-bit with top bit set
- e fits in i64 (true for all Web PKI: e is either 3, 17, 65537)
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_8017
lineage_id: nishi_rsa4096_mod_exp_q1
dependencies 4 imports · 6 importers
imports: nx_syscalls.nxnx_u4096.nxnx_u4096_mul.nxnx_rsa4096_mod.nx
imported by: nx_rsa4096_mod_test.nxnx_rsa4096_mont_gate.nxnx_rsa_pkcs1_v1_5_k.nxnx_rsa_pkcs1_v1_5_sha256_4096.nxnx_rsa_pkcs1_v1_5_sha384.nxnx_rsa_pkcs1_v1_5_sha512.nx
structs
| none |
consts
| 24 | const NX_RSA4096_MOD_EXP_OK: i64 = 1 |
| 25 | const NX_RSA4096_MOD_EXP_S_OUT_OF_RANGE: i64 = 2 |
functions
| 28 | func rsa4096_highbit_i64(e: i64) -> i64 called by 1: rsa4096_mod_exp |
| 39 | func rsa4096_mod_exp(out: *i64, s: *i64, e: i64, n: *i64) -> i64 |
| 68 | func main() -> i64 |