KCAPI_AKCIPHER_STREA(3)

🌸 KCAPI_AKCIPHER_STREA(3) 🌸

okay bestie, this one lives in the Programming Interface section of the manual, and it's all about kicking off a decryption stream. let's get into it πŸ’–


✨ NAME ✨

kcapi_akcipher_stream_init_dec β€” start an decryption operation (stream)


πŸŽ€ SYNOPSIS πŸŽ€

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

πŸ’… ARGUMENTS πŸ’…

  • handle β€” [in] the cipher handle, your little main character 🫢
  • iov β€” [in] scatter/gather list with data to be decrypted. if you're passing in an array of iov entries, this points at the first one. see sendmsg(2) for the deets on how iov is meant to be used πŸ‘€ this pointer can legit be NULL if there's no data to be decrypted available at the point of the call.
  • iovlen β€” [in] number of scatter/gather list elements. and listen: if iov is NULL, this value must be zero. no cap. 🚫

🌈 DESCRIPTION 🌈

A stream decryption operation gets started with this call, periodt. then you can hit up kcapi_akcipher_stream_update multiple times in a row to send more plaintext data to be decrypted. the last invocation that supplies data has to go through kcapi_akcipher_stream_update_last, that's the rule πŸŽ€

meanwhile the kernel is just sitting there buffering the input until kcapi_akcipher_stream_op picks up the encrypted data. once the plaintext is decrypted during the kcapi_cipher_stream_op, it's removed from the kernel buffer β€” gone, bye, out of the group chat πŸ‘‹

and here's the cute part: the function calls of kcapi_akcipher_stream_update and kcapi_akcipher_stream_op can be mixed, even by multiple threads of an application. multitasking queen energy fr fr πŸ’…βœ¨

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.

and that's the whole page bestie, slay πŸ’–

libkcapi Manual 1.5.0 β€” July 2025 πŸ¦‹

that's the sign-off, mwah πŸ’‹ go decrypt something gorgeous ✨

πŸ“¦ where this page comes from