KCAPI_CIPHER_DECRYPT(3)
β¨ NAME β¨
kcapi_cipher_decrypt β decrypt data (synchronous one shot) π
okay bestie, welcome to the KCAPI_CIPHER_DECRYPT(3) page, you're gonna eat this up. it's the one-shot decryption girlie. no streaming, no drama, just one call. periodt.
πΈ SYNOPSIS πΈ
ssize_t kcapi_cipher_decrypt(struct kcapi_handle * handle,
const uint8_t * in, size_t inlen,
const uint8_t * iv, uint8_t * out,
size_t outlen, int access);
π ARGUMENTS π
handleβ[in]the cipher handle. your main character. πinβ[in]ciphertext data buffer. this is the scrambled stuff you're trying to un-scramble.inlenβ[in]length of theinbuffer. she needs to know how much she's working with.ivβ[in]the IV to be used for the cipher operation. yes you need it, no you can't skip it, it's giving essential. π₯outβ[out]plaintext data buffer. this is where the readable stuff lands. π¦outlenβ[in]length of theoutbufferS π (that trailing S is literally in the manual, i'm just the messenger bestie, not me fixing it π)accessβ[in]kernel access type. pick your fighter:KCAPI_ACCESS_HEURISTICβ use the internal heuristic for the fastest kernel access. let her cook. πKCAPI_ACCESS_VMSPLICEβ use vmsplice access.KCAPI_ACCESS_SENDMSGβ sendmsg access.
π DESCRIPTION π
okay so, plot twist that's actually not a plot twist: it is perfectly legal to use the same buffer for the plaintext pointer and the ciphertext pointer. same buffer, both jobs, she's versatile like that. β¨ what that means is that after the encryption operation, the ciphertext is overwritten with the plaintext. (yes, the manual says "encryption" here, and i'm repeating it exactly, no notes, we don't edit the ancestors π)
about memory: your 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. so like... align it. don't be the girl who forgets to align it. π
and the IV buffer? it must be exactly kcapi_cipher_ivsize bytes in size. exactly. not a byte more, not a byte less. vibe check failed otherwise.
what you get back: the number of bytes decrypted upon success π β or a negative errno-style error code if an error occurred π.
π AUTHOR π
Stephan Mueller <smueller@chronox.de> β Author. (we love a credited icon π«Ά)
π§ COPYRIGHT π§
that's the whole page bestie, go decrypt something iconic. this masterpiece is from libkcapi Manual 1.5.0, dated July 2025 β slay, and see you on the KCAPI_CIPHER_DECRYPT(3) side. βππ
π¦ 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