KCAPI_AKCIPHER_ENCRY(3)
π KCAPI_AKCIPHER_ENCRY π
okay bestie, welcome to the libkcapi girlies' corner of section 3 β this one lives in the Programming Interface manual and it's literally the moment you've been waiting for π«Ά
β¨ NAME β¨
kcapi_akcipher_encrypt_aio β encrypt data (asynchronous one shot) πβ¨
πΈ SYNOPSIS πΈ
ssize_t kcapi_akcipher_encrypt_aio(struct kcapi_handle * handle,
struct iovec * iniov,
struct iovec * outiov, size_t iovlen,
int access);
π ARGUMENTS π
handleβ [in] your cipher handle, the main character of this whole operation πiniovβ [in] head of the scatter-gather list array holding the plaintext (this is the tea you're about to encrypt π)outiovβ [out] head of the scatter-gather list of the destination buffers, which get filled with ciphertext πiovlenβ [in] number of scatter-gather list entries (how many lil chunks we're working with)accessβ [in] kernel access type, and babes you have options:KCAPI_ACCESS_HEURISTICβ use internal heuristic for fastest kernel access β‘KCAPI_ACCESS_VMSPLICEβ use vmsplice accessKCAPI_ACCESS_SENDMSGβ sendmsg access
π¦ DESCRIPTION π¦
so here's the vibe: the individual scatter-gather list entries are processed with separate invocations of the the given cipher. like, each one gets its own moment, no sharing β¨
now the memory part, and listen closely because this one matters β the 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 data to the kernel π no cap, that's just how it is.
β οΈ fr fr, get that alignment right or the kernel might not receive everything. it's giving "missing data" and nobody wants that.
and the return value? number of bytes encrypted upon success π β or a negative errno-style error code if an error occurred π
π AUTHOR π
Stephan Mueller <smueller@chronox.de> Author. π
π COPYRIGHT π
that's the whole page, bestie β no more sections, no less. π§
and that's a wrap on this one, gorgeous πΈ the source is the libkcapi Manual, version 1.5.0, dated July 2025 β so you know exactly which era of the manual you're reading. go forth and encrypt responsibly, 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