nx_hmac_sha384_wasm.nx
buildroot/runtime/nx_hmac_sha384_wasm.nx
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
| 23 | const W_OFF: i64 = 200 |
| 24 | const HMAC_B: i64 = 128 |
functions
| 26 | func _rotr64(x: i64, n: i64) -> i64 called by 1: _sha512_compress |
| 34 | func _be64_read(buf: *u8, off: i64) -> i64 called by 1: _sha512_compress |
| 46 | func _be64_write(buf: *u8, off: i64, v: i64) -> i64 |
| 58 | func _i64_le_get(buf: *u8, idx: i64) -> i64 called by 1: _sha512_compress |
| 65 | func _i64_le_set(buf: *u8, idx: i64, v: i64) -> i64 called by 1: _sha512_compress |
| 77 | func _h_get(ctx: *u8, i: i64) -> i64 |
| 84 | func _h_set(ctx: *u8, i: i64, v: i64) -> i64 |
| 97 | func _sha512_k(i: i64) -> i64 called by 1: _sha512_compress |
| 141 | func _sha512_compress(ctx: *u8) -> i64 called by 2: _sha512_one_shotnx_hmac_sha384_one_shot calls 7: _be64_read_i64_le_set_i64_le_get_rotr64_h_get_sha512_k+1 |
| 196 | func _sha512_init(ctx: *u8) -> i64 |
| 210 | func _sha512_one_shot(in_ptr: *u8, in_len: i64, ctx: *u8, out_ptr: *u8) -> i64 |
| 261 | func nx_hmac_sha384_one_shot(key_ptr: *u8, key_len: i64, |