KCAPI_MD_SM3(3)
β¨ KCAPI_MD_SM3 β¨
okay bestie, welcome to the KCAPI_MD_SM3(3) page β this is the one that does SM3 message digest on one buffer and honestly? it's giving one-shot convenience realness π no cap.
π SYNOPSIS π
ssize_t kcapi_md_sm3(const uint8_t * in, size_t inlen, uint8_t * out,
size_t outlen);
like, that's the whole thing. one call, one buffer in, digest out. periodt. πΈ
π ARGUMENTS π
inβ [in] the buffer with your input data. this is the stuff you're hashing, the main character fr.inlenβ [in] length of the input buffer. tell her how much data she's working with, she can't read minds πoutβ [out] the buffer for the message digest. this is where the glow-up lands β¨outlenβ [in] length ofout. yes you gotta declare it, that's just the vibe check.
π DESCRIPTION π
so with this one-shot convenience function, a message digest of the given buffer gets generated. that's it, that's the job. no state to babysit, no multi-step saga, just in and out and slay. π¦
the way that the output buffer must be allocated by the caller β yeah, that's on you, bestie, she's not mallocing for you β and it needs to have at least the length of the message digest size for the chosen message digest. so if your out is too smol for the digest, we got a situation (see below π).
and it returns:
- size of message digest upon success π β iconic, no notes
-EIOβ data cannot be obtained π-ENOMEMβ buffer is too small for the complete message digest, and the buffer is filled with the truncated message digest
okay real talk on that last one: -ENOMEM doesn't mean nothing happened. it means you got a truncated digest dropped into your buffer. so likeβ¦ read the return value, don't just assume. fr fr. π
π AUTHOR π
- Stephan Mueller
<smueller@chronox.de>β Author.
the literal author. the blueprint. we stan. π«Ά
π COPYRIGHT π
copyright info lives down here at the bottom where it belongs, quiet and iconic.
and that's the page, bestie!! πβ¨ you just read libkcapi Manual 1.5.0, dated July 2025, filed under KCAPI_MD_SM3(3). go hash something cute. mwah πππ§
π¦ 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