18 #ifndef CHACHA_POLY_AEAD_H
19 #define CHACHA_POLY_AEAD_H
21 #include <sys/types.h>
25 #define CHACHA_KEYLEN 32
27 struct chachapoly_ctx;
29 struct chachapoly_ctx *chachapoly_new(
const u_char *key, u_int keylen)
30 __attribute__((__bounded__(__buffer__, 1, 2)));
31 void chachapoly_free(
struct chachapoly_ctx *cpctx);
33 int chachapoly_crypt(
struct chachapoly_ctx *cpctx, u_int seqnr,
34 u_char *dest,
const u_char *src, u_int len, u_int aadlen, u_int authlen,
36 int chachapoly_get_length(
struct chachapoly_ctx *cpctx,
37 u_int *plenp, u_int seqnr,
const u_char *cp, u_int len)
38 __attribute__((__bounded__(__buffer__, 4, 5)));