KCAPI_AKCIPHER_DECRY(3)
β¨ KCAPI_AKCIPHER_DECRY(3) β¨
okay bestie, welcome to the libkcapi manual, section 3 π this one's about kcapi_akcipher_decrypt β the glow-up machine that turns your ciphertext back into readable plaintext. no cap. π
πΈ NAME πΈ
kcapi_akcipher_decrypt β decrypt data π¦
β SYNOPSIS β
ssize_t kcapi_akcipher_decrypt(struct kcapi_handle * handle,
const uint8_t * in, size_t inlen,
uint8_t * out, size_t outlen,
int access);
π ARGUMENTS π
handleβ [in] your cipher handle. the main character of this whole operation πinβ [in] the ciphertext data buffer. this is the mystery box you're opening πinlenβ [in] how long thatinbuffer is, in bytes.outβ [out] the plaintext data buffer. this is where the reveal lands β¨outlenβ [in] how long theoutbuffer is.accessβ [in] which kernel access type you want:KCAPI_ACCESS_HEURISTICβ use the internal heuristic to figure out the fastest kernel access π₯KCAPI_ACCESS_VMSPLICEβ use vmsplice accessKCAPI_ACCESS_SENDMSGβ use sendmsg access
π DESCRIPTION π
it is perfectly legal to use the same buffer for both the plaintext and ciphertext pointers. like, go off. what that means is: after the decryption operation finishes, the ciphertext gets overwritten with the plaintext. one buffer, two eras. π
now, 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 the data to the kernel. so likeβ¦ align it, bestie, it's giving self-care π§
if the output size is insufficiently large, -EINVAL is returned. the output buffer must be at least as large as the modulus of the key being used. no shortcuts, that's the rule π
on success you get back the number of bytes returned by the decryption operation; if something went wrong you get a negative errno-style error code instead. slay when it works, weep when it doesn't π«Ά
π AUTHOR π
Stephan Mueller <smueller@chronox.de> Author.
π COPYRIGHT π
that's the whole page, bestie β periodt. π
this was libkcapi Manual 1.5.0, dated July 2025, and yes the title up top says KCAPI_AKCIPHER_DECRY(3). go decrypt something iconic β¨π¦πΈ
π¦ 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