1 #ifndef crypto_onetimeauth_poly1305_H
2 #define crypto_onetimeauth_poly1305_H
9 # pragma GCC diagnostic ignored "-Wlong-long"
14 #include <sys/types.h>
19 typedef struct crypto_onetimeauth_poly1305_state {
20 unsigned long long aligner;
21 unsigned char opaque[136];
22 } crypto_onetimeauth_poly1305_state;
24 typedef struct crypto_onetimeauth_poly1305_implementation {
25 const char *(*implementation_name)(void);
26 int (*onetimeauth)(unsigned char *out,
27 const unsigned char *in,
28 unsigned long long inlen,
29 const unsigned char *k);
30 int (*onetimeauth_verify)(const unsigned char *h,
31 const unsigned char *in,
32 unsigned long long inlen,
33 const unsigned char *k);
34 int (*onetimeauth_init)(crypto_onetimeauth_poly1305_state *state,
35 const unsigned char *key);
36 int (*onetimeauth_update)(crypto_onetimeauth_poly1305_state *state,
37 const unsigned char *in,
38 unsigned long long inlen);
39 int (*onetimeauth_final)(crypto_onetimeauth_poly1305_state *state,
41 } crypto_onetimeauth_poly1305_implementation;
43 #define crypto_onetimeauth_poly1305_BYTES 16U
45 size_t crypto_onetimeauth_poly1305_bytes(void);
47 #define crypto_onetimeauth_poly1305_KEYBYTES 32U
49 size_t crypto_onetimeauth_poly1305_keybytes(void);
52 const char *crypto_onetimeauth_poly1305_implementation_name(void);
55 int crypto_onetimeauth_poly1305_set_implementation(crypto_onetimeauth_poly1305_implementation *impl);
57 crypto_onetimeauth_poly1305_implementation *
58 crypto_onetimeauth_pick_best_implementation(void);
61 int crypto_onetimeauth_poly1305(unsigned char *out,
62 const unsigned char *in,
63 unsigned long long inlen,
64 const unsigned char *k);
67 int crypto_onetimeauth_poly1305_verify(const unsigned char *h,
68 const unsigned char *in,
69 unsigned long long inlen,
70 const unsigned char *k);
73 int crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
74 const unsigned char *key);
77 int crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
78 const unsigned char *in,
79 unsigned long long inlen);
82 int crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,