KCAPI_MD_SHA384(3)

✨ KCAPI_MD_SHA384(3) ✨

okay bestie, welcome to the Programming Interface corner of the libkcapi world β€” this one is kcapi_md_sha384, and she is serving one-shot SHA-384 realness πŸ’…


🌸 NAME 🌸

kcapi_md_sha384 β€” SHA-384 message digest on one buffer

like, one buffer, one call, one gorgeous digest. no drama. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t kcapi_md_sha384(const uint8_t * in, size_t inlen, uint8_t * out,
                        size_t outlen);

that signature is literally the whole vibe. ssize_t coming back at you, four args, no notes. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • in β€” [in] the buffer holding your input data. this is the tea you're hashing, bestie πŸ«–
  • inlen β€” [in] how long that input buffer is
  • out β€” [out] the buffer where the message digest lands
  • outlen β€” [in] the length of out

πŸ’œ DESCRIPTION πŸ’œ

so this is a one-shot convenience function β€” meaning you hand her a buffer, she generates a message digest of it, and that's it. no state to babysit, no multi-step ceremony. iconic behavior, honestly. πŸ‘‘

heads up bestie: the output buffer must be allocated by you, the caller. she's not allocating anything for you, that's not the assignment. and it has to be at least the length of the message digest size for the chosen message digest. so like, size it right. πŸŽ€

now the return value, and listen closely because this part matters fr fr:

  • on success, she returns the size of the message digest ✨
  • -EIO β€” data cannot be obtained 😭
  • -ENOMEM β€” the buffer is too small for the complete message digest, and in that case the buffer is filled with the truncated message digest

so yeah, if you see -ENOMEM, you didn't lose everything β€” you got a lil partial digest situation. but still, size your buffer properly, i'm begging πŸ™ˆ


🧚 AUTHOR 🧚

Stephan Mueller <smueller@chronox.de> Author.

yes, that's the author line. we love a credited icon πŸ’–


libkcapi Manual 1.5.0 β€” July 2025 β€” KCAPI_MD_SHA384(3)

and that's the whole page, bestie. go hash something and slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from