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