symm/latinpoly.c, etc.: AEADs based on Salsa20 and ChaCha with Poly1305.
[catacomb] / symm / latinpoly-test.h
diff --git a/symm/latinpoly-test.h b/symm/latinpoly-test.h
new file mode 100644 (file)
index 0000000..2cafef3
--- /dev/null
@@ -0,0 +1,65 @@
+/* -*-c-*-
+ *
+ * Testing for AEAD schemes based on Salsa20/ChaCha and Poly1305
+ *
+ * (c) 2018 Straylight/Edgeware
+ */
+
+/*----- Licensing notice --------------------------------------------------*
+ *
+ * This file is part of Catacomb.
+ *
+ * Catacomb is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Catacomb is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with Catacomb.  If not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+#ifndef CATACOMB_LATINPOLY_TEST_H
+#define CATACOMB_LATINPOLY_TEST_H
+
+#ifdef __cplusplus
+  extern "C" {
+#endif
+
+/*----- Header files ------------------------------------------------------*/
+
+#include <mLib/dstr.h>
+#include <mLib/testrig.h>
+
+#ifndef CATACOMB_GAEAD_H
+#  include "gaead.h"
+#endif
+
+/*----- Functions provided ------------------------------------------------*/
+
+/* --- @latinpoly_test@ --- *
+ *
+ * Arguments:  @gcaead *aec@ = authenticated encryption class to test
+ *             @dstr *v@ = pointer to test-vector
+ *
+ * Returns:    Nonzero if the test passed, zero on failure.
+ *
+ * Use:                Checks a test vector.  This internal function is not
+ *             available outside of Catacomb's build tree.
+ */
+
+extern int latinpoly_test(const gcaead */*aec*/, dstr */*v*/);
+
+/*----- That's all, folks -------------------------------------------------*/
+
+#ifdef __cplusplus
+  }
+#endif
+
+#endif