code wiki / (root) / hmac_sha384.nx

hmac_sha384.nx

buildroot/runtime/hmac_sha384.nx

2945 B85 linesdepth 5pulls 5 transitivereach 1 importersview sourcekind tooltopic hmac
docsdependenciesstructsconstsfunctions

about

hmac_sha384.nx -- HMAC-SHA-384 (RFC 2104 / 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 · 1 importers

syscalls.nx sha512.nx hmac_sha384.nx hkdf_sha384.nx

imports: syscalls.nxsha512.nx

imported by: hkdf_sha384.nx

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

main hmac_sha384 sha384_digest sha384_init sha512_update blk_set_byte blk_get_i64 blk_set_i64 sha512_compress 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 blk_set_byte ↻ sha512_compress ↻ sha384_init ↻ sha512_update ↻ sha512_final ↻

structs

none

consts

21const HMAC384_BLOCK: i64 = 128
22const HMAC384_HASH: i64 = 48
23const IPAD_384: i64 = 0x36
24const OPAD_384: i64 = 0x5C

functions

26func hmac_sha384(key: *u8, key_len: i64, msg: *u8, msg_len: i64,
77func main() -> i64 {
calls 1: hmac_sha384