KCAPI_AKCIPHER_SIGN(3)
β¨ KCAPI_AKCIPHER_SIGN β¨
okay bestie, gather round π this is kcapi_akcipher_sign(3) from the libkcapi manual (that's the Programming Interface girlies, section 3, the good section) and she is literally the function that signs things for you. no cap.
πΈ NAME πΈ
kcapi_akcipher_sign β signature generation π
π SYNOPSIS π
ssize_t kcapi_akcipher_sign(struct kcapi_handle * handle,
const uint8_t * in, size_t inlen,
uint8_t * out, size_t outlen, int access);
π¦ ARGUMENTS π¦
handleβ [in] the cipher handle. your whole entire vibe, the thing you're working with π«Άinβ [in] the message data buffer. this is the tea you're about to sign, bestie.inlenβ [in] length of theinbuffer. yes she's literally just the length, iconic behaviour honestly.outβ [out] the signature data buffer. this is where the signature gets dropped β¨outlenβ [in] length of theoutbuffer.accessβ [in] the kernel access type π your options are:KCAPI_ACCESS_HEURISTICβ use the internal heuristic for the fastest kernel access π₯KCAPI_ACCESS_VMSPLICEβ use vmsplice accessKCAPI_ACCESS_SENDMSGβ use sendmsg access
π DESCRIPTION π
first thing's first, and this is lowkey the cutest part: it is perfectly legal to use the same buffer for both the message and signature pointers π like, go off. what that means is that after the signature generation operation finishes, the message gets overwritten with the signature. same memory, new content, main character energy β¨
second thing: your memory should be aligned at the page boundary using posix_memalign(sysconf(_SC_PAGESIZE)). if it is not aligned at the page boundary, the vmsplice call may not send all the data to the kernel. and bestie. we do NOT want the kernel getting half the data π
third thing, and this one's important so listen up: if the output size is insufficiently large, -EINVAL is returned π¨ the output buffer must be at least as large as the modulus of the used key. fr fr. size her correctly or she will simply not.
and then, the return situation: on success you get the number of bytes returned by the signature gen operation; on error you get a negative errno-style error code. that's it, that's the whole deal π
π AUTHOR π
Stephan Mueller <smueller@chronox.de>
- Author. π«
β COPYRIGHT β
(no extra deets in this section, the girlies said see the sign-off below π)
and that's the whole page, bestie!! you ate this π«Ά go forth and sign things responsibly β¨
libkcapi Manual 1.5.0 β July 2025 β KCAPI_AKCIPHER_SIGN(3) β mwah, that's the footer, love u, bye π
π
π¦ 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