KCAPI_AKCIPHER_STREA(3)

πŸ’– KCAPI_AKCIPHER_STREA(3) πŸ’–

okay bestie, you found the page for kcapi_akcipher_stream_init_sgn β€” that's a mouthful, i know β€” and it lives in the Programming Interface section of the manual. it's part of libkcapi Manual 1.5.0, dated July 2025, and yes we're gonna get into it together. grab a snack. πŸ“


✨ NAME ✨

kcapi_akcipher_stream_init_sgn β€” kick off a signing operation, but make it a stream. πŸ’…


✨ SYNOPSIS ✨

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

✨ ARGUMENTS ✨

  • handle β€” [in] the cipher handle. your main character. πŸ‘‘
  • iov β€” [in] a scatter/gather list holding the data you wanna sign. if you're passing an array of iov entries, this points at the first one. how iov actually gets used? that's a sendmsg(2) situation, go read that for the deets. also: this pointer can totally be NULL if you just don't have any data to sign at the moment of the call. no pressure, no data, no problem. 🫢
  • iovlen β€” [in] how many scatter/gather list elements you've got. ⚠️ and listen: if iov is NULL, this value must be zero. fr fr, don't be out here passing NULL with a nonzero length. πŸ’€

✨ DESCRIPTION ✨

so this call starts a stream signing operation. think of it as opening the group chat before everyone starts yapping. πŸŽ€

once you're in, you can hit kcapi_akcipher_stream_update multiple times in a row to keep feeding more plaintext in to be signed. but the last time you send data, you have to use kcapi_akcipher_stream_update_last β€” that's the "okay that's everything, send it" move. no cap. 🌸

meanwhile the kernel is over there buffering your input until kcapi_akcipher_stream_op comes along and picks up the signed data. and the second that plaintext gets signed during kcapi_cipher_stream_op? it's gone from the kernel buffer. removed. ghosted. literally. πŸ¦‹

and here's the cute part: you can mix kcapi_akcipher_stream_update and kcapi_akcipher_stream_op calls however you want β€” even from multiple threads in the same application. multithreaded chaos is allowed, it's giving teamwork. πŸ”₯

as for what you get back: on success it returns the number of bytes sent to the kernel, and if something goes sideways you get a negative errno-style error code. 😭


✨ AUTHOR ✨

Stephan Mueller <smueller@chronox.de> β€” the author. iconic behavior honestly. πŸ‘‘


that's the whole page, babe. 🌈


okay so that's the tea β˜• β€” and just so you have the receipts: this is the libkcapi Manual 1.5.0, July 2025 edition, page KCAPI_AKCIPHER_STREA(3). go sign something. slay. πŸ’œβœ¨

πŸ“¦ where this page comes from