KCAPI_CIPHER_STREAM_(3)
π KCAPI_CIPHER_STREAM_(3) π
okay bestie, sit down, hydrate, and let me tell you about kcapi_cipher_stream_init_dec β she lives in section 3 of the libkcapi manual and she is literally the girl who starts your stream decryption. no cap. π₯
β¨ NAME β¨
kcapi_cipher_stream_init_dec β start a decryption operation (stream) π«Ά
πΈ SYNOPSIS πΈ
ssize_t kcapi_cipher_stream_init_dec(struct kcapi_handle * handle,
const uint8_t * iv,
struct iovec * iov, size_t iovlen);
π ARGUMENTS π
handleβ [in] the cipher handle, aka your main character. she's the one holding the whole operation together πivβ [in] the IV that's gonna be used for the cipher operation. yes you need one. yes it matters. π¦iovβ [in] a scatter/gather list with the data to be encrypted. if you're handing over an array of iov entries, this is the pointer to the first iov entry. need the deets on howiovworks? go readsendmsg(2), she explains it. also: this pointer may beNULLif there's no data to be encrypted available at the moment of the call. no data, no problem, bestie πiovlenβ [in] the number of scatter/gather list elements. and listen β ifiovisNULL, this value must be zero. that's the vibe check. don't fight it β
π DESCRIPTION π
so like, this call starts a stream decryption operation. periodt.
after that, you can hit up kcapi_cipher_stream_update multiple times in a row to send more ciphertext data over to get decrypted. the kernel is out here buffering your input until kcapi_cipher_stream_op comes along and picks up the decrypted data. and the second ciphertext gets decrypted during kcapi_cipher_stream_op, it is removed from the kernel buffer. gone. deleted. she said bye π
the calls to kcapi_cipher_stream_update and kcapi_cipher_stream_op can be mixed β like, even by multiple threads of an application. iconic. multitasking queen behavior fr fr π
the iv buffer must be exactly kcapi_cipher_ivsize bytes in size. not one byte more, not one byte less. that's the rule π
and what does she return? on success you get the number of bytes sent to the kernel. if something went wrong, you get a negative errno-style error code. so like, if the number is negative, that's your sign bestie π
π AUTHOR π
Stephan Mueller <smueller@chronox.de> Author.
π COPYRIGHT π
that's the whole page, my love π this was libkcapi Manual 1.5.0 from July 2025, page KCAPI_CIPHER_STREAM_(3) β go forth and decrypt 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