libsodium (1.0.19)
1 #ifndef crypto_onetimeauth_H
2 #define crypto_onetimeauth_H
3
4 #include <stddef.h>
5
6 #include "crypto_onetimeauth_poly1305.h"
7 #include "export.h"
8
9 #ifdef __cplusplus
10 # ifdef __GNUC__
11 # pragma GCC diagnostic ignored "-Wlong-long"
12 # endif
13 extern "C" {
14 #endif
15
16 typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state;
17
18 SODIUM_EXPORT
19 size_t crypto_onetimeauth_statebytes(void);
20
21 #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES
22 SODIUM_EXPORT
23 size_t crypto_onetimeauth_bytes(void);
24
25 #define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES
26 SODIUM_EXPORT
27 size_t crypto_onetimeauth_keybytes(void);
28
29 #define crypto_onetimeauth_PRIMITIVE "poly1305"
30 SODIUM_EXPORT
31 const char *crypto_onetimeauth_primitive(void);
32
33 SODIUM_EXPORT
34 int crypto_onetimeauth(unsigned char *out, const unsigned char *in,
35 unsigned long long inlen, const unsigned char *k)
36 __attribute__ ((nonnull(1, 4)));
37
38 SODIUM_EXPORT
39 int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in,
40 unsigned long long inlen, const unsigned char *k)
41 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
42
43 SODIUM_EXPORT
44 int crypto_onetimeauth_init(crypto_onetimeauth_state *state,
45 const unsigned char *key) __attribute__ ((nonnull));
46
47 SODIUM_EXPORT
48 int crypto_onetimeauth_update(crypto_onetimeauth_state *state,
49 const unsigned char *in,
50 unsigned long long inlen)
51 __attribute__ ((nonnull(1)));
52
53 SODIUM_EXPORT
54 int crypto_onetimeauth_final(crypto_onetimeauth_state *state,
55 unsigned char *out) __attribute__ ((nonnull));
56
57 SODIUM_EXPORT
58 void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES])
59 __attribute__ ((nonnull));
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif