diff options
-rw-r--r-- | src/microhttpd/test_md5.c | 12 | ||||
-rw-r--r-- | src/microhttpd/test_sha256.c | 12 | ||||
-rw-r--r-- | src/microhttpd/test_sha512_256.c | 12 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/microhttpd/test_md5.c b/src/microhttpd/test_md5.c index cf7ccbd1..13f9d46e 100644 --- a/src/microhttpd/test_md5.c +++ b/src/microhttpd/test_md5.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2019 Karlson2k (Evgeny Grin) | 3 | Copyright (C) 2019-2022 Evgeny Grin (Karlson2k) |
4 | 4 | ||
5 | This test tool is free software; you can redistribute it and/or | 5 | This test tool is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU General Public License as | 6 | modify it under the terms of the GNU General Public License as |
@@ -312,10 +312,10 @@ test1_str (void) | |||
312 | { | 312 | { |
313 | unsigned int i; | 313 | unsigned int i; |
314 | int num_failed = 0; | 314 | int num_failed = 0; |
315 | struct Md5Ctx ctx; | ||
315 | 316 | ||
316 | for (i = 0; i < units1_num; i++) | 317 | for (i = 0; i < units1_num; i++) |
317 | { | 318 | { |
318 | struct Md5Ctx ctx; | ||
319 | uint8_t digest[MD5_DIGEST_SIZE]; | 319 | uint8_t digest[MD5_DIGEST_SIZE]; |
320 | 320 | ||
321 | MHD_MD5_init (&ctx); | 321 | MHD_MD5_init (&ctx); |
@@ -334,10 +334,10 @@ test1_bin (void) | |||
334 | { | 334 | { |
335 | unsigned int i; | 335 | unsigned int i; |
336 | int num_failed = 0; | 336 | int num_failed = 0; |
337 | struct Md5Ctx ctx; | ||
337 | 338 | ||
338 | for (i = 0; i < units2_num; i++) | 339 | for (i = 0; i < units2_num; i++) |
339 | { | 340 | { |
340 | struct Md5Ctx ctx; | ||
341 | uint8_t digest[MD5_DIGEST_SIZE]; | 341 | uint8_t digest[MD5_DIGEST_SIZE]; |
342 | 342 | ||
343 | MHD_MD5_init (&ctx); | 343 | MHD_MD5_init (&ctx); |
@@ -356,10 +356,10 @@ test2_str (void) | |||
356 | { | 356 | { |
357 | unsigned int i; | 357 | unsigned int i; |
358 | int num_failed = 0; | 358 | int num_failed = 0; |
359 | struct Md5Ctx ctx; | ||
359 | 360 | ||
360 | for (i = 0; i < units1_num; i++) | 361 | for (i = 0; i < units1_num; i++) |
361 | { | 362 | { |
362 | struct Md5Ctx ctx; | ||
363 | uint8_t digest[MD5_DIGEST_SIZE]; | 363 | uint8_t digest[MD5_DIGEST_SIZE]; |
364 | size_t part_s = data_units1[i].str_l.len / 4; | 364 | size_t part_s = data_units1[i].str_l.len / 4; |
365 | 365 | ||
@@ -383,10 +383,10 @@ test2_bin (void) | |||
383 | { | 383 | { |
384 | unsigned int i; | 384 | unsigned int i; |
385 | int num_failed = 0; | 385 | int num_failed = 0; |
386 | struct Md5Ctx ctx; | ||
386 | 387 | ||
387 | for (i = 0; i < units2_num; i++) | 388 | for (i = 0; i < units2_num; i++) |
388 | { | 389 | { |
389 | struct Md5Ctx ctx; | ||
390 | uint8_t digest[MD5_DIGEST_SIZE]; | 390 | uint8_t digest[MD5_DIGEST_SIZE]; |
391 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; | 391 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; |
392 | 392 | ||
@@ -414,6 +414,7 @@ test_unaligned (void) | |||
414 | unsigned int offset; | 414 | unsigned int offset; |
415 | uint8_t *buf; | 415 | uint8_t *buf; |
416 | uint8_t *digest_buf; | 416 | uint8_t *digest_buf; |
417 | struct Md5Ctx ctx; | ||
417 | 418 | ||
418 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; | 419 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; |
419 | 420 | ||
@@ -424,7 +425,6 @@ test_unaligned (void) | |||
424 | 425 | ||
425 | for (offset = MAX_OFFSET; offset >= 1; --offset) | 426 | for (offset = MAX_OFFSET; offset >= 1; --offset) |
426 | { | 427 | { |
427 | struct Md5Ctx ctx; | ||
428 | uint8_t *unaligned_digest; | 428 | uint8_t *unaligned_digest; |
429 | uint8_t *unaligned_buf; | 429 | uint8_t *unaligned_buf; |
430 | 430 | ||
diff --git a/src/microhttpd/test_sha256.c b/src/microhttpd/test_sha256.c index a44ceedc..f287afd6 100644 --- a/src/microhttpd/test_sha256.c +++ b/src/microhttpd/test_sha256.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2019 Karlson2k (Evgeny Grin) | 3 | Copyright (C) 2019-2022 Evgeny Grin (Karlson2k) |
4 | 4 | ||
5 | This test tool is free software; you can redistribute it and/or | 5 | This test tool is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU General Public License as | 6 | modify it under the terms of the GNU General Public License as |
@@ -339,10 +339,10 @@ test1_str (void) | |||
339 | { | 339 | { |
340 | int num_failed = 0; | 340 | int num_failed = 0; |
341 | unsigned int i; | 341 | unsigned int i; |
342 | struct Sha256Ctx ctx; | ||
342 | 343 | ||
343 | for (i = 0; i < units1_num; i++) | 344 | for (i = 0; i < units1_num; i++) |
344 | { | 345 | { |
345 | struct Sha256Ctx ctx; | ||
346 | uint8_t digest[SHA256_DIGEST_SIZE]; | 346 | uint8_t digest[SHA256_DIGEST_SIZE]; |
347 | 347 | ||
348 | MHD_SHA256_init (&ctx); | 348 | MHD_SHA256_init (&ctx); |
@@ -361,10 +361,10 @@ test1_bin (void) | |||
361 | { | 361 | { |
362 | int num_failed = 0; | 362 | int num_failed = 0; |
363 | unsigned int i; | 363 | unsigned int i; |
364 | struct Sha256Ctx ctx; | ||
364 | 365 | ||
365 | for (i = 0; i < units2_num; i++) | 366 | for (i = 0; i < units2_num; i++) |
366 | { | 367 | { |
367 | struct Sha256Ctx ctx; | ||
368 | uint8_t digest[SHA256_DIGEST_SIZE]; | 368 | uint8_t digest[SHA256_DIGEST_SIZE]; |
369 | 369 | ||
370 | MHD_SHA256_init (&ctx); | 370 | MHD_SHA256_init (&ctx); |
@@ -384,10 +384,10 @@ test2_str (void) | |||
384 | { | 384 | { |
385 | int num_failed = 0; | 385 | int num_failed = 0; |
386 | unsigned int i; | 386 | unsigned int i; |
387 | struct Sha256Ctx ctx; | ||
387 | 388 | ||
388 | for (i = 0; i < units1_num; i++) | 389 | for (i = 0; i < units1_num; i++) |
389 | { | 390 | { |
390 | struct Sha256Ctx ctx; | ||
391 | uint8_t digest[SHA256_DIGEST_SIZE]; | 391 | uint8_t digest[SHA256_DIGEST_SIZE]; |
392 | size_t part_s = data_units1[i].str_l.len / 4; | 392 | size_t part_s = data_units1[i].str_l.len / 4; |
393 | 393 | ||
@@ -413,10 +413,10 @@ test2_bin (void) | |||
413 | { | 413 | { |
414 | int num_failed = 0; | 414 | int num_failed = 0; |
415 | unsigned int i; | 415 | unsigned int i; |
416 | struct Sha256Ctx ctx; | ||
416 | 417 | ||
417 | for (i = 0; i < units2_num; i++) | 418 | for (i = 0; i < units2_num; i++) |
418 | { | 419 | { |
419 | struct Sha256Ctx ctx; | ||
420 | uint8_t digest[SHA256_DIGEST_SIZE]; | 420 | uint8_t digest[SHA256_DIGEST_SIZE]; |
421 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; | 421 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; |
422 | 422 | ||
@@ -444,6 +444,7 @@ test_unaligned (void) | |||
444 | unsigned int offset; | 444 | unsigned int offset; |
445 | uint8_t *buf; | 445 | uint8_t *buf; |
446 | uint8_t *digest_buf; | 446 | uint8_t *digest_buf; |
447 | struct Sha256Ctx ctx; | ||
447 | 448 | ||
448 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; | 449 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; |
449 | 450 | ||
@@ -454,7 +455,6 @@ test_unaligned (void) | |||
454 | 455 | ||
455 | for (offset = MAX_OFFSET; offset >= 1; --offset) | 456 | for (offset = MAX_OFFSET; offset >= 1; --offset) |
456 | { | 457 | { |
457 | struct Sha256Ctx ctx; | ||
458 | uint8_t *unaligned_digest; | 458 | uint8_t *unaligned_digest; |
459 | uint8_t *unaligned_buf; | 459 | uint8_t *unaligned_buf; |
460 | 460 | ||
diff --git a/src/microhttpd/test_sha512_256.c b/src/microhttpd/test_sha512_256.c index e23ad256..81a505c0 100644 --- a/src/microhttpd/test_sha512_256.c +++ b/src/microhttpd/test_sha512_256.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2019-2022 Karlson2k (Evgeny Grin) | 3 | Copyright (C) 2019-2022 Evgeny Grin (Karlson2k) |
4 | 4 | ||
5 | This test tool is free software; you can redistribute it and/or | 5 | This test tool is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU General Public License as | 6 | modify it under the terms of the GNU General Public License as |
@@ -446,10 +446,10 @@ test1_str (void) | |||
446 | { | 446 | { |
447 | int num_failed = 0; | 447 | int num_failed = 0; |
448 | unsigned int i; | 448 | unsigned int i; |
449 | struct Sha512_256Ctx ctx; | ||
449 | 450 | ||
450 | for (i = 0; i < units1_num; i++) | 451 | for (i = 0; i < units1_num; i++) |
451 | { | 452 | { |
452 | struct Sha512_256Ctx ctx; | ||
453 | uint8_t digest[SHA512_256_DIGEST_SIZE]; | 453 | uint8_t digest[SHA512_256_DIGEST_SIZE]; |
454 | 454 | ||
455 | MHD_SHA512_256_init (&ctx); | 455 | MHD_SHA512_256_init (&ctx); |
@@ -468,10 +468,10 @@ test1_bin (void) | |||
468 | { | 468 | { |
469 | int num_failed = 0; | 469 | int num_failed = 0; |
470 | unsigned int i; | 470 | unsigned int i; |
471 | struct Sha512_256Ctx ctx; | ||
471 | 472 | ||
472 | for (i = 0; i < units2_num; i++) | 473 | for (i = 0; i < units2_num; i++) |
473 | { | 474 | { |
474 | struct Sha512_256Ctx ctx; | ||
475 | uint8_t digest[SHA512_256_DIGEST_SIZE]; | 475 | uint8_t digest[SHA512_256_DIGEST_SIZE]; |
476 | 476 | ||
477 | MHD_SHA512_256_init (&ctx); | 477 | MHD_SHA512_256_init (&ctx); |
@@ -491,10 +491,10 @@ test2_str (void) | |||
491 | { | 491 | { |
492 | int num_failed = 0; | 492 | int num_failed = 0; |
493 | unsigned int i; | 493 | unsigned int i; |
494 | struct Sha512_256Ctx ctx; | ||
494 | 495 | ||
495 | for (i = 0; i < units1_num; i++) | 496 | for (i = 0; i < units1_num; i++) |
496 | { | 497 | { |
497 | struct Sha512_256Ctx ctx; | ||
498 | uint8_t digest[SHA512_256_DIGEST_SIZE]; | 498 | uint8_t digest[SHA512_256_DIGEST_SIZE]; |
499 | size_t part_s = data_units1[i].str_l.len / 4; | 499 | size_t part_s = data_units1[i].str_l.len / 4; |
500 | 500 | ||
@@ -520,10 +520,10 @@ test2_bin (void) | |||
520 | { | 520 | { |
521 | int num_failed = 0; | 521 | int num_failed = 0; |
522 | unsigned int i; | 522 | unsigned int i; |
523 | struct Sha512_256Ctx ctx; | ||
523 | 524 | ||
524 | for (i = 0; i < units2_num; i++) | 525 | for (i = 0; i < units2_num; i++) |
525 | { | 526 | { |
526 | struct Sha512_256Ctx ctx; | ||
527 | uint8_t digest[SHA512_256_DIGEST_SIZE]; | 527 | uint8_t digest[SHA512_256_DIGEST_SIZE]; |
528 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; | 528 | size_t part_s = data_units2[i].bin_l.len * 2 / 3; |
529 | 529 | ||
@@ -551,6 +551,7 @@ test_unaligned (void) | |||
551 | unsigned int offset; | 551 | unsigned int offset; |
552 | uint8_t *buf; | 552 | uint8_t *buf; |
553 | uint8_t *digest_buf; | 553 | uint8_t *digest_buf; |
554 | struct Sha512_256Ctx ctx; | ||
554 | 555 | ||
555 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; | 556 | const struct data_unit2 *const tdata = data_units2 + DATA_POS; |
556 | 557 | ||
@@ -561,7 +562,6 @@ test_unaligned (void) | |||
561 | 562 | ||
562 | for (offset = MAX_OFFSET; offset >= 1; --offset) | 563 | for (offset = MAX_OFFSET; offset >= 1; --offset) |
563 | { | 564 | { |
564 | struct Sha512_256Ctx ctx; | ||
565 | uint8_t *unaligned_digest; | 565 | uint8_t *unaligned_digest; |
566 | uint8_t *unaligned_buf; | 566 | uint8_t *unaligned_buf; |
567 | 567 | ||