KCAPI_AKCIPHER_DECRY(3)
π KCAPI_AKCIPHER_DECRY(3) π
okay bestie, so this is a page from the libkcapi programming interface crew, and it's lowkey one of the most fun ones because we're doing decryption β¨ asynchronous style. grab a snack, we're going in π
β¨ NAME β¨
kcapi_akcipher_decrypt_aio β decrypt data (asynchronous one shot) π
like. the name literally tells you everything. it decrypts. it's async. it's one shot. iconic behaviour fr fr π
πΈ SYNOPSIS πΈ
ssize_t kcapi_akcipher_decrypt_aio(struct kcapi_handle * handle,
struct iovec * iniov,
struct iovec * outiov, size_t iovlen,
int access);
look at her. five arguments. not one of them is optional. the way that she returns an ssize_tβ¦ main character energy tbh π
π¦ ARGUMENTS π¦
handleβ [in] your cipher handle. the lil bestie you've been carrying around this whole time π«Άiniovβ [in] the head of the scatter-gather list array that's holding the plaintext. yes, the plaintext. it's coming in, it's about to get turned into ciphertext on the way out, keep up πoutiovβ [out] the head of the scatter-gather list of destination buffers, and these get filled with ciphertext. she's the output girlie, she receives β¨iovlenβ [in] how many scatter-gather list entries there are. just a count. a lil number. no cap π’accessβ [in] the kernel access type, and you've got three flavours to pick from:KCAPI_ACCESS_HEURISTICβ use the internal heuristic for the fastest kernel access ποΈKCAPI_ACCESS_VMSPLICEβ use vmsplice access πKCAPI_ACCESS_SENDMSGβ sendmsg access π¨
π DESCRIPTION π
so here's the tea β β the individual scatter-gather list entries get processed with separate invocations of the given cipher. not one big gulp, but a bunch of lil sips. that's just how she operates and we respect it π
π¨ okay this next part is IMPORTANT, do not scroll past it bestie. your memory should be aligned at the page boundary usingposix_memalign(sysconf(_SC_PAGESIZE)). If it is not aligned at the page boundary, thevmsplicecall may not send all data to the kernel. like, data justβ¦ doesn't make it. we don't want that. align your memory, periodt π
and what does she give back to you?
- the number of bytes decrypted upon success β¨
- a negative errno-style error code if an error occurred π
that's the vibe check. success = bytes, failure = negative errno. iykyk π§
π AUTHOR π
- Stephan Mueller
<smueller@chronox.de>β Author.
the literal author. the one who wrote her. we stan π
π COPYRIGHT π
that's the legal bit, keep it cute, keep it real π
and that's the whole page bestie!! libkcapi Manual 1.5.0, dated July 2025 β from the libkcapi programming interface girlies with love π«Άβ¨
π¦ 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