hmac_sha512_final(9)
π hmac_sha512_final(9) β from the Kernel API Manual, bestie
Okay so real talk, the header says hmac_sha512_final(9) and the manual is the Kernel API Manual, and today we're learning how to finish an HMAC-SHA512 value. Last step of the vibe, the closing act, the final rose ceremony πΉβ¨
πΈ NAME πΈ
hmac_sha512_final β wrap it up and finish computing an HMAC-SHA512 value π
β¨ SYNOPSIS β¨
void hmac_sha512_final (struct hmac_sha512_ctx *ctx , u8 out[static
SHA512_DIGEST_SIZE] );
That's the whole thing. Short, sweet, iconic. Periodt. π
π ARGUMENTS π
ctxβ the HMAC context you're finalizing. Heads up though: it must have been initialized first. No init, no service, that's the rule πoutβ this one's an output param, so it's where the resulting HMAC-SHA512 value lands. It'su8 out[static SHA512_DIGEST_SIZE], so the size is right there in the signature β no guessing, iykyk π
π¦ DESCRIPTION π¦
So you've been updating and updating and now you're done, and this function is the grand finale π
And here's the cute part that lowkey slays: after finishing, this zeroizes ctx. The way that means the caller does not need to do it. She cleans up after herself. Self-care, honestly π§ββοΈβ¨
π CONTEXT π
Any context. Literally any. No restrictions, no drama, we love a flexible queen π«Ά
π SEE ALSO π
Kernel file ./include/crypto/sha2.h β and bestie, the friend group here is huge, so buckle up π’
The SHA-224 corner:
struct sha224_ctx(9)sha224_init(9)sha224_update(9)sha224_final(9)sha224(9)
HMAC-224, the whole squad:
struct hmac_sha224_key(9)struct hmac_sha224_ctx(9)hmac_sha224_preparekey(9)hmac_sha224_init(9)hmac_sha224_init_usingrawkey(9)hmac_sha224_update(9)hmac_sha224_final(9)hmac_sha224(9)hmac_sha224_usingrawkey(9)
Now the SHA-256 crew:
struct sha256_ctx(9)sha256_init(9)sha256_update(9)sha256_final(9)sha256(9)sha256_finup_2x(9)sha256_finup_2x_is_optimized(9)
HMAC-256, back at it:
struct hmac_sha256_key(9)struct hmac_sha256_ctx(9)hmac_sha256_preparekey(9)hmac_sha256_init(9)hmac_sha256_init_usingrawkey(9)hmac_sha256_update(9)hmac_sha256_final(9)hmac_sha256(9)hmac_sha256_usingrawkey(9)
SHA-384 said hi:
struct sha384_ctx(9)sha384_init(9)sha384_update(9)sha384_final(9)sha384(9)
HMAC-384, matching energy:
struct hmac_sha384_key(9)struct hmac_sha384_ctx(9)hmac_sha384_preparekey(9)hmac_sha384_init(9)hmac_sha384_init_usingrawkey(9)hmac_sha384_update(9)hmac_sha384_final(9)hmac_sha384(9)hmac_sha384_usingrawkey(9)
And our own family, SHA-512, main character energy:
struct sha512_ctx(9)sha512_init(9)sha512_update(9)sha512_final(9)sha512(9)struct hmac_sha512_key(9)struct hmac_sha512_ctx(9)hmac_sha512_preparekey(9)hmac_sha512_init(9)hmac_sha512_init_usingrawkey(9)hmac_sha512_update(9)hmac_sha512(9)hmac_sha512_usingrawkey(9)
Reminder bestie: ctx has to be initialized before you call this, and this function zeroizes it for you afterward, so don't double-clean π
π Sign-off π
Source path is ./include/crypto, dated October 2026 β that's the whole footer, and honestly it's giving "signed, sealed, delivered" π Go forth and finalize, queen πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms