summaryrefslogtreecommitdiff
path: root/umac-nh-n.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-04-11 14:57:24 +0200
committerNiels Möller <nisse@lysator.liu.se>2013-04-11 14:57:24 +0200
commit34aef19b0f571e24b575a92d0262df7fe755bf6b (patch)
tree121ae6bd0c4d973de2891a215f1e9da33c199d71 /umac-nh-n.c
parentc6f38f5f318f4d1cc816385157cbf09197c54d07 (diff)
downloadnettle-34aef19b0f571e24b575a92d0262df7fe755bf6b.tar.gz
Implemented umac.
Diffstat (limited to 'umac-nh-n.c')
-rw-r--r--umac-nh-n.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/umac-nh-n.c b/umac-nh-n.c
new file mode 100644
index 00000000..953fb2f6
--- /dev/null
+++ b/umac-nh-n.c
@@ -0,0 +1,38 @@
+/* umac-nh-n.c
+ */
+
+/* nettle, low-level cryptographics library
+ *
+ * Copyright (C) 2013 Niels Möller
+ *
+ * The nettle library is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or (at your
+ * option) any later version.
+ *
+ * The nettle library 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with the nettle library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02111-1301, USA.
+ */
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "umac.h"
+
+/* FIXME: Single pass over the input */
+void
+_umac_nh_n (uint64_t *out, unsigned n, const uint32_t *key,
+ unsigned length, const uint8_t *msg)
+{
+ unsigned i;
+ for (i = 0; i < n; i++)
+ out[i] = _umac_nh (key + 4*i, length, msg);
+}