diff options
Diffstat (limited to 'src/microhttpd/test_sha512_256.c')
-rw-r--r-- | src/microhttpd/test_sha512_256.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 | ||