summaryrefslogtreecommitdiff
path: root/testsuite/meta-mac-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/meta-mac-test.c')
-rw-r--r--testsuite/meta-mac-test.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/meta-mac-test.c b/testsuite/meta-mac-test.c
new file mode 100644
index 00000000..32b6f20f
--- /dev/null
+++ b/testsuite/meta-mac-test.c
@@ -0,0 +1,32 @@
+#include "testutils.h"
+#include "nettle-meta.h"
+
+const char* macs[] = {
+ "cmac_aes128",
+ "cmac_aes256",
+ "hmac_md5",
+ "hmac_ripemd160",
+ "hmac_sha1",
+ "hmac_sha224",
+ "hmac_sha256",
+ "hmac_sha384",
+ "hmac_sha512",
+};
+
+void
+test_main(void)
+{
+ int i, j;
+ int count = sizeof(macs)/sizeof(*macs);
+ for (i = 0; i < count; i++) {
+ for (j = 0; NULL != nettle_macs[j]; j++) {
+ if (0 == strcmp(macs[i], nettle_macs[j]->name))
+ break;
+ }
+ ASSERT(NULL != nettle_macs[j]); /* make sure we found a matching mac */
+ }
+ i = 0;
+ while (NULL != nettle_macs[i])
+ i++;
+ ASSERT(i == count); /* we are not missing testing any macs */
+}