1KCAPI_AKCIPHER_DECRY(3)      Programming Interface     KCAPI_AKCIPHER_DECRY(3)
2
3
4

NAME

6       kcapi_akcipher_decrypt - decrypt data
7

SYNOPSIS

9       ssize_t kcapi_akcipher_decrypt(struct kcapi_handle * handle,
10                                      const uint8_t * in, size_t inlen,
11                                      uint8_t * out, size_t outlen,
12                                      int access);
13

ARGUMENTS

15       handle
16           [in] cipher handle
17
18       in
19           [in] ciphertext data buffer
20
21       inlen
22           [in] length of in buffer
23
24       out
25           [out] plaintext 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

DESCRIPTION

36       It is perfectly legal to use the same buffer as the plaintext and
37       ciphertext pointers. That would mean that after the decryption
38       operation, the ciphertext is overwritten with the plaintext.
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 decryption operation upon
49       success; a negative errno-style error code if an error occurred
50

AUTHOR

52       Stephan Mueller <smueller@chronox.de>
53           Author.
54
56libkcapi Manual 1.3.1              July 2021           KCAPI_AKCIPHER_DECRY(3)
Impressum