cfb8: Fix decrypt path
[gd/nettle] / testsuite / meta-hash-test.c
1 #include "testutils.h"
2 #include "nettle-internal.h"
3 #include "nettle-meta.h"
4 /* For NETTLE_MAX_HASH_CONTEXT_SIZE */
5 #include "sha3.h"
6
7 const char* hashes[] = {
8   "gosthash94",
9   "gosthash94cp",
10   "md2",
11   "md4",
12   "md5",
13   "ripemd160",
14   "sha1",
15   "sha224",
16   "sha256",
17   "sha384",
18   "sha512",
19   "sha3_224",
20   "sha3_256",
21   "sha3_384",
22   "sha3_512",
23 };
24
25 void
26 test_main(void)
27 {
28   int i;
29   int count = sizeof(hashes)/sizeof(*hashes);
30   for (i = 0; i < count; i++) {
31     /* make sure we found a matching hash */
32     ASSERT(nettle_lookup_hash(hashes[i]) != NULL);
33   }
34
35   for (i = 0; NULL != nettle_hashes[i]; i++) {
36     ASSERT(nettle_hashes[i]->digest_size <= NETTLE_MAX_HASH_DIGEST_SIZE);
37     ASSERT(nettle_hashes[i]->context_size <= NETTLE_MAX_HASH_CONTEXT_SIZE);
38   }
39   ASSERT(i == count); /* we are not missing testing any hashes */
40 }