KCAPI_CIPHER_DECRYPT(3)
β¨ KCAPI_CIPHER_DECRYPT(3) β aka the "Programming Interface" girlies' guide β¨
okay so bestie, this is the page for kcapi_cipher_decrypt_aio and it lives in section 3 of the manual under Programming Interface. it's giving "decrypt data (asynchronous one shot)" and honestly? iconic. let's get into it π
πΈ NAME πΈ
kcapi_cipher_decrypt_aio β decrypt data (asynchronous one shot). no cap, that's the whole vibe. π¦
π SYNOPSIS π
ssize_t kcapi_cipher_decrypt_aio(struct kcapi_handle * handle,
struct iovec * iniov,
struct iovec * outiov, size_t iovlen,
const uint8_t * iv, int access);
π ARGUMENTS π
handleβ[in]the cipher handle. it's your main character, the one holding everything together. πiniovβ[in]head of the scatter-gather list array that's holding the ciphertext. the mystery box, basically. π₯outiovβ[out]head of the scatter-gather list with the destination buffers for the plaintext. this is where the decrypted tea gets poured. πiovlenβ[in]the number of scatter-gather list entries. literally just the headcount. πivβ[in]the IV to be used for the cipher operation. β¨accessβ[in]kernel access type. your options are, in order:KCAPI_ACCESS_HEURISTICβ use the internal heuristic for the fastest kernel accessKCAPI_ACCESS_VMSPLICEβ use vmsplice accessKCAPI_ACCESS_SENDMSGβ sendmsg access
π¦ DESCRIPTION π¦
so the way that this works is: the individual scatter-gather list entries are each processed with separate invocations of the given cipher. not one big gulp, a lil sip each. okayyy. π
β οΈ 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. and that's the kind of situation that has me on the floor, honestly. π
also, highkey important: the IV buffer must be exactly kcapi_cipher_ivsize bytes in size. not one byte more, not one byte less. periodt. π
and the return situation:
- returns the number of bytes decrypted upon success π
- returns a negative errno-style error code if an error occurred π
π AUTHOR π
Stephan Mueller <smueller@chronox.de>
- Author.
π COPYRIGHT π
okay that's the whole page, bestie, go forth and decrypt responsibly π«Ά and yes, this was libkcapi Manual 1.5.0, from July 2025 β the KCAPI_CIPHER_DECRYPT(3) era, we were all there, it was everything. bye 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