aboutsummaryrefslogtreecommitdiffstats
path: root/sha_512.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_512.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_512.c')
-rw-r--r--sha_512.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sha_512.c b/sha_512.c
index c3d07f1..01b9460 100644
--- a/sha_512.c
+++ b/sha_512.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[] = {
@@ -31,7 +32,7 @@ static struct testcase testcases[] = {
{1000000UL, 8, "\0",
"ce044bc9fd43269d5bbc946cbebc3bb711341115cc4abdf2edbc3ff2c57ad4b1"
"5deb699bda257fea5aef9c6e55fcf4cf9dc25a8c3ce25f2efe90908379bff7ed"},
-#ifdef MASSIVE_TESTS
+# ifdef MASSIVE_TESTS
{0x20000000UL, 0, "Z",
"da172279f3ebbda95f6b6e1e5f0ebec682c25d3d93561a1624c2fa9009d64c7e"
"9923f3b46bcaf11d39a531f43297992ba4155c7e827bd0f1e194ae7ed6de4cac"},
@@ -41,7 +42,7 @@ static struct testcase testcases[] = {
{0x6000003EUL, 0, "B",
"fd05e13eb771f05190bd97d62647157ea8f1f6949a52bb6daaedbad5f578ec59"
"b1b8d6c4a7ecb2feca6892b4dc138771670a0f3bd577eea326aed40ab7dd58b1"},
-#endif
+# endif
{1, 0, "abc",
"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a"
"2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"},
@@ -52,6 +53,12 @@ static struct testcase testcases[] = {
};
+#else
+# define TEST_UNSUPPORTED
+# include "common.h"
+#endif
+
+
int
main(void)
{