3 * AEAD schemes based on Salsa20/ChaCha and Poly1305
5 * (c) 2018 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Catacomb.
12 * Catacomb is free software: you can redistribute it and/or modify it
13 * under the terms of the GNU Library General Public License as published
14 * by the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * Catacomb is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with Catacomb. If not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
28 /*----- Notes on this construction ----------------------------------------*
30 * The AEAD class @chacha20_poly1305@ with a 96-bit nonce is exactly the
31 * scheme specified in RFC7539. This implementation extends that
32 * specification in two ways:
34 * * It permits ciphers other than ChaCha20: specifically ChaCha%$r$% and
35 * Salsa20/%$r$% with %$r \in \{ 8, 12, 20 \}$%.
37 * * It allows nonces of 64, 96, and 192 bits. A 64-bit nonce matches
38 * Bernstein's original specification of Salsa20 and ChaCha; the 96-bit
39 * nonce matches RFC7539; and the 192-bit nonce matches Bernstein's
40 * XSalsa20. The implementation uses XSalsa20 or XChaCha as appropriate
41 * automatically based on the provided nonce length.
43 * These extensions do not significantly affect Procter's security analysis
44 * except that an application should not mix nonce sizes with the same key.
45 * (It is possible to do this safely, but it requires detailed understanding
46 * of how everything fits together and isn't worth the effort.)
49 #ifndef CATACOMB_LATINPOLY_H
50 #define CATACOMB_LATINPOLY_H
56 /*----- Header files ------------------------------------------------------*/
58 #ifndef CATACOMB_GAEAD_H
62 /*----- Definitions -------------------------------------------------------*/
65 chacha20_poly1305, chacha12_poly1305, chacha8_poly1305,
66 salsa20_poly1305, salsa2012_poly1305, salsa208_poly1305;
68 /*----- That's all, folks -------------------------------------------------*/