nx_rsa_pss_sha256.nx
buildroot/runtime/nx_rsa_pss_sha256.nx
about
nx_rsa_pss_sha256.nx -- RSASSA-PSS signature VERIFY with SHA-256 (MGF1-SHA-256, salt_len=32), RSA-2048.
This is rsa_pss_rsae_sha256 (TLS SignatureScheme 0x0804) -- the scheme TLS 1.3 MANDATES for RSA-cert servers'
CertificateVerify (rsa_pkcs1 is NOT allowed for CV). Without it we fail-closed on EVERY RSA-cert TLS-1.3 server
(e.g. i.nhentai.net's Cloudflare edge). COMPOSED (Cardinals 15/22): reuses the SAME RSA modexp
(rsa2048_mod_exp_mont) + u2048 bignum + sha256_digest as the PKCS#1 verifier; only the EMSA-PSS-VERIFY padding
check (RFC 8017 sec 9.1.2) is new. license_tier: INDEPENDENT_REDERIVE genealogy: ietf/rfc_8017 sec_9_1_2
dependencies 5 imports · 2 importers
imports: nx_syscalls.nxnx_sha256.nxnx_u2048.nxnx_rsa2048_mod_exp.nxnx_rsa2048_mont.nx
imported by: nx_rsa_pss_sha256_gate.nxnx_tls13_client_verify_cv.nx
structs
| none |
consts
| 13 | const NX_RSA_PSS_OK: i64 = 1 |
| 14 | const NX_RSA_PSS_S_OUT_OF_RANGE:i64 = 2 |
| 15 | const NX_RSA_PSS_BAD_PAD: i64 = 3 // EM structure / trailer / masked-bits / DB prefix wrong |
| 16 | const NX_RSA_PSS_HASH_MISMATCH: i64 = 4 // H != H' (the possession proof fails) |
| 17 | const NX_RSA_PSS_VERDICT_N: i64 = 5 |
functions
| 19 | func rsa_pss_verdict_is_valid(v: i64) -> i64 { if v < NX_RSA_PSS_OK { return 0 } if v >= NX_RSA_PSS_VERDICT_N { return 0 } return 1 } |
| 22 | func mgf1_sha256(seed: *u8, seed_len: i64, mask: *u8, mask_len: i64) -> i64 |
| 46 | func rsa_pss_sha256_verify(msg: *u8, msg_len: i64, sig_bytes: *u8, n_2048: *i64, e_i64: i64) -> i64 |