summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/regress/lib/libcrypto/sha/sha_test.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/regress/lib/libcrypto/sha/sha_test.c b/src/regress/lib/libcrypto/sha/sha_test.c
index 3137c234c5..82a0c4cceb 100644
--- a/src/regress/lib/libcrypto/sha/sha_test.c
+++ b/src/regress/lib/libcrypto/sha/sha_test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha_test.c,v 1.5 2023/07/19 15:06:57 joshua Exp $ */ 1/* $OpenBSD: sha_test.c,v 1.6 2023/07/19 15:11:42 joshua Exp $ */
2/* 2/*
3 * Copyright (c) 2022, 2023 Joshua Sing <joshua@hypera.dev> 3 * Copyright (c) 2022, 2023 Joshua Sing <joshua@hypera.dev>
4 * 4 *
@@ -38,7 +38,7 @@ static const struct sha_test sha_tests[] = {
38 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, 38 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a,
39 0xba, 0x3e, 0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c, 39 0xba, 0x3e, 0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c,
40 0x9c, 0xd0, 0xd8, 0x9d, 40 0x9c, 0xd0, 0xd8, 0x9d,
41 } 41 },
42 }, 42 },
43 { 43 {
44 .algorithm = NID_sha1, 44 .algorithm = NID_sha1,
@@ -48,7 +48,7 @@ static const struct sha_test sha_tests[] = {
48 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 48 0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d,
49 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 49 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18, 0x90,
50 0xaf, 0xd8, 0x07, 0x09, 50 0xaf, 0xd8, 0x07, 0x09,
51 } 51 },
52 }, 52 },
53 { 53 {
54 .algorithm = NID_sha1, 54 .algorithm = NID_sha1,
@@ -60,7 +60,7 @@ static const struct sha_test sha_tests[] = {
60 0x84, 0x98, 0x3e, 0x44, 0x1c, 0x3b, 0xd2, 0x6e, 60 0x84, 0x98, 0x3e, 0x44, 0x1c, 0x3b, 0xd2, 0x6e,
61 0xba, 0xae, 0x4a, 0xa1, 0xf9, 0x51, 0x29, 0xe5, 61 0xba, 0xae, 0x4a, 0xa1, 0xf9, 0x51, 0x29, 0xe5,
62 0xe5, 0x46, 0x70, 0xf1, 62 0xe5, 0x46, 0x70, 0xf1,
63 } 63 },
64 }, 64 },
65 { 65 {
66 .algorithm = NID_sha1, 66 .algorithm = NID_sha1,
@@ -73,7 +73,7 @@ static const struct sha_test sha_tests[] = {
73 0xa4, 0x9b, 0x24, 0x46, 0xa0, 0x2c, 0x64, 0x5b, 73 0xa4, 0x9b, 0x24, 0x46, 0xa0, 0x2c, 0x64, 0x5b,
74 0xf4, 0x19, 0xf9, 0x95, 0xb6, 0x70, 0x91, 0x25, 74 0xf4, 0x19, 0xf9, 0x95, 0xb6, 0x70, 0x91, 0x25,
75 0x3a, 0x04, 0xa2, 0x59, 75 0x3a, 0x04, 0xa2, 0x59,
76 } 76 },
77 }, 77 },
78 78
79 /* SHA-224 */ 79 /* SHA-224 */
@@ -86,7 +86,7 @@ static const struct sha_test sha_tests[] = {
86 0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2, 0x55, 0xb3, 86 0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2, 0x55, 0xb3,
87 0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7, 87 0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7,
88 0xe3, 0x6c, 0x9d, 0xa7, 88 0xe3, 0x6c, 0x9d, 0xa7,
89 } 89 },
90 }, 90 },
91 { 91 {
92 .algorithm = NID_sha224, 92 .algorithm = NID_sha224,
@@ -97,7 +97,7 @@ static const struct sha_test sha_tests[] = {
97 0x47, 0x61, 0x02, 0xbb, 0x28, 0x82, 0x34, 0xc4, 97 0x47, 0x61, 0x02, 0xbb, 0x28, 0x82, 0x34, 0xc4,
98 0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a, 98 0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a,
99 0xc5, 0xb3, 0xe4, 0x2f, 99 0xc5, 0xb3, 0xe4, 0x2f,
100 } 100 },
101 }, 101 },
102 { 102 {
103 .algorithm = NID_sha224, 103 .algorithm = NID_sha224,
@@ -110,7 +110,7 @@ static const struct sha_test sha_tests[] = {
110 0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50, 110 0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50,
111 0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19, 111 0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19,
112 0x52, 0x52, 0x25, 0x25, 112 0x52, 0x52, 0x25, 0x25,
113 } 113 },
114 }, 114 },
115 { 115 {
116 .algorithm = NID_sha224, 116 .algorithm = NID_sha224,
@@ -124,7 +124,7 @@ static const struct sha_test sha_tests[] = {
124 0x7a, 0x04, 0xa9, 0x6d, 0xef, 0x6d, 0x99, 0xa9, 124 0x7a, 0x04, 0xa9, 0x6d, 0xef, 0x6d, 0x99, 0xa9,
125 0xe0, 0xe0, 0xe2, 0xab, 0x14, 0xe6, 0xb8, 0xdf, 125 0xe0, 0xe0, 0xe2, 0xab, 0x14, 0xe6, 0xb8, 0xdf,
126 0x26, 0x5f, 0xc0, 0xb3, 126 0x26, 0x5f, 0xc0, 0xb3,
127 } 127 },
128 }, 128 },
129 129
130 /* SHA-256 */ 130 /* SHA-256 */
@@ -137,7 +137,7 @@ static const struct sha_test sha_tests[] = {
137 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23, 137 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
138 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 138 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
139 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad, 139 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad,
140 } 140 },
141 }, 141 },
142 { 142 {
143 .algorithm = NID_sha256, 143 .algorithm = NID_sha256,
@@ -148,7 +148,7 @@ static const struct sha_test sha_tests[] = {
148 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 148 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24,
149 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 149 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c,
150 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55, 150 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55,
151 } 151 },
152 }, 152 },
153 { 153 {
154 .algorithm = NID_sha256, 154 .algorithm = NID_sha256,
@@ -161,7 +161,7 @@ static const struct sha_test sha_tests[] = {
161 0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39, 161 0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
162 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67, 162 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
163 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1, 163 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1,
164 } 164 },
165 }, 165 },
166 { 166 {
167 .algorithm = NID_sha256, 167 .algorithm = NID_sha256,
@@ -175,7 +175,7 @@ static const struct sha_test sha_tests[] = {
175 0x03, 0x6c, 0xe5, 0x9e, 0x7b, 0x04, 0x92, 0x37, 175 0x03, 0x6c, 0xe5, 0x9e, 0x7b, 0x04, 0x92, 0x37,
176 0x0b, 0x24, 0x9b, 0x11, 0xe8, 0xf0, 0x7a, 0x51, 176 0x0b, 0x24, 0x9b, 0x11, 0xe8, 0xf0, 0x7a, 0x51,
177 0xaf, 0xac, 0x45, 0x03, 0x7a, 0xfe, 0xe9, 0xd1, 177 0xaf, 0xac, 0x45, 0x03, 0x7a, 0xfe, 0xe9, 0xd1,
178 } 178 },
179 }, 179 },
180 180
181 /* SHA-384 */ 181 /* SHA-384 */
@@ -190,7 +190,7 @@ static const struct sha_test sha_tests[] = {
190 0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed, 190 0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed,
191 0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23, 191 0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23,
192 0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7, 192 0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7,
193 } 193 },
194 }, 194 },
195 { 195 {
196 .algorithm = NID_sha384, 196 .algorithm = NID_sha384,
@@ -203,7 +203,7 @@ static const struct sha_test sha_tests[] = {
203 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, 203 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda,
204 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, 204 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb,
205 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b, 205 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b,
206 } 206 },
207 }, 207 },
208 { 208 {
209 .algorithm = NID_sha384, 209 .algorithm = NID_sha384,
@@ -218,7 +218,7 @@ static const struct sha_test sha_tests[] = {
218 0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6, 218 0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6,
219 0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f, 219 0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f,
220 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b, 220 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b,
221 } 221 },
222 }, 222 },
223 { 223 {
224 .algorithm = NID_sha384, 224 .algorithm = NID_sha384,
@@ -234,7 +234,7 @@ static const struct sha_test sha_tests[] = {
234 0x2f, 0xa0, 0x80, 0x86, 0xe3, 0xb0, 0xf7, 0x12, 234 0x2f, 0xa0, 0x80, 0x86, 0xe3, 0xb0, 0xf7, 0x12,
235 0xfc, 0xc7, 0xc7, 0x1a, 0x55, 0x7e, 0x2d, 0xb9, 235 0xfc, 0xc7, 0xc7, 0x1a, 0x55, 0x7e, 0x2d, 0xb9,
236 0x66, 0xc3, 0xe9, 0xfa, 0x91, 0x74, 0x60, 0x39, 236 0x66, 0xc3, 0xe9, 0xfa, 0x91, 0x74, 0x60, 0x39,
237 } 237 },
238 }, 238 },
239 239
240 /* SHA-512 */ 240 /* SHA-512 */
@@ -251,7 +251,7 @@ static const struct sha_test sha_tests[] = {
251 0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd, 251 0x36, 0xba, 0x3c, 0x23, 0xa3, 0xfe, 0xeb, 0xbd,
252 0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e, 252 0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8, 0x0e,
253 0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f, 253 0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f,
254 } 254 },
255 }, 255 },
256 { 256 {
257 .algorithm = NID_sha512, 257 .algorithm = NID_sha512,
@@ -266,7 +266,7 @@ static const struct sha_test sha_tests[] = {
266 0xff, 0x83, 0x18, 0xd2, 0x87, 0x7e, 0xec, 0x2f, 266 0xff, 0x83, 0x18, 0xd2, 0x87, 0x7e, 0xec, 0x2f,
267 0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81, 267 0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a, 0x81,
268 0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e, 268 0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e,
269 } 269 },
270 }, 270 },
271 { 271 {
272 .algorithm = NID_sha512, 272 .algorithm = NID_sha512,
@@ -283,7 +283,7 @@ static const struct sha_test sha_tests[] = {
283 0xaa, 0x1d, 0x3b, 0xea, 0x57, 0x78, 0x9c, 0xa0, 283 0xaa, 0x1d, 0x3b, 0xea, 0x57, 0x78, 0x9c, 0xa0,
284 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03, 284 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7, 0x03,
285 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45, 285 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45,
286 } 286 },
287 }, 287 },
288 { 288 {
289 .algorithm = NID_sha512, 289 .algorithm = NID_sha512,
@@ -301,7 +301,7 @@ static const struct sha_test sha_tests[] = {
301 0x33, 0x1b, 0x99, 0xde, 0xc4, 0xb5, 0x43, 0x3a, 301 0x33, 0x1b, 0x99, 0xde, 0xc4, 0xb5, 0x43, 0x3a,
302 0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26, 0x54, 302 0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26, 0x54,
303 0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09, 303 0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09,
304 } 304 },
305 }, 305 },
306 306
307 /* SHA3-224 */ 307 /* SHA3-224 */
@@ -550,7 +550,7 @@ static const struct sha_repetition_test sha_repetition_tests[] = {
550 0x34, 0xaa, 0x97, 0x3c, 0xd4, 0xc4, 0xda, 0xa4, 550 0x34, 0xaa, 0x97, 0x3c, 0xd4, 0xc4, 0xda, 0xa4,
551 0xf6, 0x1e, 0xeb, 0x2b, 0xdb, 0xad, 0x27, 0x31, 551 0xf6, 0x1e, 0xeb, 0x2b, 0xdb, 0xad, 0x27, 0x31,
552 0x65, 0x34, 0x01, 0x6f, 552 0x65, 0x34, 0x01, 0x6f,
553 } 553 },
554 }, 554 },
555 555
556 /* SHA-224 */ 556 /* SHA-224 */
@@ -563,7 +563,7 @@ static const struct sha_repetition_test sha_repetition_tests[] = {
563 0xbb, 0xb4, 0xc1, 0xea, 0x97, 0x61, 0x8a, 0x4b, 563 0xbb, 0xb4, 0xc1, 0xea, 0x97, 0x61, 0x8a, 0x4b,
564 0xf0, 0x3f, 0x42, 0x58, 0x19, 0x48, 0xb2, 0xee, 564 0xf0, 0x3f, 0x42, 0x58, 0x19, 0x48, 0xb2, 0xee,
565 0x4e, 0xe7, 0xad, 0x67, 565 0x4e, 0xe7, 0xad, 0x67,
566 } 566 },
567 }, 567 },
568 568
569 /* SHA-256 */ 569 /* SHA-256 */
@@ -576,7 +576,7 @@ static const struct sha_repetition_test sha_repetition_tests[] = {
576 0x81, 0xa1, 0xc7, 0xe2, 0x84, 0xd7, 0x3e, 0x67, 576 0x81, 0xa1, 0xc7, 0xe2, 0x84, 0xd7, 0x3e, 0x67,
577 0xf1, 0x80, 0x9a, 0x48, 0xa4, 0x97, 0x20, 0x0e, 577 0xf1, 0x80, 0x9a, 0x48, 0xa4, 0x97, 0x20, 0x0e,
578 0x04, 0x6d, 0x39, 0xcc, 0xc7, 0x11, 0x2c, 0xd0, 578 0x04, 0x6d, 0x39, 0xcc, 0xc7, 0x11, 0x2c, 0xd0,
579 } 579 },
580 }, 580 },
581 581
582 /* SHA-384 */ 582 /* SHA-384 */
@@ -591,7 +591,7 @@ static const struct sha_repetition_test sha_repetition_tests[] = {
591 0x79, 0x72, 0xce, 0xc5, 0x70, 0x4c, 0x2a, 0x5b, 591 0x79, 0x72, 0xce, 0xc5, 0x70, 0x4c, 0x2a, 0x5b,
592 0x07, 0xb8, 0xb3, 0xdc, 0x38, 0xec, 0xc4, 0xeb, 592 0x07, 0xb8, 0xb3, 0xdc, 0x38, 0xec, 0xc4, 0xeb,
593 0xae, 0x97, 0xdd, 0xd8, 0x7f, 0x3d, 0x89, 0x85, 593 0xae, 0x97, 0xdd, 0xd8, 0x7f, 0x3d, 0x89, 0x85,
594 } 594 },
595 }, 595 },
596 596
597 /* SHA-512 */ 597 /* SHA-512 */
@@ -608,7 +608,7 @@ static const struct sha_repetition_test sha_repetition_tests[] = {
608 0x4c, 0xb0, 0x43, 0x2c, 0xe5, 0x77, 0xc3, 0x1b, 608 0x4c, 0xb0, 0x43, 0x2c, 0xe5, 0x77, 0xc3, 0x1b,
609 0xeb, 0x00, 0x9c, 0x5c, 0x2c, 0x49, 0xaa, 0x2e, 609 0xeb, 0x00, 0x9c, 0x5c, 0x2c, 0x49, 0xaa, 0x2e,
610 0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b, 610 0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b,
611 } 611 },
612 }, 612 },
613 613
614 /* SHA3-224 */ 614 /* SHA3-224 */