'\" t .\" Title: kcapi_cipher_stream_update .\" 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_update \- send more data for processing (stream) .SH "SYNOPSIS" .HP \w'ssize_t\ kcapi_cipher_stream_update('u .BI "ssize_t kcapi_cipher_stream_update(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 [in] scatter/gather list with data to be processed by the cipher operation\&. .RE .PP \fIiovlen\fR .RS 4 [in] number of scatter/gather list elements\&. .RE .SH "DESCRIPTION" .PP Using this function call, more plaintext for encryption or ciphertext for decryption can be submitted to the kernel\&. .PP This function may cause the caller to sleep if the kernel buffer holding the data is getting full\&. The process will be woken up once more buffer space becomes available by calling \fBkcapi_cipher_stream_op\fR\&. .SH "NOTE" .PP with the separate API calls of \fBkcapi_cipher_stream_update\fR and \fBkcapi_cipher_stream_op\fR 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\&. .SH "IMPORTANT NOTE" .PP The kernel will only process sysconf(_SC_PAGESIZE) * ALG_MAX_PAGES at one time\&. If your input data is larger than this threshold, you MUST segment it into chunks of at most sysconf(_SC_PAGESIZE) * ALG_MAX_PAGES and invoke the \fBkcapi_cipher_stream_update\fR on that segment followed by \fBkcapi_cipher_stream_op\fR before the next chunk is processed\&. If this rule is not obeyed, the thread invoking \fBkcapi_cipher_stream_update\fR will be put to sleep until another thread invokes \fBkcapi_cipher_stream_op\fR\&. .SH "WARNING" .PP The memory referenced by \fIiov\fR is not accessed by the kernel during this call\&. The memory is first accessed when \fBkcapi_cipher_stream_op\fR is called\&. Thus, you MUST make sure that the referenced memory is still present at the time \fBkcapi_cipher_stream_op\fR is called\&. .PP \fIreturn\fR number of bytes sent to 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