summaryrefslogtreecommitdiff
path: root/nettle-meta-macs.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2020-02-09 14:13:22 +0100
committerNiels Möller <nisse@lysator.liu.se>2020-02-09 14:13:22 +0100
commitd7f2dae963d279782582d785c80ddef377dfe6dc (patch)
tree3db098a5befa00d7e4a8cd40f5c0b2b55d17fc6b /nettle-meta-macs.c
parent07309ccbe5b6766441b7ae60fd9b8a8cf527511d (diff)
downloadnettle-d7f2dae963d279782582d785c80ddef377dfe6dc.tar.gz
nettle-meta: Expose defined MACs through nettle_macsmove-nettle_mac
Based on patches by Daiki Ueno.
Diffstat (limited to 'nettle-meta-macs.c')
-rw-r--r--nettle-meta-macs.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/nettle-meta-macs.c b/nettle-meta-macs.c
new file mode 100644
index 00000000..cb9ede85
--- /dev/null
+++ b/nettle-meta-macs.c
@@ -0,0 +1,57 @@
+/* nettle-meta-macs.c
+
+ Copyright (C) 2020 Daiki Ueno
+
+ This file is part of GNU Nettle.
+
+ GNU Nettle is free software: you can redistribute it and/or
+ modify it under the terms of either:
+
+ * the GNU Lesser General Public License as published by the Free
+ Software Foundation; either version 3 of the License, or (at your
+ option) any later version.
+
+ or
+
+ * the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ or both in parallel, as here.
+
+ GNU Nettle 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
+ General Public License for more details.
+
+ You should have received copies of the GNU General Public License and
+ the GNU Lesser General Public License along with this program. If
+ not, see http://www.gnu.org/licenses/.
+*/
+
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stddef.h>
+
+#include "nettle-meta.h"
+
+const struct nettle_mac * const _nettle_macs[] = {
+ &nettle_cmac_aes128,
+ &nettle_cmac_aes256,
+ &nettle_hmac_md5,
+ &nettle_hmac_ripemd160,
+ &nettle_hmac_sha1,
+ &nettle_hmac_sha224,
+ &nettle_hmac_sha256,
+ &nettle_hmac_sha384,
+ &nettle_hmac_sha512,
+ NULL
+};
+
+const struct nettle_mac * const *
+nettle_get_macs (void)
+{
+ return _nettle_macs;
+}