code wiki / (root) / nx_hmac_sha384.nx

nx_hmac_sha384.nx

buildroot/runtime/nx_hmac_sha384.nx

3222 B94 linesdepth 5pulls 5 transitivereach 674 importersview sourcekind tooltopic hmac
docsdependenciesstructsconstsfunctions

about

hmac_sha384.nx -- HMAC-SHA-384 (RFC 2104 / FIPS 198-1). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/nist/fips_198_1 Parallel to hmac.nx but keyed on SHA-384 instead of SHA-256. Required for TLS 1.3 cipher suites that negotiate SHA-384 in the key schedule (e.g. TLS_AES_256_GCM_SHA384). Differences from hmac.nx: - Block size B = 128 bytes (SHA-384 / SHA-512 block), not 64. - Hash output = 48 bytes (SHA-384), not 32. - Key-pre-hash uses sha384_digest for oversized keys. Key processing (RFC 2104) remains identical in structure: K' = H(K) if len(K) > B K' = K || zeros if len(K) < B K' = K if len(K) == B ipad / opad bytes XOR'd against K' block.

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_sha512.nx nx_hmac_sha384.nx nx_hkdf.nx nx_hkdf_sha384.nx

imports: nx_syscalls.nxnx_sha512.nx

imported by: nx_hkdf.nxnx_hkdf_sha384.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap hmac_sha384 sys_mmap ↻ sha384_digest sys_mmap ↻ sha384_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 rotr64_v shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ sha384_init ↻ sha512_update ↻ sha512_final ↻

structs

none

consts

30const HMAC384_BLOCK: i64 = 128
31const HMAC384_HASH: i64 = 48
32const IPAD_384: i64 = 0x36
33const OPAD_384: i64 = 0x5C

functions

35func hmac_sha384(key: *u8, key_len: i64, msg: *u8, msg_len: i64,
86func main() -> i64