sha256_init(9)
β¨ sha256_init(9) β the kernel crypto glow-up π
okay so bestie, we're in the Kernel API Manual and today's main character is sha256_init(9). she's a tiny function with a big job and honestly? iconic. π
πΈ NAME πΈ
sha256_init β Initialize a SHA-256 context for a new message β¨
like, she sets the stage. she preps the vibes. she does not hash your message for you β that's other functions' business, iykyk.
π¦ SYNOPSIS π¦
void sha256_init (struct sha256_ctx *ctx );
returns void, so no "did it work" little treat for you β she just does the thing π
π ARGUMENTS π
ctxβ the context to initialize. yes queen, hand her yourstruct sha256_ctxand she'll get it ready for a brand new message π«Ά
π DESCRIPTION π
okay so real talk: if you don't need incremental computation, consider sha256 instead. like, sha256_init is for when you're doing the whole feed-it-in-pieces situation; if you've got the whole message in one go, sha256 is right there and she's built different (in a convenient way). no cap. β
π CONTEXT π
Any context. literally any. she's flexible like that πβ¨
π SEE ALSO π
first up, the kernel file that's the whole mothership: ./include/crypto/sha2.h πΈ
and then the entire extended friend group β every single one of them, no one gets left out π
- sha224 squad:
struct sha224_ctx(9),sha224_init(9),sha224_update(9),sha224_final(9),sha224(9) - hmac_sha224 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) - sha256 squad:
struct sha256_ctx(9),sha256_update(9),sha256_final(9),sha256(9),sha256_finup_2x(9),sha256_finup_2x_is_optimized(9) - hmac_sha256 squad:
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) - sha384 squad:
struct sha384_ctx(9),sha384_init(9),sha384_update(9),sha384_final(9),sha384(9) - hmac_sha384 squad:
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) - sha512 squad:
struct sha512_ctx(9),sha512_init(9),sha512_update(9),sha512_final(9),sha512(9) - hmac_sha512 squad:
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)
ngl, that's a LOT of siblings, but she loves them all equally π«Ά
and that's the page, bestie!! this one comes to you from ./include/crypto, dated October 2026 β mwah, slay, go hash something π
πβ¨
π¦ 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