sha256_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 your struct sha256_ctx and 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 πŸ’œ


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