summaryrefslogtreecommitdiff
path: root/src/algo_hmac.h
blob: ecc29d4e4ce4cb07901091d3c1fcb64c54d556fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* algo_hmac - hash-based message authentication code (HMAC) wrapper
 *
 * Copyright(c) 2021 Glenn Strauss gstrauss()gluelogic.com  All rights reserved
 * License: BSD 3-clause (same as lighttpd)
 */
#ifndef INCLUDED_ALGO_HMAC_H
#define INCLUDED_ALGO_HMAC_H
#include "first.h"

int
li_hmac_md5 (unsigned char digest[16], /* [MD5_DIGEST_LENGTH] */
             const void * const secret, const uint32_t slen,
             const unsigned char * const msg, const uint32_t mlen);

int
li_hmac_sha1 (unsigned char digest[20], /* [SHA_DIGEST_LENGTH] */
              const void * const secret, const uint32_t slen,
              const unsigned char * const msg, const uint32_t mlen);

int
li_hmac_sha256 (unsigned char digest[32], /* [SHA256_DIGEST_LENGTH] */
                const void * const secret, const uint32_t slen,
                const unsigned char * const msg, const uint32_t mlen);

int
li_hmac_sha512 (unsigned char digest[64], /* [SHA512_DIGEST_LENGTH] */
                const void * const secret, const uint32_t slen,
                const unsigned char * const msg, const uint32_t mlen);


#endif /* INCLUDED_ALGO_HMAC_H */