diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-04-03 04:27:03 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-04-03 15:36:57 +1100 |
commit | eba523f0a130f1cce829e6aecdcefa841f526a1a (patch) | |
tree | af27de3afbd97d4fdcbc2515f0ee5a608bd32af2 /cipher-chachapoly.h | |
parent | ebd29e90129cf18fedfcfe1de86e324228669295 (diff) |
upstream: make Chacha20-POLY1305 context struct opaque; ok tb@ as
part of a larger diff at a2k20
OpenBSD-Commit-ID: a4609b7263284f95c9417ef60ed7cdbb7bf52cfd
Diffstat (limited to 'cipher-chachapoly.h')
-rw-r--r-- | cipher-chachapoly.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cipher-chachapoly.h b/cipher-chachapoly.h index b7072be7..026d2de9 100644 --- a/cipher-chachapoly.h +++ b/cipher-chachapoly.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-chachapoly.h,v 1.4 2014/06/24 01:13:21 djm Exp $ */ +/* $OpenBSD: cipher-chachapoly.h,v 1.5 2020/04/03 04:27:03 djm Exp $ */ /* * Copyright (c) Damien Miller 2013 <djm@mindrot.org> @@ -24,13 +24,12 @@ #define CHACHA_KEYLEN 32 /* Only 256 bit keys used here */ -struct chachapoly_ctx { - struct chacha_ctx main_ctx, header_ctx; -}; +struct chachapoly_ctx; + +struct chachapoly_ctx *chachapoly_new(const u_char *key, u_int keylen) + __attribute__((__bounded__(__buffer__, 1, 2))); +void chachapoly_free(struct chachapoly_ctx *cpctx); -int chachapoly_init(struct chachapoly_ctx *cpctx, - const u_char *key, u_int keylen) - __attribute__((__bounded__(__buffer__, 2, 3))); int chachapoly_crypt(struct chachapoly_ctx *cpctx, u_int seqnr, u_char *dest, const u_char *src, u_int len, u_int aadlen, u_int authlen, int do_encrypt); |