1KCAPI_CIPHER_STREAM_(3) Programming Interface KCAPI_CIPHER_STREAM_(3)
2
3
4
6 kcapi_cipher_stream_init_enc - start an encryption operation (stream)
7
9 ssize_t kcapi_cipher_stream_init_enc(struct kcapi_handle * handle,
10 const uint8_t * iv,
11 struct iovec * iov,
12 size_t iovlen);
13
15 handle
16 [in] cipher handle
17
18 iv
19 [in] IV to be used for cipher operation
20
21 iov
22 [in] scatter/gather list with data to be encrypted. This is the
23 pointer to the first iov entry if an array of iov entries is
24 supplied. See sendmsg(2) for details on how iov is to be used. This
25 pointer may be NULL if no data to be encrypted is available at the
26 point of the call.
27
28 iovlen
29 [in] number of scatter/gather list elements. If iov is NULL, this
30 value must be zero.
31
33 A stream encryption operation is started with this call. Multiple
34 successive kcapi_cipher_stream_update function calls can be invoked to
35 send more plaintext data to be encrypted. The kernel buffers the input
36 until kcapi_cipher_stream_op picks up the encrypted data. Once
37 plaintext is encrypted during the kcapi_cipher_stream_op it is removed
38 from the kernel buffer.
39
40 The function calls of kcapi_cipher_stream_update and
41 kcapi_cipher_stream_op can be mixed, even by multiple threads of an
42 application.
43
44 The IV buffer must be exactly kcapi_cipher_ivsize bytes in size.
45
46 return number of bytes sent to the kernel upon success; a negative
47 errno-style error code if an error occurred
48
50 Stephan Mueller <smueller@chronox.de>
51 Author.
52
54libkcapi Manual 1.4.0 July 2023 KCAPI_CIPHER_STREAM_(3)