1KCAPI_MD_DIGEST(3) Programming Interface KCAPI_MD_DIGEST(3)
2
3
4
6 kcapi_md_digest - calculate message digest on buffer (one-shot)
7
9 ssize_t kcapi_md_digest(struct kcapi_handle * handle,
10 const uint8_t * in, size_t inlen,
11 uint8_t * out, size_t outlen);
12
14 handle
15 [in] cipher handle
16
17 in
18 [in] buffer with input data
19
20 inlen
21 [in] length of input buffer
22
23 out
24 [out] buffer for message digest
25
26 outlen
27 [in] length of out
28
30 With this one-shot function, a message digest of the given buffer is
31 generated. The output buffer must be allocated by the caller and have
32 at least the length of the message digest size for the chosen message
33 digest.
34
35 The message digest handle must have been initialized, potentially by
36 also setting the key using the generic message digest API functions.
37
38 The input buffer can be at most INT_MAX in size.
39
40 return size of message digest upon success; -EIO - data cannot be
41 obtained; -ENOMEM - buffer is too small for the complete message
42 digest, the buffer is filled with the truncated message digest
43
45 Stephan Mueller <smueller@chronox.de>
46 Author.
47
49libkcapi Manual 1.3.1 July 2021 KCAPI_MD_DIGEST(3)