1KCAPI_CIPHER_STREAM_(3) Programming Interface KCAPI_CIPHER_STREAM_(3)
2
3
4
6 kcapi_cipher_stream_update - send more data for processing (stream)
7
9 ssize_t kcapi_cipher_stream_update(struct kcapi_handle * handle,
10 struct iovec * iov, size_t iovlen);
11
13 handle
14 [in] cipher handle
15
16 iov
17 [in] scatter/gather list with data to be processed by the cipher
18 operation.
19
20 iovlen
21 [in] number of scatter/gather list elements.
22
24 Using this function call, more plaintext for encryption or ciphertext
25 for decryption can be submitted to the kernel.
26
27 This function may cause the caller to sleep if the kernel buffer
28 holding the data is getting full. The process will be woken up once
29 more buffer space becomes available by calling kcapi_cipher_stream_op.
30
32 with the separate API calls of kcapi_cipher_stream_update and
33 kcapi_cipher_stream_op a multi-threaded application can be implemented
34 where one thread sends data to be processed and one thread picks up
35 data processed by the cipher operation.
36
38 The kernel will only process sysconf(_SC_PAGESIZE) * ALG_MAX_PAGES at
39 one time. If your input data is larger than this threshold, you MUST
40 segment it into chunks of at most sysconf(_SC_PAGESIZE) * ALG_MAX_PAGES
41 and invoke the kcapi_cipher_stream_update on that segment followed by
42 kcapi_cipher_stream_op before the next chunk is processed. If this rule
43 is not obeyed, the thread invoking kcapi_cipher_stream_update will be
44 put to sleep until another thread invokes kcapi_cipher_stream_op.
45
47 The memory referenced by iov is not accessed by the kernel during this
48 call. The memory is first accessed when kcapi_cipher_stream_op is
49 called. Thus, you MUST make sure that the referenced memory is still
50 present at the time kcapi_cipher_stream_op is called.
51
52 return number of bytes sent to the kernel upon success; a negative
53 errno-style error code if an error occurred
54
56 Stephan Mueller <smueller@chronox.de>
57 Author.
58
60libkcapi Manual 1.3.1 July 2021 KCAPI_CIPHER_STREAM_(3)