f949fd76aabb5c678ef413e489d1542ea984ee96
[platform/upstream/nettle.git] / testsuite / meta-cipher-test.c
1 #include "testutils.h"
2 #include "nettle-meta.h"
3
4 const char* ciphers[] = {
5   "aes128",
6   "aes192",
7   "aes256",
8   "arctwo40",
9   "arctwo64",
10   "arctwo128",
11   "arctwo_gutmann128",
12   "camellia128",
13   "camellia192",
14   "camellia256",
15   "cast128",
16   "serpent128",
17   "serpent192",
18   "serpent256",
19   "twofish128",
20   "twofish192",
21   "twofish256"
22 };
23
24 void
25 test_main(void)
26 {
27   int i,j;
28   int count = sizeof(ciphers)/sizeof(*ciphers);
29   for (i = 0; i < count; i++) {
30     for (j = 0; NULL != nettle_ciphers[j]; j++) {
31       if (0 == strcmp(ciphers[i], nettle_ciphers[j]->name))
32         break;
33     }
34     ASSERT(NULL != nettle_ciphers[j]); /* make sure we found a matching cipher */
35   }
36   j = 0;
37   while (NULL != nettle_ciphers[j])
38     j++;
39   ASSERT(j == count); /* we are not missing testing any ciphers */
40 }
41