nx_hmac_sha512_wasm.nx
buildroot/runtime/nx_hmac_sha512_wasm.nx
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
| 18 | const W_OFF: i64 = 200 |
| 19 | const HMAC_B: i64 = 128 |
functions
| 21 | func _rotr64(x: i64, n: i64) -> i64 called by 1: _sha512_compress |
| 29 | func _be64_read(buf: *u8, off: i64) -> i64 called by 1: _sha512_compress |
| 41 | func _be64_write(buf: *u8, off: i64, v: i64) -> i64 |
| 53 | func _i64_le_get(buf: *u8, idx: i64) -> i64 called by 1: _sha512_compress |
| 60 | func _i64_le_set(buf: *u8, idx: i64, v: i64) -> i64 called by 1: _sha512_compress |
| 72 | func _h_get(ctx: *u8, i: i64) -> i64 |
| 79 | func _h_set(ctx: *u8, i: i64, v: i64) -> i64 |
| 92 | func _sha512_k(i: i64) -> i64 called by 1: _sha512_compress |
| 136 | func _sha512_compress(ctx: *u8) -> i64 called by 2: _sha512_one_shotnx_hmac_sha512_one_shot calls 7: _be64_read_i64_le_set_i64_le_get_rotr64_h_get_sha512_k+1 |
| 191 | func _sha512_init(ctx: *u8) -> i64 |
| 203 | func _sha512_one_shot(in_ptr: *u8, in_len: i64, ctx: *u8, out_ptr: *u8) -> i64 |
| 254 | func nx_hmac_sha512_one_shot(key_ptr: *u8, key_len: i64, |