KCAPI_CIPHER_STREAM_(3)
β¨ NAME β¨
kcapi_cipher_stream_update_last β send the last data for processing (stream edition, bestie) π
okay so this whole vibe lives in the KCAPI_CIPHER_STREAM_(3) manual, and yes, that's the family you're in π
π¦ SYNOPSIS π¦
ssize_t kcapi_cipher_stream_update_last(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 the cipher operation is gonna chew on. πiovlenβ[in]how many elements are in that scatter/gather list. literally just the count, bestie. π’
π DESCRIPTION π
so with this function call you can hand more plaintext for encryption or ciphertext for decryption over to the kernel. slay.
this call is identical to the kcapi_cipher_stream_update call, EXCEPT β and this is the whole point β it marks the last data buffer before the cipher operation gets triggered. π¨
ngl this call is super important for stream ciphers like CTR or CTS mode when you're providing that final block. it's giving "closing time, everybody out". π
and yes, it is permissible to hand it a zero buffer if literally all the data β including the last block β was already provided by kcapi_cipher_stream_update. no cap. π
π WARNING π
okay bestie, listen up, because this one is the real talk:
if this call is not made for stream ciphers with input data that is not a multiple of the block size of the block cipher, the kernel will not return the last block that contains less data than the block size of the block cipher. π
for example: you send 257 bytes of data to be encrypted with ctr(aes), and without this call the kernel will return only 256 bytes. that one lonely byte? gone. not me losing your data. π
what you get back: 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. π«Ά
π COPYRIGHT π
libkcapi Manual 1.5.0 β July 2025 πΈ
and that's the whole page, bestie!! go forth and send your last block, you absolute icon πβ¨π periodt π¦π
π¦ 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