nx_rsa_pkcs1_v1_5_sha384.nx
buildroot/runtime/nx_rsa_pkcs1_v1_5_sha384.nx
about
nx_rsa_pkcs1_v1_5_sha384.nx -- RSA-PKCS#1 v1.5 signature verify with
SHA-384, for RSA-2048 AND RSA-4096 keys.
Parallel to nx_rsa_pkcs1_v1_5_sha256{,_4096}; sha384WithRSAEncryption
(OID 1.2.840.113549.1.1.12) is extremely common on intermediate/root
certs (Sectigo, USERTrust, DigiCert), so cert-chain validation needs it.
Differs from the SHA-256 variant only in: hash = SHA-384 (48 bytes),
the DigestInfo DER prefix, and PS length. RSA mod-exp is reused.
RFC 8017 ยง8.2.2: s -> m = s^e mod n; EM = 00 01 PS(FF..) 00 T H,
T = SHA-384 DigestInfo prefix (19 bytes):
30 41 30 0d 06 09 60 86 48 01 65 03 04 02 02 05 00 04 30
H = SHA-384(message) (48 bytes).
PS_LEN = 256-3-19-48 = 186 (RSA-2048) / 512-3-19-48 = 442 (RSA-4096).
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_8017 + nist/fips_180_4
lineage_id: nishi_rsa_pkcs1_v1_5_sha384_q1
dependencies 7 imports · 4 importers
imports: nx_syscalls.nxnx_sha512.nxnx_u2048.nxnx_rsa2048_mod_exp.nxnx_rsa2048_mont.nxnx_u4096.nxnx_rsa4096_mod_exp.nx
imported by: nx_rsa_pkcs1_v1_5_k.nxnx_rsa_pkcs1_v1_5_sha384_4096_test.nxnx_rsa_pkcs1_v1_5_sha384_test.nxnx_x509_verify_under_issuer.nx
structs
| none |
consts
| 28 | const NX_RSA_PKCS1_V15_384_OK: i64 = 1 |
| 29 | const NX_RSA_PKCS1_V15_384_S_OUT_OF_RANGE: i64 = 2 |
| 30 | const NX_RSA_PKCS1_V15_384_BAD_PAD: i64 = 3 |
| 31 | const NX_RSA_PKCS1_V15_384_HASH_MISMATCH: i64 = 4 |
| 32 | const NX_RSA_PKCS1_V15_384_VERDICT_N: i64 = 5 |
functions
| 35 | func rsa_pkcs1_sha384_di_byte(i: i64) -> i64 |
| 60 | func _rsa384_check_em(em: *u8, em_len: i64, h: *u8, ps_len: i64) -> i64 called by 2: rsa_pkcs1_v1_5_sha384_verifyrsa_pkcs1_v1_5_sha384_4096_verify calls 1: rsa_pkcs1_sha384_di_byte |
| 86 | func rsa_pkcs1_v1_5_sha384_verify(msg: *u8, msg_len: i64, |
| 102 | func rsa_pkcs1_v1_5_sha384_4096_verify(msg: *u8, msg_len: i64, |
| 117 | func main() -> i64 |