aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/poly1305/poly1305.h
blob: 902a9c288c78ae5502d904a4afca8e25094e651f (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
32
33
34
35
36
37
38
#ifndef POLY1305_H
#define POLY1305_H

#include <stddef.h>

#if defined(__cplusplus)
extern "C"
{
#endif

typedef struct poly1305_state
{
	unsigned char opaque[320];
} poly1305_state;

typedef struct poly1305_key
{
	unsigned char b[32];
} poly1305_key;

void poly1305_init(poly1305_state *S, const poly1305_key *key);
void poly1305_init_ext(poly1305_state *S, const poly1305_key *key,
		size_t bytes_hint);
void poly1305_update(poly1305_state *S, const unsigned char *in, size_t inlen);
void poly1305_finish(poly1305_state *S, unsigned char *mac);

void poly1305_auth(unsigned char *mac, const unsigned char *in, size_t inlen,
		const poly1305_key *key);
int poly1305_verify(const unsigned char mac1[16], const unsigned char mac2[16]);

const char* poly1305_load(void);

#if defined(__cplusplus)
}
#endif

#endif /* POLY1305_H */