code wiki / (root) / nx_hmac_sha384_wasm.nx

nx_hmac_sha384_wasm.nx

buildroot/runtime/nx_hmac_sha384_wasm.nx

14221 B339 linesdepth 0pulls 0 transitivereach 0 importersview sourcekind orphan librarytopic hmac
docsdependenciesstructsconstsfunctions

about

nx_hmac_sha384_wasm.nx -- HMAC-SHA-384 (RFC 2104 + 4231) for WAT target. SHA-384 is SHA-512 with a different IV (FIPS 180-4 §5.3.4) and truncation of the 8-word state to the first 6 words (384 bits = 48 B). Block size remains B=128 -- so HMAC-SHA-384 follows the same outer/inner construction as HMAC-SHA-512, with output truncated. Used in the TLS 1.3 ciphersuite TLS_AES_256_GCM_SHA384. API: nx_hmac_sha384_one_shot(key_ptr, key_len, msg_ptr, msg_len, scratch_ptr, out_ptr) -> i64 scratch_ptr -- >= 2048 bytes out_ptr -- 48 bytes Verified against RFC 4231 §4 SHA-384 test cases. license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_2104 + rfc_4231 lineage_id: nishi_hmac_sha384_wasm_q1 safe_shift_audit: rotr-style (shift exponent = nn, mask exponent = 64-nn; differs -> safe)

dependencies 0 imports · 0 importers

imports: none

imported by: nobody (leaf or entry point)

structs

none

consts

23const W_OFF: i64 = 200
24const HMAC_B: i64 = 128

functions

26func _rotr64(x: i64, n: i64) -> i64
called by 1: _sha512_compress
34func _be64_read(buf: *u8, off: i64) -> i64
called by 1: _sha512_compress
46func _be64_write(buf: *u8, off: i64, v: i64) -> i64
58func _i64_le_get(buf: *u8, idx: i64) -> i64
called by 1: _sha512_compress
65func _i64_le_set(buf: *u8, idx: i64, v: i64) -> i64
called by 1: _sha512_compress
77func _h_get(ctx: *u8, i: i64) -> i64
84func _h_set(ctx: *u8, i: i64, v: i64) -> i64
97func _sha512_k(i: i64) -> i64
called by 1: _sha512_compress
141func _sha512_compress(ctx: *u8) -> i64
196func _sha512_init(ctx: *u8) -> i64
210func _sha512_one_shot(in_ptr: *u8, in_len: i64, ctx: *u8, out_ptr: *u8) -> i64
261func nx_hmac_sha384_one_shot(key_ptr: *u8, key_len: i64,