diff options
Diffstat (limited to 'src/regress/lib/libc/hash/hash_test.c')
-rw-r--r-- | src/regress/lib/libc/hash/hash_test.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/regress/lib/libc/hash/hash_test.c b/src/regress/lib/libc/hash/hash_test.c index 67b1f380ed..f9dc641186 100644 --- a/src/regress/lib/libc/hash/hash_test.c +++ b/src/regress/lib/libc/hash/hash_test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hash_test.c,v 1.1.1.1 2025/04/14 17:32:05 tb Exp $ */ | 1 | /* $OpenBSD: hash_test.c,v 1.2 2025/04/14 18:33:56 tb Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2025 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2025 Theo Buehler <tb@openbsd.org> |
@@ -25,8 +25,6 @@ | |||
25 | #include <stdio.h> | 25 | #include <stdio.h> |
26 | #include <string.h> | 26 | #include <string.h> |
27 | 27 | ||
28 | #define ALL_HASHES_ALLOW_NULL 0 | ||
29 | |||
30 | #define MAX_DIGEST_LENGTH SHA512_DIGEST_LENGTH | 28 | #define MAX_DIGEST_LENGTH SHA512_DIGEST_LENGTH |
31 | 29 | ||
32 | struct hash_test_case { | 30 | struct hash_test_case { |
@@ -48,14 +46,12 @@ enum { | |||
48 | 46 | ||
49 | /* RFC 1321, Appendix A.5 */ | 47 | /* RFC 1321, Appendix A.5 */ |
50 | static const struct hash_test_case md5_tests[] = { | 48 | static const struct hash_test_case md5_tests[] = { |
51 | #if ALL_HASHES_ALLOW_NULL | ||
52 | { | 49 | { |
53 | .out = { | 50 | .out = { |
54 | 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, | 51 | 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, |
55 | 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e, | 52 | 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e, |
56 | }, | 53 | }, |
57 | }, | 54 | }, |
58 | #endif | ||
59 | { | 55 | { |
60 | .in = "", | 56 | .in = "", |
61 | .out = { | 57 | .out = { |
@@ -131,7 +127,6 @@ md5_final(void *digest, void *ctx) | |||
131 | 127 | ||
132 | /* https://homes.esat.kuleuven.be/~bosselae/ripemd160.html */ | 128 | /* https://homes.esat.kuleuven.be/~bosselae/ripemd160.html */ |
133 | static const struct hash_test_case rmd160_tests[] = { | 129 | static const struct hash_test_case rmd160_tests[] = { |
134 | #if ALL_HASHES_ALLOW_NULL | ||
135 | { | 130 | { |
136 | .out = { | 131 | .out = { |
137 | 0x9c, 0x11, 0x85, 0xa5, 0xc5, 0xe9, 0xfc, 0x54, | 132 | 0x9c, 0x11, 0x85, 0xa5, 0xc5, 0xe9, 0xfc, 0x54, |
@@ -139,7 +134,6 @@ static const struct hash_test_case rmd160_tests[] = { | |||
139 | 0xb2, 0x25, 0x8d, 0x31, | 134 | 0xb2, 0x25, 0x8d, 0x31, |
140 | }, | 135 | }, |
141 | }, | 136 | }, |
142 | #endif | ||
143 | { | 137 | { |
144 | .in = "", | 138 | .in = "", |
145 | .out = { | 139 | .out = { |
@@ -231,7 +225,6 @@ rmd160_final(void *digest, void *ctx) | |||
231 | 225 | ||
232 | /* RFC 3174 - Appendix A (plus two zero-length tests) */ | 226 | /* RFC 3174 - Appendix A (plus two zero-length tests) */ |
233 | static const struct hash_test_case sha1_tests[] = { | 227 | static const struct hash_test_case sha1_tests[] = { |
234 | #if ALL_HASHES_ALLOW_NULL | ||
235 | { | 228 | { |
236 | .out = { | 229 | .out = { |
237 | 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, | 230 | 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, |
@@ -239,7 +232,6 @@ static const struct hash_test_case sha1_tests[] = { | |||
239 | 0xaf, 0xd8, 0x07, 0x09, | 232 | 0xaf, 0xd8, 0x07, 0x09, |
240 | }, | 233 | }, |
241 | }, | 234 | }, |
242 | #endif | ||
243 | { | 235 | { |
244 | .in = "", | 236 | .in = "", |
245 | .out = { | 237 | .out = { |