From 3a73ab675a19e2ea29b4cb1385db0188ce4997f8 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Aug 2024 11:26:42 +0200 Subject: Make algorithms optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- sha_224.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sha_224.c') 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) { -- cgit v1.2.3-70-g09d2