hmac_sha256_usingrawkey(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hmac_sha256_usingrawkey β€” Kernel API Manual, section 9 πŸŽ€

okay so picture this: you're in kernel land (yes, the kernel, we're fancy now ✨), and you need one single HMAC-SHA256. Not a whole session. Not a whole state machine. Just one. And you've got the raw key sitting right there in your hand like 🫢. That's this function, bestie. It does the whole thing in one shot, no cap.


🌸 NAME 🌸

hmac_sha256_usingrawkey β€” Compute HMAC-SHA256 in one shot, using a raw key πŸ’–


✨ SYNOPSIS ✨

void hmac_sha256_usingrawkey (const u8 *raw_key , size_t raw_key_len ,
       const u8 *data , size_t data_len , u8 out[static SHA256_DIGEST_SIZE] );

like, five args, zero drama. she's an icon, she's a legend, and she is the moment πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • raw_key β€” the raw HMAC-SHA256 key itself. just... the key. raw. unprocessed. the real deal πŸ™ˆ
  • raw_key_len β€” the key length in bytes. and listen β€” All key lengths are supported. every single one. no cap, no restrictions, she does not gatekeep πŸ”₯
  • data β€” the message data πŸ“©
  • data_len β€” the data length in bytes
  • out β€” (output) the resulting HMAC-SHA256 value. this is where the magic lands, bestie πŸ’«

πŸ’œ DESCRIPTION πŸ’œ

So like, the actual vibe here is minimal because the function is minimal. But here's the one thing you need to know, and it's giving "listen to me for two seconds":

If you're using the key multiple times, prefer to use hmac_sha256_preparekey followed by multiple calls to hmac_sha256 instead. πŸ”

fr fr. one-shot is for one shot. if you're looping, prep the key once and reuse it β€” that's the whole point. don't be out here re-deriving a key forty times in a loop, it's not the move πŸ’€


🌈 CONTEXT 🌈

Any context. literally any. no constraints, no prerequisites, no special preemption rules. she's flexible like that 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

the whole sha2 extended universe, in the exact order the kernel lists it β€” iykyk 🌟

Kernel file ./include/crypto/sha2.h and friends:


πŸŽ€ and that's the page!! tysm for reading, you ate that πŸ’…

signed, sealed, and shipped from ./include/crypto, dated October 2026 β€” Kernel API Manual, hmac_sha256_usingrawkey(9) β­πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from