Revert "Merge branch 'upstream' into tizen"
[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   "arcfour128",
13   "camellia128",
14   "camellia192",
15   "camellia256",
16   "cast128",
17   "serpent128",
18   "serpent192",
19   "serpent256",
20   "twofish128",
21   "twofish192",
22   "twofish256"
23 };
24
25 void
26 test_main(void)
27 {
28   int i,j;
29   int count = sizeof(ciphers)/sizeof(*ciphers);
30   for (i = 0; i < count; i++) {
31     for (j = 0; NULL != nettle_ciphers[j]; j++) {
32       if (0 == strcmp(ciphers[i], nettle_ciphers[j]->name))
33         break;
34     }
35     ASSERT(NULL != nettle_ciphers[j]); /* make sure we found a matching cipher */
36   }
37   j = 0;
38   while (NULL != nettle_ciphers[j])
39     j++;
40   ASSERT(j == count); /* we are not missing testing any ciphers */
41 }
42