Commit f36afb8
committed
Merge #1725: tests: refactor tagged hash verification
5153cf1 tests: refactor tagged hash tests (josibake)
Pull request description:
Opened in response to #1698 (comment)
---
We use tagged hashes in `modules/musig`, `modules/schnorrsig`, `modules/ellswift`, and the proposed `modules/silentpayments`. In looking for inspiration on how to add tagged hash midstate verification for #1698, it seemed like a good opportunity to DRY up the code across all of the modules.
I chose the convention used in the ellswift module as this seems the most idiomatic C. Since the tags are normally specified as strings in the BIPs, I also added a comment above each char array for convenience.
If its deemed too invasive to refactor the existing modules in this PR, I'm happy to drop the refactor commits for the ellswift and schnorrsig modules. All I need for #1698 is the first commit which moves the utility function out of the musig module to make it available to use in the silent payments module.
ACKs for top commit:
real-or-random:
utACK 5153cf1 assuming CI passes
theStack:
Code-review ACK 5153cf1
Tree-SHA512: 335ec3ee6a265e13cc379968f8fa1624534bef2389e4e21b85e6a9572ce1bd9dee4eabd2cb6d187ac974db3ab8246c2626d309ccfbee5744c30cf7560d1e261cFile 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