|
3 | 3 |
|
4 | 4 | /* based on https://github.com/brainhub/SHA3IUF (public domain) */ |
5 | 5 |
|
6 | | -#include "../../tests/common.h" |
7 | 6 | #include "tomcrypt_private.h" |
8 | 7 |
|
9 | 8 | #ifdef LTC_SHA3 |
@@ -488,61 +487,61 @@ int turbo_shake_test(void) |
488 | 487 | /* TurboSHAKE128 on an empty buffer */ |
489 | 488 | turbo_shake_init(&c, 128); |
490 | 489 | turbo_shake_done(&c, hash, 64); |
491 | | - COMPARE_TESTVECTOR(hash, 64, turbo_shake_128_empty, sizeof(turbo_shake_128_empty), "TurboSHAKE128", counter++); |
| 490 | + LTC_COMPARE_TESTVECTOR(hash, 64, turbo_shake_128_empty, sizeof(turbo_shake_128_empty), "TurboSHAKE128", counter++); |
492 | 491 |
|
493 | 492 | /* TurboSHAKE128 on an empty buffer, digest length 10032 bytes, test last 32 bytes */ |
494 | 493 | turbo_shake_init(&c, 128); |
495 | 494 | for(i = 0; i != 10000 / 10; ++i){ turbo_shake_done(&c, hash, 10); } |
496 | 495 | turbo_shake_done(&c, hash, 32); |
497 | | - COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_empty_10032, sizeof(turbo_shake_128_empty_10032), "TurboSHAKE128", counter++); |
| 496 | + LTC_COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_empty_10032, sizeof(turbo_shake_128_empty_10032), "TurboSHAKE128", counter++); |
498 | 497 |
|
499 | 498 | /* TurboSHAKE128 on single zero byte */ |
500 | 499 | turbo_shake_init(&c, 128); |
501 | 500 | turbo_shake_process(&c, turbo_shake_input_single_zero, sizeof(turbo_shake_input_single_zero)); |
502 | 501 | turbo_shake_done(&c, hash, 32); |
503 | | - COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_single_zero_byte, sizeof(turbo_shake_128_single_zero_byte), "TurboSHAKE128", counter++); |
| 502 | + LTC_COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_single_zero_byte, sizeof(turbo_shake_128_single_zero_byte), "TurboSHAKE128", counter++); |
504 | 503 |
|
505 | 504 | /* TurboSHAKE128 on ptn(17**1) */ |
506 | 505 | turbo_shake_init(&c, 128); |
507 | 506 | turbo_shake_process(&c, turbo_shake_input_ptn_17_pow_1, sizeof(turbo_shake_input_ptn_17_pow_1)); |
508 | 507 | turbo_shake_done(&c, hash, 32); |
509 | | - COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_ptn_pow_1, sizeof(turbo_shake_128_ptn_pow_1), "TurboSHAKE128", counter++); |
| 508 | + LTC_COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_ptn_pow_1, sizeof(turbo_shake_128_ptn_pow_1), "TurboSHAKE128", counter++); |
510 | 509 |
|
511 | 510 | /* TurboSHAKE128 on ptn(17**2) */ |
512 | 511 | turbo_shake_init(&c, 128); |
513 | 512 | turbo_shake_process(&c, turbo_shake_input_ptn_17_pow_2, sizeof(turbo_shake_input_ptn_17_pow_2)); |
514 | 513 | turbo_shake_done(&c, hash, 32); |
515 | | - COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_ptn_pow_2, sizeof(turbo_shake_128_ptn_pow_2), "TurboSHAKE128", counter++); |
| 514 | + LTC_COMPARE_TESTVECTOR(hash, 32, turbo_shake_128_ptn_pow_2, sizeof(turbo_shake_128_ptn_pow_2), "TurboSHAKE128", counter++); |
516 | 515 |
|
517 | 516 |
|
518 | 517 | /* TurboSHAKE256 on an empty buffer */ |
519 | 518 | turbo_shake_init(&c, 256); |
520 | 519 | turbo_shake_done(&c, hash, 64); |
521 | | - COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_empty, sizeof(turbo_shake_256_empty), "TurboSHAKE256", counter++); |
| 520 | + LTC_COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_empty, sizeof(turbo_shake_256_empty), "TurboSHAKE256", counter++); |
522 | 521 |
|
523 | 522 | /* TurboSHAKE256 on an empty buffer, digest length 10032 bytes, test last 32 bytes */ |
524 | 523 | turbo_shake_init(&c, 256); |
525 | 524 | for(i = 0; i != 10000 / 10; ++i){ turbo_shake_done(&c, hash, 10); } |
526 | 525 | turbo_shake_done(&c, hash, 32); |
527 | | - COMPARE_TESTVECTOR(hash, 32, turbo_shake_256_empty_10032, sizeof(turbo_shake_256_empty_10032), "TurboSHAKE256", counter++); |
| 526 | + LTC_COMPARE_TESTVECTOR(hash, 32, turbo_shake_256_empty_10032, sizeof(turbo_shake_256_empty_10032), "TurboSHAKE256", counter++); |
528 | 527 |
|
529 | 528 | /* TurboSHAKE256 on single zero byte */ |
530 | 529 | turbo_shake_init(&c, 256); |
531 | 530 | turbo_shake_process(&c, turbo_shake_input_single_zero, sizeof(turbo_shake_input_single_zero)); |
532 | 531 | turbo_shake_done(&c, hash, 64); |
533 | | - COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_single_zero_byte, sizeof(turbo_shake_256_single_zero_byte), "TurboSHAKE256", counter++); |
| 532 | + LTC_COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_single_zero_byte, sizeof(turbo_shake_256_single_zero_byte), "TurboSHAKE256", counter++); |
534 | 533 |
|
535 | 534 | /* TurboSHAKE256 on ptn(17**1) */ |
536 | 535 | turbo_shake_init(&c, 256); |
537 | 536 | turbo_shake_process(&c, turbo_shake_input_ptn_17_pow_1, sizeof(turbo_shake_input_ptn_17_pow_1)); |
538 | 537 | turbo_shake_done(&c, hash, 64); |
539 | | - COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_ptn_pow_1, sizeof(turbo_shake_256_ptn_pow_1), "TurboSHAKE256", counter++); |
| 538 | + LTC_COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_ptn_pow_1, sizeof(turbo_shake_256_ptn_pow_1), "TurboSHAKE256", counter++); |
540 | 539 |
|
541 | 540 | /* TurboSHAKE256 on ptn(17**2) */ |
542 | 541 | turbo_shake_init(&c, 256); |
543 | 542 | turbo_shake_process(&c, turbo_shake_input_ptn_17_pow_2, sizeof(turbo_shake_input_ptn_17_pow_2)); |
544 | 543 | turbo_shake_done(&c, hash, 64); |
545 | | - COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_ptn_pow_2, sizeof(turbo_shake_256_ptn_pow_2), "TurboSHAKE256", counter++); |
| 544 | + LTC_COMPARE_TESTVECTOR(hash, 64, turbo_shake_256_ptn_pow_2, sizeof(turbo_shake_256_ptn_pow_2), "TurboSHAKE256", counter++); |
546 | 545 |
|
547 | 546 | return CRYPT_OK; |
548 | 547 | #endif |
|
0 commit comments