KCAPI_MD_HMAC_SHA384(3)

πŸ’– NAME πŸ’–

kcapi_md_hmac_sha384 β€” HMAC SHA-384 keyed message digest on one buffer, bestie. One function, one buffer, one absolutely iconic keyed digest. ✨


🌸 SYNOPSIS 🌸

ssize_t kcapi_md_hmac_sha384(const uint8_t * key, uint32_t keylen,
                             const uint8_t * in, size_t inlen,
                             uint8_t * out, size_t outlen);

πŸŽ€ ARGUMENTS πŸŽ€

okay so here's the whole cast, no skips, everyone gets their moment πŸ‘‘

  • key β€” [in] the buffer holding your HMAC key. the secret sauce, the blueprint, the thing you do NOT post in the group chat πŸ”
  • keylen β€” [in] how long that HMAC key buffer is. yes, you gotta say it out loud.
  • in β€” [in] the buffer with the input data, aka the stuff you're about to digest. the main character, honestly.
  • inlen β€” [in] the length of the input buffer. feed it a number.
  • out β€” [out] the buffer where the message digest lands. this one's yours to fill, the function just writes into it πŸ’…
  • outlen β€” [in] the length of out. keep reading, this one matters more than it looks πŸ‘€

✨ DESCRIPTION ✨

So this is the one-shot convenience function, right? Like, you show up with your key, you show up with your data, and it hands you back a keyed message digest of the given buffer. No setup arc, no multi-step ritual, no side quests. Just vibes and a digest. πŸ¦‹

Heads up, bestie: the output buffer is not allocated for you. You allocate it, and it has to be at least the length of the message digest size for whichever keyed message digest you picked. Too small and things get messy (see below 😭).

And here's the return tea, fr fr:

  • on success it returns the size of the message digest 🌈
  • -EIO β€” the data cannot be obtained πŸ’€
  • -ENOMEM β€” the buffer is too small for the complete message digest, and it gets filled with the truncated message digest. so like, you get something, just not the whole thing πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de> β€” the author. periodt. 🫢


copyright section, she's here, she's present, she's got nothing to add beyond what's in the fine print down below ⭐


and that's the whole page, bestie!! πŸ’œ written for the libkcapi Manual, version 1.5.0, dated July 2025 β€” and honestly? she ate. go forth and HMAC responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from