KCAPI_MD_HMAC_SHA1(3)

πŸ’– NAME πŸ’–

kcapi_md_hmac_sha1 β€” HMAC SHA-1 keyed message digest on one buffer

okay bestie, this is the one-shot girlie: you hand her a key and a buffer, she hands you back a message digest. no state, no drama, no setup, just vibes and HMAC. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸŽ€ ARGUMENTS πŸŽ€

  • key β€” [in] the buffer holding your HMAC key πŸ”‘
  • keylen β€” [in] how long that HMAC key buffer is
  • in β€” [in] the buffer with your input data (the actual tea β˜•)
  • inlen β€” [in] length of the input buffer
  • out β€” [out] the buffer where the message digest goes πŸ’…
  • outlen β€” [in] length of out

🌸 DESCRIPTION 🌸

So this is the one-shot convenience function β€” literally the "I don't have time for a whole init/update/final situation" option. It generates a keyed message digest of the given buffer, all in one go. Slay. πŸ‘‘

Heads up bestie: the output buffer is yours to allocate. The caller allocates it, and it has to be at least the length of the message digest size for whichever keyed message digest you picked. Not smaller. Don't do it. πŸ™ˆ

And here's the tea on what she gives back β˜•:

  • size of message digest upon success πŸ₯³
  • -EIO β€” data cannot be obtained
  • -ENOMEM β€” buffer is too small for the complete message digest, and in that case the buffer is filled with the truncated message digest 😭

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de>

Author. yes that's the whole credit line, and honestly? icon behavior. 🫢


libkcapi Manual 1.5.0 β€” July 2025 πŸ’œ

and that's the whole page bestie, no cap. go forth and HMAC responsibly πŸ§šβœ¨πŸ’–

πŸ“¦ where this page comes from