aboutsummaryrefslogtreecommitdiffstats
path: root/sha_224.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-24 11:26:42 +0200
committerMattias Andrée <maandree@kth.se>2024-08-24 11:26:42 +0200
commit3a73ab675a19e2ea29b4cb1385db0188ce4997f8 (patch)
treeb010de454a833b01fe2ed469fd4f0fd699c59e50 /sha_224.c
parentTest partial byte support in SHA1 and SHA-224 (diff)
downloadlibhashsum-3a73ab675a19e2ea29b4cb1385db0188ce4997f8.tar.gz
libhashsum-3a73ab675a19e2ea29b4cb1385db0188ce4997f8.tar.bz2
libhashsum-3a73ab675a19e2ea29b4cb1385db0188ce4997f8.tar.xz
Make algorithms optional
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'sha_224.c')
-rw-r--r--sha_224.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sha_224.c b/sha_224.c
index bffca4c..f0a9287 100644
--- a/sha_224.c
+++ b/sha_224.c
@@ -1,6 +1,7 @@
/* See LICENSE file for copyright and license details. */
-#define TEST
-#include "common.h"
+#ifdef SUPPORT_SHA2
+# define TEST
+# include "common.h"
static struct testcase testcases[] = {
@@ -12,11 +13,11 @@ static struct testcase testcases[] = {
{1000UL, 0, "A", "a8d0c66b5c6fdfd836eb3c6d04d32dfe66c3b1f168b488bf4c9c66ce"},
{1005UL, 0, "\x99", "cb00ecd03788bf6c0908401e0eb053ac61f35e7e20a2cfd7bd96d640"},
{1000000UL, 8, "\0", "3a5d74b68f14f3a4b2be9289b8d370672d0b3d2f53bc303c59032df3"},
-#ifdef MASSIVE_TESTS
+# ifdef MASSIVE_TESTS
{0x20000000UL, 0, "A", "c4250083cf8230bf21065b3014baaaf9f76fecefc21f91cf237dedc9"},
{0x41000000UL, 8, "\0", "014674abc5cb980199935695af22fab683748f4261d4c6492b77c543"},
{0x6000003FUL, 0, "\x84", "a654b50b767a8323c5b519f467d8669837142881dc7ad368a7d5ef8f"},
-#endif
+# endif
{1, 0, "abc", "23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7"},
{1, 0, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525"},
@@ -30,6 +31,12 @@ static struct testcase testcases[] = {
};
+#else
+# define TEST_UNSUPPORTED
+# include "common.h"
+#endif
+
+
int
main(void)
{