1#ifndef crypto_onetimeauth_poly1305_H
2#define crypto_onetimeauth_poly1305_H
3
4#ifdef __cplusplus
5# ifdef __GNUC__
6#  pragma GCC diagnostic ignored "-Wlong-long"
7# endif
8extern "C" {
9#endif
10
11#include <stdint.h>
12#include <stdio.h>
13#include <stdlib.h>
14
15#include <sys/types.h>
16
17#include "export.h"
18
19typedef struct CRYPTO_ALIGN(16) crypto_onetimeauth_poly1305_state {
20    unsigned char opaque[256];
21} crypto_onetimeauth_poly1305_state;
22
23SODIUM_EXPORT
24size_t crypto_onetimeauth_poly1305_statebytes(void);
25
26#define crypto_onetimeauth_poly1305_BYTES 16U
27SODIUM_EXPORT
28size_t crypto_onetimeauth_poly1305_bytes(void);
29
30#define crypto_onetimeauth_poly1305_KEYBYTES 32U
31SODIUM_EXPORT
32size_t crypto_onetimeauth_poly1305_keybytes(void);
33
34SODIUM_EXPORT
35int crypto_onetimeauth_poly1305(unsigned char *out,
36                                const unsigned char *in,
37                                unsigned long long inlen,
38                                const unsigned char *k);
39
40SODIUM_EXPORT
41int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
42                                       const unsigned char *in,
43                                       unsigned long long inlen,
44                                       const unsigned char *k)
45            __attribute__ ((warn_unused_result));
46
47SODIUM_EXPORT
48int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
49                                     const unsigned char *key);
50
51SODIUM_EXPORT
52int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
53                                       const unsigned char *in,
54                                       unsigned long long inlen);
55
56SODIUM_EXPORT
57int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
58                                      unsigned char *out);
59
60SODIUM_EXPORT
61void crypto_onetimeauth_poly1305_keygen(unsigned char k[crypto_onetimeauth_poly1305_KEYBYTES]);
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif
68