KCAPI_MD_HMAC_SHA512(3)
β¨ NAME β¨
kcapi_md_hmac_sha512 β HMAC SHA-512 keyed message digest on one buffer π
okay bestie, so this is the manual page for KCAPI_MD_HMAC_SHA512(3), and it's literally the one-shot girlie of keyed digests. one buffer in, one digest out, no drama. let's get into it π«Ά
πΈ SYNOPSIS πΈ
ssize_t kcapi_md_hmac_sha512(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. your secret. your little whisper. don't show anyone πkeylenβ [in] how long that HMAC key buffer is, in bytes.inβ [in] the buffer with the input data, aka the stuff you want digested.inlenβ [in] how long the input buffer is.outβ [out] the buffer where the message digest goes. this one's yours to allocate, bestie.outlenβ [in] the length ofout.
π DESCRIPTION π
so this is a one-shot convenience function β the "no thoughts, just digest" option β¨ With it, a keyed message digest of the given buffer gets generated. that's the whole vibe.
the one thing you absolutely have to do yourself: the output buffer must be allocated by the caller. yes, that's you. and it needs to be at least the length of the message digest size for the chosen keyed message digest. no cap. if you skimp on the buffer, that's a you problem π
and here's the return tea:
- on success, it returns the size of message digest π
-EIOβ data cannot be obtained π-ENOMEMβ buffer is too small for the complete message digest, and (plot twist) the buffer is filled with the truncated message digest π
ngl the -ENOMEM case is giving "half a snack". you got something, just not the whole thing. size your buffer right the first time, fr fr.
π¦ AUTHOR π¦
Stephan Mueller <smueller@chronox.de> Author. π«Ά
π COPYRIGHT π
libkcapi Manual 1.5.0 β July 2025 β that's the source, the version, and the date, all cute and accounted for π
and that's the whole page, bestie. go forth, key your digests, allocate your buffers, slay π β¨π
π¦ where this page comes from
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms