sha256_final(9)
π sha256_final β the Kernel API Manual's own "wrap it up bestie" moment π
okay so you're in the Kernel API Manual (yes, that one) and you've stumbled onto sha256_final(9), which is literally the last step of a SHA-256 digest. she's the finisher. the closer. the "ok we're done here" of the whole operation β¨
πΈ NAME πΈ
sha256_final β Finish computing a SHA-256 message digest
like bestie, the digest is done. she's cooked. serve her π
β¨ SYNOPSIS β¨
void sha256_final (struct sha256_ctx *ctx , u8 out[static
SHA256_DIGEST_SIZE] );
yes the line break in the middle is real, she's just built like that, no cap π
π ARGUMENTS π
ctxβ the context to finalize; must have been initialized. like, must. it's not optional, it's not a vibe, it's a requirement. this is thestruct sha256_ctxyou've been feeding this whole time π«Άoutβ (output) the resulting SHA-256 message digest. she writes the answer here. this is the moment. main character energy fr π₯
π¦ DESCRIPTION π¦
So after finishing, this zeroizes ctx. read that again. she wipes the context clean on her way out π§Ήβ¨
Which means β and this is the good part β the caller does not need to do it. no cleanup arc for you, bestie, that's her job. you can just chill. she ate and left no crumbs π
π CONTEXT π
Any context. literally any. she's flexible like that π
π SEE ALSO π
okay this list is long long, so buckle up buttercup, we're going on a tour of the whole sha2 header πΈ
Kernel file ./include/crypto/sha2.h π
SHA-224 crew:
struct sha224_ctx(9),sha224_init(9),sha224_update(9),sha224_final(9),sha224(9)
HMAC-SHA-224 girlies:
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)
SHA-256 squad (your faves):
struct sha256_ctx(9),sha256_init(9),sha256_update(9),sha256(9),sha256_finup_2x(9),sha256_finup_2x_is_optimized(9)
HMAC-SHA-256 crew:
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 babes:
struct sha384_ctx(9),sha384_init(9),sha384_update(9),sha384_final(9),sha384(9)
HMAC-SHA-384 hive:
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)
SHA-512 icons:
struct sha512_ctx(9),sha512_init(9),sha512_update(9),sha512_final(9),sha512(9)
HMAC-SHA-512 royalty:
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_final(9),hmac_sha512(9),hmac_sha512_usingrawkey(9)
every single one. not me listing all of them. iykyk ππ
quick vibe check:ctxmust have been initialized before you call this. don't be the person who skipssha256_init. that's not a look π
β okay that's the page!! brought to you by ./include/crypto, version dated October 2026, filed under sha256_final(9) β mwah, go hash something, bestie π
ππ§ββοΈ
π¦ 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