hmac_sha256(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hmac_sha256 β€” the kernel API manual, bestie edition πŸŽ€

Okay so real talk: this is hmac_sha256(9), and it lives in the Kernel API Manual. She's a one-shot girlie β€” you give her a key you already prepped and a blob of data, and she hands you back the HMAC-SHA256. No drama, no state, no nothing. ✨


🌸 NAME 🌸

hmac_sha256 β€” compute HMAC-SHA256 in one shot, using a prepared key


πŸ¦‹ SYNOPSIS πŸ¦‹

void hmac_sha256 (const struct hmac_sha256_key *key , const u8 *data ,
size_t data_len , u8 out[static SHA256_DIGEST_SIZE] );

πŸ’– ARGUMENTS πŸ’–

  • key β€” the prepared HMAC key. Like, prepared prepared. It's a const struct hmac_sha256_key * and it must already be ready to go β€” no raw-key chaos here.
  • data β€” the message data. Your actual payload, an array of u8, hearts to it.
  • data_len β€” the data length in bytes, size_t style, because the kernel is nothing if not precise.
  • out β€” (output) the resulting HMAC-SHA256 value. It's u8 out[static SHA256_DIGEST_SIZE] β€” the digest lands here and it's iconic. πŸ‘‘

🧚 DESCRIPTION 🧚

So here's the vibe check: if you're only using the key once, consider using hmac_sha256_usingrawkey instead. That's it, that's the whole note β€” she's telling you there's a shorter path if your key isn't sticking around for round two. πŸ’…


πŸ”₯ CONTEXT πŸ”₯

Any context. Literally any. No locks, no sleep rules, no "only from process context" gatekeeping. Slay. 🫢


🌈 SEE ALSO 🌈

Whole fam, all of them, no cap:


That's the whole page, bestie β€” no crumbs left behind. πŸ“

Signed off from the ./include/crypto directory, dated October 2026 β€” hmac_sha256(9) ate and left absolutely zero notes. πŸ’œ
πŸ“¦ where this page comes from