nx_hkdf_sha512_wasm.nx
buildroot/runtime/nx_hkdf_sha512_wasm.nx
about
nx_hkdf_sha512_wasm.nx -- HKDF-SHA-512 (RFC 5869) for WAT target.
Built on inline HMAC-SHA-512 (inline SHA-512). Extract uses HMAC
directly; Expand chains HMAC outputs T(i) = HMAC(PRK, T(i-1) || info || i).
API:
nx_hkdf512_extract(salt, salt_len, ikm, ikm_len, scratch, prk_out)
nx_hkdf512_expand(prk, info, info_len, okm_len, scratch, okm_out)
Verified against RFC 5869 §A.4-A.6 (SHA-512 test cases).
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_5869 + rfc_4231
lineage_id: nishi_hkdf_sha512_wasm_q11
dependencies 0 imports · 0 importers
imports: none
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const W_OFF: i64 = 200 |
| 17 | const HMAC_B: i64 = 128 |
functions
| 19 | func _rotr64(x: i64, n: i64) -> i64 called by 1: _sha512_compress |
| 27 | func _be64_read(buf: *u8, off: i64) -> i64 called by 1: _sha512_compress |
| 39 | func _be64_write(buf: *u8, off: i64, v: i64) -> i64 |
| 51 | func _i64_le_get(buf: *u8, idx: i64) -> i64 called by 1: _sha512_compress |
| 58 | func _i64_le_set(buf: *u8, idx: i64, v: i64) -> i64 called by 1: _sha512_compress |
| 70 | func _h_get(ctx: *u8, i: i64) -> i64 |
| 77 | func _h_set(ctx: *u8, i: i64, v: i64) -> i64 |
| 90 | func _sha512_k(i: i64) -> i64 called by 1: _sha512_compress |
| 134 | func _sha512_compress(ctx: *u8) -> i64 called by 2: _sha512_one_shot_hmac_sha512 calls 7: _be64_read_i64_le_set_i64_le_get_rotr64_h_get_sha512_k+1 |
| 189 | func _sha512_init(ctx: *u8) -> i64 |
| 201 | func _sha512_one_shot(in_ptr: *u8, in_len: i64, ctx: *u8, out_ptr: *u8) -> i64 |
| 252 | func _hmac_sha512(key_ptr: *u8, key_len: i64, |
| 334 | func nx_hkdf512_extract(salt_ptr: *u8, salt_len: i64, calls 1: _hmac_sha512 |
| 358 | func nx_hkdf512_expand(prk_ptr: *u8, info_ptr: *u8, info_len: i64, calls 1: _hmac_sha512 |