HMAC(3) | Library Functions Manual | HMAC(3) |
hmac
—
#include <stdlib.h>
ssize_t
hmac
(const
char *hname, const void
*key, size_t klen,
const void *text,
size_t tlen,
void *digest,
size_t dlen);
hmac
() function computes the key-Hash Message
Authentication Code per RFC 2104 and places the result in
digest writing up to dlen bytes.
The actual number of bytes that would be written is returned.
The hash functions supported are: md2, md4, md5, rmd160, sha1, sha224, sha256, sha384, and sha512.
hmac
() function returns -1
if the hname is not found. Otherwise the actual length
of the digest string is returned (which could be bigger or smaller than
dlen). This length depends on the hashing function
selected.
64
to
128
bytes to handle SHA2.
hmac
() function appeared in NetBSD
8.
May 22, 2018 | NetBSD 9.0 |