KCAPI_AEAD_STREAM_UP(3)
π KCAPI_AEAD_STREAM_UP(3) β bestie, it's the stream-update girlie π
okay so this page is from the Programming Interface manual, and it's about one very specific little function that feeds more data into your AEAD stream. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
kcapi_aead_stream_update β send more data for processing (stream). that's it. that's the whole job. she just sends more. no cap.
π¦ SYNOPSIS π¦
ssize_t kcapi_aead_stream_update(struct kcapi_handle * handle,
struct iovec * iov, size_t iovlen);
π ARGUMENTS π
handleβ [in] the cipher handle. your main character. the one you got from the init call. hold her gently πiovβ [in] a scatter/gather list holding the data that the cipher operation is gonna process. it's a whole lil list of memory chunks, not one single buffer, so act accordingly πΈiovlenβ [in] how many elements are in that scatter/gather list. count them. be honest. π’
π DESCRIPTION π
so like, when you call this, you're submitting more plaintext (if you're encrypting) or more ciphertext (if you're decrypting) to the kernel. that's the vibe. that's the whole move. β¨
ngl, watch the order of your input data β the ordering is laid out over in kcapi_aead_stream_init_dec, so go read that before you start yeeting bytes in the wrong sequence π
also important: this call can make the caller sleep if the kernel buffer holding the data is getting full π΄ that's not a bug, that's just backpressure. the process gets woken back up once more buffer space frees up, and that wake-up happens by calling kcapi_aead_stream_op. so it's a lil tag-team situation, okay? π«
π NOTE π
- the last block of input data MUST be handed over with
kcapi_aead_stream_update_lastinstead. the kernel has to be told that the input data is complete β otherwise she's just sitting there waiting for more like ποΈπποΈ - because
kcapi_aead_stream_updateandkcapi_aead_stream_opare separate calls, you can build a multi-threaded application: one thread sends data off to be processed, and one thread picks up the data that the cipher operation already processed. two threads, one dream, iconic division of labor π
π₯ WARNING π₯
the memory thatiovpoints at is not accessed by the kernel during this call. NOT. TOUCHED. the memory only gets accessed oncekcapi_cipher_stream_opis called. so you MUST make sure that referenced memory is still there whenkcapi_cipher_stream_opruns. if you freed it early, that's not a slay, that's a disaster π
and the return situation, fr fr:
- on success: the number of bytes sent to the kernel
- on error: a negative errno-style error code
π AUTHOR π
Stephan Mueller <smueller@chronox.de>
- Author. giving credit where credit is due, periodt π
π COPYRIGHT π
that's the whole page bestie!! π this was the libkcapi Manual version 1.5.0, dated July 2025 β so if you're quoting her, cite her right. 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