Commit 5153cf1
committed
tests: refactor tagged hash tests
Move the sha256_tag_test_internal function out of the musig module
into tests.c. This makes it available to other modules wishing to verify tagged
hashes without needing to duplicate the function.
Change the function signature to expect a const unsigned char and update
the tagged hash tests to use static const unsigned char character
arrays (where necessary).
Add a comment for each tag. This is done as a convenience for checking
the strings against the protocol specifications, where the tags are
normally specified as strings.
Update tests in the ellswift and schnorrsig modules to use the
sha256_tag_test_internal helper function.1 parent d599714 commit 5153cf1
File tree
4 files changed
+36
-30
lines changed- src
- modules
- ellswift
- musig
- schnorrsig
4 files changed
+36
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
| 409 | + | |
409 | 410 | | |
| 411 | + | |
410 | 412 | | |
| 413 | + | |
411 | 414 | | |
412 | 415 | | |
413 | 416 | | |
414 | 417 | | |
415 | 418 | | |
416 | | - | |
417 | 419 | | |
418 | | - | |
| 420 | + | |
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
423 | | - | |
424 | 425 | | |
425 | | - | |
| 426 | + | |
426 | 427 | | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
430 | | - | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | 551 | | |
558 | 552 | | |
559 | 553 | | |
560 | 554 | | |
561 | 555 | | |
562 | | - | |
| 556 | + | |
| 557 | + | |
563 | 558 | | |
564 | | - | |
| 559 | + | |
565 | 560 | | |
566 | 561 | | |
567 | | - | |
| 562 | + | |
| 563 | + | |
568 | 564 | | |
569 | | - | |
| 565 | + | |
570 | 566 | | |
571 | 567 | | |
572 | | - | |
| 568 | + | |
| 569 | + | |
573 | 570 | | |
574 | | - | |
| 571 | + | |
575 | 572 | | |
576 | 573 | | |
577 | | - | |
| 574 | + | |
| 575 | + | |
578 | 576 | | |
579 | | - | |
| 577 | + | |
580 | 578 | | |
581 | 579 | | |
582 | | - | |
| 580 | + | |
| 581 | + | |
583 | 582 | | |
584 | | - | |
| 583 | + | |
585 | 584 | | |
586 | 585 | | |
587 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
| |||
0 commit comments