7df1f135804bdbc1ff4815d6a0c11ae17f9db142
[trex.git] /
1 #ifndef crypto_auth_hmacsha512_H
2 #define crypto_auth_hmacsha512_H
3
4 #include <stddef.h>
5 #include "crypto_hash_sha512.h"
6 #include "export.h"
7
8 #ifdef __cplusplus
9 # if __GNUC__
10 #  pragma GCC diagnostic ignored "-Wlong-long"
11 # endif
12 extern "C" {
13 #endif
14
15 typedef struct crypto_auth_hmacsha512_state {
16     crypto_hash_sha512_state ictx;
17     crypto_hash_sha512_state octx;
18 } crypto_auth_hmacsha512_state;
19
20 #define crypto_auth_hmacsha512_BYTES 64U
21 SODIUM_EXPORT
22 size_t crypto_auth_hmacsha512_bytes(void);
23
24 #define crypto_auth_hmacsha512_KEYBYTES 32U
25 SODIUM_EXPORT
26 size_t crypto_auth_hmacsha512_keybytes(void);
27
28 SODIUM_EXPORT
29 int crypto_auth_hmacsha512(unsigned char *out,
30                            const unsigned char *in,
31                            unsigned long long inlen,
32                            const unsigned char *k);
33
34 SODIUM_EXPORT
35 int crypto_auth_hmacsha512_verify(const unsigned char *h,
36                                   const unsigned char *in,
37                                   unsigned long long inlen,
38                                   const unsigned char *k);
39
40 SODIUM_EXPORT
41 int crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state,
42                                 const unsigned char *key,
43                                 size_t keylen);
44
45 SODIUM_EXPORT
46 int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
47                                   const unsigned char *in,
48                                   unsigned long long inlen);
49
50 SODIUM_EXPORT
51 int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
52                                  unsigned char *out);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif