KCAPI_AEAD_STREAM_UP(3)

πŸ’– KCAPI_AEAD_STREAM_UP(3) πŸ’–

okay bestie, so this is kcapi_aead_stream_update_last from the libkcapi programming interface, and it's giving "last one in, then we GO" energy. sit down, hydrate, let's get into it. 🫢


✨ NAME ✨

kcapi_aead_stream_update_last β€” send last data for processing (stream). the finale of the data-feeding saga ✨


πŸŽ€ SYNOPSIS πŸŽ€

ssize_t kcapi_aead_stream_update_last(struct kcapi_handle * handle,
                                      struct iovec * iov,
                                      size_t iovlen);

🌸 ARGUMENTS 🌸

  • handle β€” [in] the cipher handle. your main character. the one who's been holding this whole stream together πŸ’…
  • iov β€” [in] the scatter/gather list carrying the data the cipher operation is gonna process. it's the little lineup of buffers, very organized of them.
  • iovlen β€” [in] how many elements are in that scatter/gather list. count 'em. fr fr.

πŸ’œ DESCRIPTION πŸ’œ

so with this call, you can hand more plaintext over for encryption, or more ciphertext over for decryption, straight to the kernel. more data, more vibes, the kernel is ready. πŸ¦‹

here's the tea though: this call is identical to the kcapi_aead_stream_update call β€” like, literally the same, no cap β€” with one exception: it marks this data buffer as the last one before the cipher operation gets triggered. so it's the "okay and that's a wrap" of data buffers. 🎬

and typically? the tag value is provided with this call. so yeah, the tag rides in on this one. iconic of it. πŸ‘‘


πŸ’€ WARNING πŸ’€

okay so listen, this part matters, no skipping:

the memory that iov points to is NOT accessed by the kernel during this call. the kernel doesn't touch it yet. nope. it gets accessed for the very first time when kcapi_cipher_stream_op is called. 😭

so you MUST make sure that the referenced memory is still present (like, still alive, not freed, not wandered off) at the time kcapi_cipher_stream_op is called. this is not a drill. this is the plot of the movie. do not let that memory ghost you. πŸ‘»

also, while we're here: on success you get back the number of bytes sent to the kernel. if something went wrong, you get a negative errno-style error code. that's the whole vibe check on the return. πŸ’…


🧚 AUTHOR 🧚

  • Stephan Mueller <smueller@chronox.de> β€” Author. (yes the legend himself, we love to see it 🫢)

libkcapi Manual 1.5.0 β€” so this whole thing is libkcapi Manual 1.5.0, dated July 2025, filed under KCAPI_AEAD_STREAM_UP(3).


and that's the page bestie πŸ’– go stream responsibly, keep your buffers alive, and remember: last buffer in, cipher op out. periodt. πŸŒˆβœ¨πŸŽ€

πŸ“¦ where this page comes from