From 0fde8acdad78a4d20cadae974376cc0165f645ee Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 21 Nov 2013 14:12:23 +1100 Subject: - djm@cvs.openbsd.org 2013/11/21 00:45:44 [Makefile.in PROTOCOL PROTOCOL.chacha20poly1305 authfile.c chacha.c] [chacha.h cipher-chachapoly.c cipher-chachapoly.h cipher.c cipher.h] [dh.c myproposal.h packet.c poly1305.c poly1305.h servconf.c ssh.1] [ssh.c ssh_config.5 sshd_config.5] Add a new protocol 2 transport cipher "chacha20-poly1305@openssh.com" that combines Daniel Bernstein's ChaCha20 stream cipher and Poly1305 MAC to build an authenticated encryption mode. Inspired by and similar to Adam Langley's proposal for TLS: http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-03 but differs in layout used for the MAC calculation and the use of a second ChaCha20 instance to separately encrypt packet lengths. Details are in the PROTOCOL.chacha20poly1305 file. Feedback markus@, naddy@; manpage bits Loganden Velvindron @ AfriNIC ok markus@ naddy@ --- poly1305.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 poly1305.h (limited to 'poly1305.h') diff --git a/poly1305.h b/poly1305.h new file mode 100644 index 000000000..a31fb7425 --- /dev/null +++ b/poly1305.h @@ -0,0 +1,22 @@ +/* $OpenBSD: poly1305.h,v 1.1 2013/11/21 00:45:44 djm Exp $ */ + +/* + * Public Domain poly1305 from Andrew M. + * poly1305-donna-unrolled.c from https://github.com/floodyberry/poly1305-donna + */ + +#ifndef POLY1305_H +#define POLY1305_H + +#include + +#define POLY1305_KEYLEN 32 +#define POLY1305_TAGLEN 16 + +void poly1305_auth(u_char out[POLY1305_TAGLEN], const u_char *m, size_t inlen, + const u_char key[POLY1305_KEYLEN]) + __attribute__((__bounded__(__minbytes__, 1, POLY1305_TAGLEN))) + __attribute__((__bounded__(__buffer__, 2, 3))) + __attribute__((__bounded__(__minbytes__, 4, POLY1305_KEYLEN))); + +#endif /* POLY1305_H */ -- cgit v1.2.3 From 339a48fe7ffb3186d22bbaa9efbbc3a053e602fd Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 29 Dec 2013 17:46:49 +1100 Subject: - djm@cvs.openbsd.org 2013/12/19 22:57:13 [poly1305.c poly1305.h] use full name for author, with his permission --- ChangeLog | 3 +++ poly1305.c | 4 ++-- poly1305.h | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'poly1305.h') diff --git a/ChangeLog b/ChangeLog index 604bbbb78..339140fe3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,9 @@ bz#2186: don't crash (NULL deref) when deleting PKCS#11 keys from an agent that has a mix of normal and PKCS#11 keys; fix from jay AT slushpupie.com; ok dtucker + - djm@cvs.openbsd.org 2013/12/19 22:57:13 + [poly1305.c poly1305.h] + use full name for author, with his permission 20131221 - (dtucker) [regress/keytype.sh] Actually test ecdsa key types. diff --git a/poly1305.c b/poly1305.c index 059cc60f7..a5eada498 100644 --- a/poly1305.c +++ b/poly1305.c @@ -1,9 +1,9 @@ /* - * Public Domain poly1305 from Andrew M. + * Public Domain poly1305 from Andrew Moon * poly1305-donna-unrolled.c from https://github.com/floodyberry/poly1305-donna */ -/* $OpenBSD: poly1305.c,v 1.2 2013/11/21 02:50:00 djm Exp $ */ +/* $OpenBSD: poly1305.c,v 1.3 2013/12/19 22:57:13 djm Exp $ */ #include "includes.h" diff --git a/poly1305.h b/poly1305.h index a31fb7425..221efc462 100644 --- a/poly1305.h +++ b/poly1305.h @@ -1,7 +1,7 @@ -/* $OpenBSD: poly1305.h,v 1.1 2013/11/21 00:45:44 djm Exp $ */ +/* $OpenBSD: poly1305.h,v 1.2 2013/12/19 22:57:13 djm Exp $ */ /* - * Public Domain poly1305 from Andrew M. + * Public Domain poly1305 from Andrew Moon * poly1305-donna-unrolled.c from https://github.com/floodyberry/poly1305-donna */ -- cgit v1.2.3