KCAPI_MD_HMAC_SM3(3)

✨ KCAPI_MD_HMAC_SM3 ✨

okay so bestie, welcome to kcapi_md_hmac_sm3(3) β€” this is a page from the libkcapi Programming Interface, and it's literally the one-shot girlie for keyed message digests πŸ’…


🌸 NAME 🌸

kcapi_md_hmac_sm3 β€” HMAC SM3 keyed message digest on one buffer

the vibe? you hand it a key, you hand it some data, it hands you back a digest. one buffer, one shot, no drama πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t kcapi_md_hmac_sm3(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
  • inlen β€” [in] how long the input buffer is
  • out β€” [out] the buffer where the message digest goes 🫢
  • outlen β€” [in] how long out is

🌈 DESCRIPTION 🌈

this is a one-shot convenience function, bestie. it generates a keyed message digest of the buffer you give it. that's it, that's the whole thing ✨

the output buffer has to be allocated by you β€” the caller β€” and it must have at least the length of the message digest size for whichever keyed message digest you picked. no cap, if it's too small, that's on you (well, kind of β€” see below πŸ‘€).

what it gives back:

  • size of message digest upon success πŸŽ‰
  • -EIO β€” data cannot be obtained 😭
  • -ENOMEM β€” buffer is too small for the complete message digest, and the buffer gets filled with the truncated message digest πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Stephan Mueller <smueller@chronox.de>

  • Author.

that's the whole page, bestie. this was the libkcapi Manual, version 1.5.0, dated July 2025 β€” page KCAPI_MD_HMAC_SM3(3), and honestly? iconic. go forth and HMAC responsibly 🧚🌸

πŸ“¦ where this page comes from