ghash_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ghash_init(9) β€” like, the GHASH glow-up era begins

okay so bestie, welcome to ghash_init(9) from the Kernel API Manual β€” section 9, kernel territory, we're in the big leagues now πŸŽ€ this is the page where you find out how to spin up a fresh GHASH context so it's ready for a brand new message. slay.


✨ NAME ✨

ghash_init β€” literally just initializes a GHASH context for a new message. that's it. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void ghash_init (struct ghash_ctx *ctx , const struct ghash_key *key );

no cap, that's the whole call. two pointers, zero drama, void return so nothing to check. iconic behaviour honestly πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • ctx β€” the context you're initializing. this is the main character of the operation, it's the thing getting set up πŸ’…
  • key β€” the key you're using. and okay, important thing, listen up bestie 🫢: a pointer to the key is saved in the context. so the key has to live at least as long as the context does. not shorter. not "oh it'll probably be fine". it must outlive the context, periodt. if the key dips out early, that's a whole mess πŸ’€
⚠️ real talk: that lifetime rule is not a suggestion. the context is holding onto a pointer, not a copy. keep the key alive, bestie, and everything's golden ✨

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group shows up here, so let me introduce everybody 🫢

Kernel file ./include/crypto/gf128hash.h, plus:

like, the entire GHASH and POLYVAL extended universe. go read them, iykyk πŸ“šπŸ’œ


πŸŽ€ the cute sign-off πŸŽ€

and that's the page!! brought to you by the fine folks over at ./include/crypto, stamped October 2026 ⭐ go forth, initialize your contexts, keep your keys alive, and slay πŸ”₯πŸ’–

πŸ“¦ where this page comes from