code wiki / (root) / nx_rsa_pkcs1_v1_5_sha384.nx

nx_rsa_pkcs1_v1_5_sha384.nx

buildroot/runtime/nx_rsa_pkcs1_v1_5_sha384.nx

4528 B119 linesdepth 6pulls 14 transitivereach 527 importersview sourcekind tooltopic rsa
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sha512.nx nx_u2048.nx nx_rsa2048_mod_exp.nx nx_rsa2048_mont.nx nx_u4096.nx nx_rsa4096_mod_exp.nx nx_rsa_pkcs1_v1_5_sha384.nx nx_rsa_pkcs1_v1_5_k.nx nx_rsa_pkcs1_v1_5_sha384_4096_test nx_rsa_pkcs1_v1_5_sha384_test.nx nx_x509_verify_under_issuer.nx

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

28const NX_RSA_PKCS1_V15_384_OK: i64 = 1
29const NX_RSA_PKCS1_V15_384_S_OUT_OF_RANGE: i64 = 2
30const NX_RSA_PKCS1_V15_384_BAD_PAD: i64 = 3
31const NX_RSA_PKCS1_V15_384_HASH_MISMATCH: i64 = 4
32const NX_RSA_PKCS1_V15_384_VERDICT_N: i64 = 5

functions

35func rsa_pkcs1_sha384_di_byte(i: i64) -> i64
60func _rsa384_check_em(em: *u8, em_len: i64, h: *u8, ps_len: i64) -> i64
86func rsa_pkcs1_v1_5_sha384_verify(msg: *u8, msg_len: i64,
102func rsa_pkcs1_v1_5_sha384_4096_verify(msg: *u8, msg_len: i64,
117func main() -> i64