Commit 5a7fe06
committed
feat: implement byte array conversions for XOnlyPublicKey
Adds `to_byte_array`, `from_byte_array`, and `try_from_byte_array` to
XOnlyPublicKey. The implementation wraps `secp256k1_xonly_pubkey_parse`
to ensure the provided x-coordinate represents a valid point on the curve.
The `from_byte_array` method uses a `debug_assert` to satisfy the
`bytes_rtt_test` macro requirements, while `try_from_byte_array`
provides a fallible interface for production use.1 parent 0b3d9ff commit 5a7fe06
4 files changed
Lines changed: 30 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
848 | | - | |
| 848 | + | |
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | | - | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
890 | 905 | | |
891 | 906 | | |
892 | 907 | | |
893 | 908 | | |
894 | 909 | | |
895 | 910 | | |
896 | 911 | | |
897 | | - | |
| 912 | + | |
898 | 913 | | |
899 | 914 | | |
900 | 915 | | |
| |||
912 | 927 | | |
913 | 928 | | |
914 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
915 | 934 | | |
916 | 935 | | |
917 | 936 | | |
| |||
1255 | 1274 | | |
1256 | 1275 | | |
1257 | 1276 | | |
1258 | | - | |
| 1277 | + | |
1259 | 1278 | | |
1260 | 1279 | | |
1261 | 1280 | | |
| |||
1348 | 1367 | | |
1349 | 1368 | | |
1350 | 1369 | | |
1351 | | - | |
| 1370 | + | |
1352 | 1371 | | |
1353 | 1372 | | |
1354 | 1373 | | |
| |||
1998 | 2017 | | |
1999 | 2018 | | |
2000 | 2019 | | |
2001 | | - | |
| 2020 | + | |
2002 | 2021 | | |
2003 | 2022 | | |
2004 | 2023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
0 commit comments