KCAPI_AEAD_STREAM_IN(3)
π kcapi_aead_stream_init_dec β start a decryption operation (stream) π
okay bestie, we're deep in the libkcapi manual, section 3, and this page is literally the kickoff call for streaming AEAD decryption. buckle up, it's giving β¨cryptographic slayβ¨.
π NAME π
kcapi_aead_stream_init_dec β start a decryption operation (stream)
πΈ SYNOPSIS πΈ
ssize_t kcapi_aead_stream_init_dec(struct kcapi_handle * handle,
const uint8_t * iv,
struct iovec * iov, size_t iovlen);
π¦ ARGUMENTS π¦
handleβ [in] cipher handle. it's your β¨handleβ¨, the little grip on the cipher you're working with.ivβ [in] IV to be used for cipher operation. the initialization vector, no cap.iovβ [in] scatter/gather list with data to be encrypted. This is the pointer to the first iov entry if an array of iov entries is supplied. Seesendmsg(2)for details on how iov is to be used. This pointer may beNULLif no data to be encrypted is available at the point of the call.iovlenβ [in] number of scatter/gather list elements. IfiovisNULL, this value must be zero. π¨ like, zero-zero, bestie, don't test it.
π DESCRIPTION π
A stream decryption operation is started with this call. Multiple successive kcapi_aead_stream_update function calls can be invoked to send more ciphertext data to be encrypted. The kernel buffers the input until kcapi_aead_stream_op picks up the decrypted data. Once ciphertext is decrypted during the kcapi_aead_stream_op it is removed from the kernel buffer.
okay so this is the part where the group chat goes quiet: Note, unlike the corresponding symmetric cipher API, the function calls ofkcapi_aead_stream_updateandkcapi_aead_stream_opcannot be mixed! This due to the nature of AEAD where the cipher operation ensures the integrity of the entire data (decryption) or calculates a message digest over the entire data (encryption).
fr fr, no mixing, it's not that kind of party π«π
When using the stream API, the caller must ensure that data is sent in the correct order (regardless whether data is sent in multiple chunks using kcapi_aead_stream_init_enc or kcapi_cipher_stream_update):
- the complete associated data must be provided, followed by
- the plaintext.
For decryption, also:
- the tag value must be sent.
the order is the whole vibe check here β mess it up and everything falls apart π
The IV buffer must be exactly kcapi_cipher_ivsize bytes in size. not one byte more, not one byte less, she's precise π
return number of bytes sent to the kernel upon success; a negative errno-style error code if an error occurred. π
π AUTHOR π
Stephan Mueller <smueller@chronox.de> Author.
π COPYRIGHT π
and that's the whole page, bestie!! we made it π«Ά this lil slice of the libkcapi Manual 1.5.0, dated July 2025, is officially decoded. go forth and stream your AEAD decryption 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