code wiki / (root) / nx_hmac_sha512_wasm.nx

nx_hmac_sha512_wasm.nx

buildroot/runtime/nx_hmac_sha512_wasm.nx

13458 B327 linesdepth 0pulls 0 transitivereach 0 importersview sourcekind orphan librarytopic hmac
docsdependenciesstructsconstsfunctions

about

nx_hmac_sha512_wasm.nx -- HMAC-SHA-512 (RFC 2104 + 4231) for WAT target. Same construction as nx_hmac_sha256 but block size B=128 (not 64), output size 64 (not 32), inner hash = SHA-512 (not SHA-256). API: nx_hmac_sha512_one_shot(key_ptr, key_len, msg_ptr, msg_len, scratch_ptr, out_ptr) -> i64 scratch_ptr -- >= 2048 bytes out_ptr -- 64 bytes Verified against RFC 4231 ยง4 SHA-512 test cases. license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_2104 + rfc_4231 lineage_id: nishi_hmac_sha512_wasm_q11

dependencies 0 imports · 0 importers

imports: none

imported by: nobody (leaf or entry point)

structs

none

consts

18const W_OFF: i64 = 200
19const HMAC_B: i64 = 128

functions

21func _rotr64(x: i64, n: i64) -> i64
called by 1: _sha512_compress
29func _be64_read(buf: *u8, off: i64) -> i64
called by 1: _sha512_compress
41func _be64_write(buf: *u8, off: i64, v: i64) -> i64
53func _i64_le_get(buf: *u8, idx: i64) -> i64
called by 1: _sha512_compress
60func _i64_le_set(buf: *u8, idx: i64, v: i64) -> i64
called by 1: _sha512_compress
72func _h_get(ctx: *u8, i: i64) -> i64
79func _h_set(ctx: *u8, i: i64, v: i64) -> i64
92func _sha512_k(i: i64) -> i64
called by 1: _sha512_compress
136func _sha512_compress(ctx: *u8) -> i64
191func _sha512_init(ctx: *u8) -> i64
203func _sha512_one_shot(in_ptr: *u8, in_len: i64, ctx: *u8, out_ptr: *u8) -> i64
254func nx_hmac_sha512_one_shot(key_ptr: *u8, key_len: i64,