summaryrefslogtreecommitdiff
path: root/testsuite/meta-mac-test.c
blob: adbd432638010f374fec4a318c6bbb4a0c2a7a1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "testutils.h"
#include "nettle-meta.h"

const char* macs[] = {
  "cmac_aes128",
  "cmac_aes256",
  "cmac_des3",
  "hmac_md5",
  "hmac_ripemd160",
  "hmac_sha1",
  "hmac_sha224",
  "hmac_sha256",
  "hmac_sha384",
  "hmac_sha512",
  "hmac_streebog256",
  "hmac_streebog512",
};

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 */
}