code wiki / (root) / hmac_sha512.nx

hmac_sha512.nx

buildroot/runtime/hmac_sha512.nx

2360 B75 linesdepth 5pulls 5 transitivereach 1 importersview sourcekind tooltopic hmac
docsdependenciesstructsconstsfunctions

about

hmac_sha512.nx -- HMAC-SHA-512 (RFC 2104 / FIPS 198-1). Completes the HMAC family: SHA-256, SHA-384, SHA-512. Used where TLS cipher suites or key-derivation ladders want the full 512-bit MAC width (relatively rare, but present in some SSH / OpenPGP / JWT profiles). Differences from hmac.nx: - Block size B = 128 bytes (SHA-512 block), not 64. - Hash output = 64 bytes (SHA-512), not 32. - Uses sha512_init instead of sha256_init.

dependencies 2 imports · 1 importers

syscalls.nx sha512.nx hmac_sha512.nx hkdf_sha512.nx

imports: syscalls.nxsha512.nx

imported by: hkdf_sha512.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hmac_sha512 sha512_digest sha512_init sha512_update blk_set_byte blk_get_i64 blk_set_i64 sha512_compress blk_get_i64 ↻ sha512_gamma0 rotr64_v shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final blk_set_byte ↻ sha512_compress ↻ sha512_init ↻ sha512_update ↻ sha512_final ↻

structs

none

consts

16const HMAC512_BLOCK: i64 = 128
17const HMAC512_HASH: i64 = 64
18const IPAD_512: i64 = 0x36
19const OPAD_512: i64 = 0x5C

functions

21func hmac_sha512(key: *u8, key_len: i64, msg: *u8, msg_len: i64,
67func main() -> i64 {
calls 1: hmac_sha512