KCAPI_AKCIPHER_STREA(3)

πŸ’– KCAPI_AKCIPHER_STREA(3) β€” kcapi_akcipher_stream_update πŸ’–

okay bestie, so this one lives in section 3 of the manual (that's the Programming Interface section, iykyk) and it's called kcapi_akcipher_stream_update. yes the header truncates the name, that's just a manpage thing, don't worry about it πŸ’…


✨ NAME ✨

kcapi_akcipher_stream_update β€” send more data for processing (stream) πŸ¦‹


🌸 SYNOPSIS 🌸

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

πŸŽ€ ARGUMENTS πŸŽ€

  • handle β€” [in] the cipher handle, your main character 🫢
  • iov β€” [in] scatter/gather list with data to be processed by the cipher operation. it's giving "here's the goods, go off" ✨
  • iovlen β€” [in] number of scatter/gather list elements. literally just how many of them there are πŸ’–

πŸ’« DESCRIPTION πŸ’«

so like, with this function call you can submit more data to the kernel. more! data! πŸ”₯

⚠️ heads up: this function may cause the caller to sleep if the kernel buffer holding the data is getting full. like, it's full full. 😴

the process gets woken up once more buffer space becomes available β€” and that happens by calling kcapi_akcipher_stream_op. so basically, stream_op is the one that comes through with the wake-up call ☎️✨


πŸ‘‘ NOTE πŸ‘‘

with the separate API calls of kcapi_akcipher_stream_update and kcapi_akcipher_stream_op, a multi-threaded application can be implemented where:

  • one thread sends data to be processed 🧚
  • and one thread picks up data processed by the cipher operation 🌈

two threads, two jobs, no drama, we love a division of labour bestie πŸ’…


πŸ’€ WARNING πŸ’€

bestie. listen. the memory referenced by iov is not accessed by the kernel during this call.

it is first accessed when kcapi_cipher_stream_op is called.

🚨 SO YOU MUST MAKE SURE that the referenced memory is still present at the time kcapi_cipher_stream_op is called. no cap. do not let that memory go. it will not survive without you 😭

and, the 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. iconic behaviour, honestly πŸ‘‘



and that's the whole thing bestie, you ate, go forth and stream πŸŒΈπŸ’–

libkcapi Manual 1.5.0 β€” July 2025 β€” KCAPI_AKCIPHER_STREA(3) ✨ periodt ✨

πŸ“¦ where this page comes from