KCAPI_KPP_SSGEN_AIO(3)
โจ KCAPI_KPP_SSGEN_AIO โจ
okay bestie, gather round ๐ซถ this is a section 3 page from the libkcapi manual (the "Programming Interface" corner of the world), and it's about kcapi_kpp_ssgen_aio โ generating a shared secret, asynchronous one shot style. one shot. no second chances. main character energy only ๐
๐ธ NAME ๐ธ
kcapi_kpp_ssgen_aio โ generate a shared secret (asynchronous one shot) ๐โจ
๐ SYNOPSIS ๐
ssize_t kcapi_kpp_ssgen_aio(struct kcapi_handle * handle,
struct iovec * iniov, struct iovec * outiov,
size_t iovlen, int access);
like. that's the whole function signature. she's compact, she's powerful, she's literally iconic ๐
๐ฆ ARGUMENTS ๐ฆ
handleโ [in] cipher handle. your little handle bestie, the one you already got from somewhere ๐ซiniovโ [in] head of scatter-gather list of the source buffers with the public keys of the peer. yes, the peer. the other party. the person on the other end of the secret ๐คoutiovโ [out] head of scatter-gather list of the destination buffers filled with the generated shared secret. this is where the magic gets deposited โจ๐ฎiovlenโ [in] number of scatter-gather list entries. count 'em, bestie ๐ขaccessโ [in] kernel access type. and the options are:KCAPI_ACCESS_HEURISTICโ use internal heuristic for fastest kernel access ๐๏ธKCAPI_ACCESS_VMSPLICEโ use vmsplice access ๐งตKCAPI_ACCESS_SENDMSGโ sendmsg access ๐จ
๐ DESCRIPTION ๐
so the individual scatter-gather list entries? each one gets processed with separate invocations of the the given cipher. not one big blob โ separate. invocations. periodt ๐
ngl, there's a memory thing you cannot skip: the memory should be aligned at the page boundary using
posix_memalign(sysconf(_SC_PAGESIZE))
and if it is not aligned at the page boundary, the vmsplice call may not send all data to the kernel ๐ญ so likeโฆ align it. please. for me. for us. ๐ฅบ
fr fr, misaligned memory +vmsplice= data that never made it to the kernel. that's not a vibe, that's a bug. do theposix_memalignthing ๐
and the return? it returns the number of bytes verify upon success; a negative errno-style error code if an error occurred. so like, positive number = slay, negative number = something went wrong, go read your errno ๐
๐ AUTHOR ๐
Stephan Mueller <smueller@chronox.de> โ Author. the legend themselves, we stan ๐ซถโญ
๐ COPYRIGHT ๐
copyright vibes live in the footer, bestie, so here we go โ this page is from the libkcapi Manual 1.5.0, dated July 2025 ๐๐ซ
that's the whole thing. go align your memory and generate that shared secret, you absolute icon ๐ง๐๐
๐ฆ 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