KCAPI_MD_SHA512(3)

πŸ’– KCAPI_MD_SHA512(3) β€” the manual page, but make it make sense πŸ’–

okay bestie, welcome to kcapi_md_sha512, straight out of the libkcapi programming interface. it's section 3, it's a one-shot, and it's about to hash a whole buffer in one single call. no streaming, no state machine, no drama. just vibes and SHA-512. ✨


🌸 NAME 🌸

kcapi_md_sha512 β€” SHA-512 message digest on one buffer

like… that's it. that's the whole job. one buffer in, SHA-512 digest out. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • in β€” [in] the buffer holding your input data. this is the stuff getting digested, bestie.
  • inlen β€” [in] how long that input buffer is. length of in, periodt.
  • out β€” [out] the buffer where the message digest lands. you're getting something back, iconic.
  • outlen β€” [in] the length of out. how much room you gave it.

✨ DESCRIPTION ✨

so this is a one-shot convenience function, and honestly? obsessed. it generates a message digest of the buffer you hand it, in one go. no setup arc, no character development, just digest.

the catch (and there's always a catch, lowkey): the output buffer is your responsibility. the caller allocates it, and it has to be at least as long as the message digest size for whichever message digest you chose. no shortcuts on the allocation, fr fr. 🫢

now the return situation, listen carefully:

  • returns the size of the message digest on success πŸ‘‘
  • -EIO β€” data cannot be obtained 😭
  • -ENOMEM β€” the buffer is too small for the complete message digest, and the buffer gets filled with the truncated message digest
heads up bestie: that -ENOMEM case is sneaky. you don't just get an error β€” you get a partial digest sitting in your buffer. truncated. not the whole thing. don't be out here treating it like a full digest, i'm begging. πŸ’€

πŸ’œ AUTHOR πŸ’œ

Stephan Mueller <smueller@chronox.de>

  • Author.

the actual main character of this manpage, ngl. πŸŽ€


this is the libkcapi Manual, version 1.5.0, dated July 2025. πŸ¦‹


and that's the whole page, bestie β€” kcapi_md_sha512(3), libkcapi Manual 1.5.0, July 2025, SHA-512, one buffer, zero notes. go forth and digest responsibly. πŸ’–βœ¨πŸŒΈ

πŸ“¦ where this page comes from