3 * AEAD schemes based on Salsa20 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 /*----- Header files ------------------------------------------------------*/
30 #include "latinpoly-def.h"
33 /*----- Main code ---------------------------------------------------------*/
35 LATINPOLY_DEF(salsa20
, salsa20
, "salsa20")
36 LATINPOLY_DEF(salsa2012
, salsa20
, "salsa20/12")
37 LATINPOLY_DEF(salsa208
, salsa20
, "salsa20/8")
39 /*----- Test rig ----------------------------------------------------------*/
43 #include <mLib/quis.h>
44 #include <mLib/testrig.h>
45 #include "latinpoly-test.h"
47 static int check_salsa20(dstr
*v
)
48 { return latinpoly_test(&salsa20_poly1305
, v
); }
49 static int check_salsa2012(dstr
*v
)
50 { return latinpoly_test(&salsa2012_poly1305
, v
); }
51 static int check_salsa208(dstr
*v
)
52 { return latinpoly_test(&salsa208_poly1305
, v
); }
54 static const test_chunk tests
[] = {
55 { "salsa20-poly1305", check_salsa20
,
56 { &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
} },
57 { "salsa20/12-poly1305", check_salsa2012
,
58 { &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
} },
59 { "salsa20/8-poly1305", check_salsa208
,
60 { &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
, &type_hex
} },
65 int main(int argc
, char *argv
[])
68 test_run(argc
, argv
, tests
, SRCDIR
"/t/salsa20");
73 /*----- That's all, folks -------------------------------------------------*/