'\" t .\" Title: kcapi_cipher_stream_op .\" Author: .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: April 2024 .\" Manual: Programming Interface .\" Source: libkcapi Manual 1.4.0 .\" Language: English .\" .TH "KCAPI_CIPHER_STREAM_" "3" "April 2024" "libkcapi Manual 1\&.4\&.0" "Programming Interface" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kcapi_cipher_stream_op \- obtain processed data (stream) .SH "SYNOPSIS" .HP \w'ssize_t\ kcapi_cipher_stream_op('u .BI "ssize_t kcapi_cipher_stream_op(struct\ kcapi_handle\ *\ " "handle" ", struct\ iovec\ *\ " "iov" ", size_t\ " "iovlen" ");" .SH "ARGUMENTS" .PP \fIhandle\fR .RS 4 [in] cipher handle .RE .PP \fIiov\fR .RS 4 [out] scatter/gather list pointing to buffers to be filled with the resulting data from a cipher operation\&. .RE .PP \fIiovlen\fR .RS 4 [in] number of scatter/gather list elements\&. .RE .SH "DESCRIPTION" .PP This call can be called interleaved with \fBkcapi_cipher_stream_update\fR to fetch the processed data\&. .PP This function may cause the caller to sleep if the kernel buffer holding the data is empty\&. The process will be woken up once more data is sent by calling \fBkcapi_cipher_stream_update\fR\&. .PP Note, when supplying buffers that are not multiple of block size, the buffers will only be filled up to the maximum number of full block sizes that fit into the buffer\&. .PP The kernel supports multithreaded applications where one or more threads send data via the \fBkcapi_cipher_stream_update\fR function and another thread collects the processed data via kcapi_cipher_stream_op\&. The kernel, however, will return data via \fBkcapi_cipher_stream_op\fR as soon as it has some data available\&. For example, one thread sends 1000 bytes to be encrypted and another thread already waits for the ciphertext\&. The kernel may send only, say, 500 bytes back to the waiting process during one \fBkcapi_cipher_stream_op\fR call\&. In a subsequent calls to \fBkcapi_cipher_stream_op\fR more ciphertext is returned\&. This implies that when the receiving thread shall collect all data there is, \fBkcapi_cipher_stream_op\fR must be called in a loop until all data is received\&. .PP \fIreturn\fR number of bytes obtained from the kernel upon success; a negative errno\-style error code if an error occurred .SH "AUTHOR" .PP \fBStephan Mueller\fR <\&smueller@chronox.de\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br