KCAPI_MD_SHA3_224(3)

πŸ’– KCAPI_MD_SHA3_224 β€” it's giving "one buffer, one digest, zero drama" ✨

okay bestie, so this is the kcapi_md_sha3_224 page from the libkcapi manual (that's the Programming Interface section, iykyk) and it's literally the cutest lil one-shot hash function you ever met. no state machines, no ceremony, just buffer in β†’ SHA3-224 digest out. slay. πŸ’…


πŸŽ€ NAME πŸŽ€

kcapi_md_sha3_224 β€” SHA3-224 message digest on one buffer

like, one buffer. that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

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

she takes four args and returns an ssize_t, no cap. πŸ‘‘


🌸 ARGUMENTS 🌸

  • in β€” [in] the buffer holding your input data. the raw material, the moment, the ✨content✨.
  • inlen β€” [in] how long that input buffer is. tell her the truth, don't be shy.
  • out β€” [out] the buffer where the message digest lands. this is where the magic gets written, bestie.
  • outlen β€” [in] the length of out. you gotta declare it upfront, no surprises. πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so with this one-shot convenience function, a message digest of the given buffer gets generated. that's it, that's the whole function. one call, one digest, main character energy only. πŸ’«

the important bit tho: the output buffer must be allocated by the caller, and it has to have at least the length of the message digest size for the chosen message digest. translation: you bring the buffer, and you bring it big enough. not me showing up with a tiny buffer and expecting a full digest 😭 that's not how this works.

and here's the return tea, fr fr:

  • βœ… size of message digest β€” upon success. we ate.
  • πŸ’€ -EIO β€” data cannot be obtained. the data said "no thanks."
  • 😭 -ENOMEM β€” the buffer is too small for the complete message digest, and the buffer is filled with the truncated message digest. so like, you get a partial. a lil baby digest. still useful, still real, just not the whole thing.
no cap: if you're getting -ENOMEM, your out buffer was too small and what you got back is a truncated digest. size your buffer for the full digest size of the chosen message digest and you're golden. 🌈

🌟 AUTHOR 🌟

Stephan Mueller <smueller@chronox.de> β€” Author. (the icon behind all of this, we stan 🫢)


that's the whole page bestie, go forth and hash responsibly πŸ’–


libkcapi Manual 1.5.0 β€” July 2025 πŸ¦‹ mwah, that's the version and the date, documented and adorable. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from