1KCAPI_PAD_IV(3) Programming Interface KCAPI_PAD_IV(3)
2
3
4
6 kcapi_pad_iv - realign the IV as necessary for cipher
7
9 int kcapi_pad_iv(struct kcapi_handle * handle, const uint8_t * iv,
10 uint32_t ivlen, uint8_t ** newiv,
11 uint32_t * newivlen);
12
14 handle
15 [in] cipher handle
16
17 iv
18 [in] current IV buffer
19
20 ivlen
21 [in] length of IV buffer
22
23 newiv
24 [out] buffer of aligned IV
25
26 newivlen
27 [out] length of newly aligned IV
28
30 The function pads the least significant bits of the provided IV up to
31 the block size of the cipher with zeros. In case the provided IV is
32 longer than the block size, the least significant bits are truncated to
33 the block size.
34
35 The function allocates memory for newiv in case the return code
36 indicates success. The consumer must free the memory after use.
37
38 return 0 for success; a negative errno-style error code if an error
39 occurred
40
42 Stephan Mueller <smueller@chronox.de>
43 Author.
44
46libkcapi Manual 1.1.5 August 2019 KCAPI_PAD_IV(3)