summaryrefslogtreecommitdiff
path: root/cipher-chachapoly.h
diff options
context:
space:
mode:
Diffstat (limited to 'cipher-chachapoly.h')
-rw-r--r--cipher-chachapoly.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/cipher-chachapoly.h b/cipher-chachapoly.h
index b7072be7d..026d2de93 100644
--- a/cipher-chachapoly.h
+++ b/cipher-chachapoly.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher-chachapoly.h,v 1.4 2014/06/24 01:13:21 djm Exp $ */ 1/* $OpenBSD: cipher-chachapoly.h,v 1.5 2020/04/03 04:27:03 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) Damien Miller 2013 <djm@mindrot.org> 4 * Copyright (c) Damien Miller 2013 <djm@mindrot.org>
@@ -24,13 +24,12 @@
24 24
25#define CHACHA_KEYLEN 32 /* Only 256 bit keys used here */ 25#define CHACHA_KEYLEN 32 /* Only 256 bit keys used here */
26 26
27struct chachapoly_ctx { 27struct chachapoly_ctx;
28 struct chacha_ctx main_ctx, header_ctx; 28
29}; 29struct chachapoly_ctx *chachapoly_new(const u_char *key, u_int keylen)
30 __attribute__((__bounded__(__buffer__, 1, 2)));
31void chachapoly_free(struct chachapoly_ctx *cpctx);
30 32
31int chachapoly_init(struct chachapoly_ctx *cpctx,
32 const u_char *key, u_int keylen)
33 __attribute__((__bounded__(__buffer__, 2, 3)));
34int chachapoly_crypt(struct chachapoly_ctx *cpctx, u_int seqnr, 33int chachapoly_crypt(struct chachapoly_ctx *cpctx, u_int seqnr,
35 u_char *dest, const u_char *src, u_int len, u_int aadlen, u_int authlen, 34 u_char *dest, const u_char *src, u_int len, u_int aadlen, u_int authlen,
36 int do_encrypt); 35 int do_encrypt);