1KCAPI_AKCIPHER_ENCRY(3) Programming Interface KCAPI_AKCIPHER_ENCRY(3)
2
3
4
6 kcapi_akcipher_encrypt - encrypt data
7
9 int32_t kcapi_akcipher_encrypt(struct kcapi_handle * handle,
10 const uint8_t * in, uint32_t inlen,
11 uint8_t * out, uint32_t outlen,
12 int access);
13
15 handle
16 [in] cipher handle
17
18 in
19 [in] plaintext data buffer
20
21 inlen
22 [in] length of in buffer
23
24 out
25 [out] ciphertext data buffer
26
27 outlen
28 [in] length of out buffer
29
30 access
31 [in] kernel access type (KCAPI_ACCESS_HEURISTIC - use internal
32 heuristic for fastest kernel access; KCAPI_ACCESS_VMSPLICE - use
33 vmsplice access; KCAPI_ACCESS_SENDMSG - sendmsg access)
34
36 It is perfectly legal to use the same buffer as the plaintext and
37 ciphertext pointers. That would mean that after the encryption
38 operation, the plaintext is overwritten with the ciphertext.
39
40 The memory should be aligned at the page boundary using
41 posix_memalign(sysconf(_SC_PAGESIZE)), If it is not aligned at the page
42 boundary, the vmsplice call may not send all data to the kernel.
43
44 If the output size is insufficiently large, -EINVAL is returned. The
45 output buffer must be at least as large as the modululs of the uses
46 key.
47
48 return number of bytes returned by the encryption operation upon
49 success; a negative errno-style error code if an error occurred
50
52 Stephan Mueller <smueller@chronox.de>
53 Author.
54
56libkcapi Manual 1.1.5 August 2019 KCAPI_AKCIPHER_ENCRY(3)