* Use Jonas Nick's musig2 branch * Reformat c code (no functional changes) * Implement musig2 * Add documentation to musig2 functions (#97) Usage of the Musig2 functions isn't intuitive at all, especially with the key aggregation cache and session data. It's important to provide accurate documentation to help users understand how to correctly produce musig2 signatures. We also change argument names to match Kotlin best practices instead of using the same argument names as C functions. * Add musig2 reference tests (no functional changes) --------- Co-authored-by: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
52 lines
2.6 KiB
JSON
52 lines
2.6 KiB
JSON
{
|
|
"pnonces": [
|
|
"020151C80F435648DF67A22B749CD798CE54E0321D034B92B709B567D60A42E66603BA47FBC1834437B3212E89A84D8425E7BF12E0245D98262268EBDCB385D50641",
|
|
"03FF406FFD8ADB9CD29877E4985014F66A59F6CD01C0E88CAA8E5F3166B1F676A60248C264CDD57D3C24D79990B0F865674EB62A0F9018277A95011B41BFC193B833",
|
|
"020151C80F435648DF67A22B749CD798CE54E0321D034B92B709B567D60A42E6660279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
|
|
"03FF406FFD8ADB9CD29877E4985014F66A59F6CD01C0E88CAA8E5F3166B1F676A60379BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
|
|
"04FF406FFD8ADB9CD29877E4985014F66A59F6CD01C0E88CAA8E5F3166B1F676A60248C264CDD57D3C24D79990B0F865674EB62A0F9018277A95011B41BFC193B833",
|
|
"03FF406FFD8ADB9CD29877E4985014F66A59F6CD01C0E88CAA8E5F3166B1F676A60248C264CDD57D3C24D79990B0F865674EB62A0F9018277A95011B41BFC193B831",
|
|
"03FF406FFD8ADB9CD29877E4985014F66A59F6CD01C0E88CAA8E5F3166B1F676A602FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC30"
|
|
],
|
|
"valid_test_cases": [
|
|
{
|
|
"pnonce_indices": [0, 1],
|
|
"expected": "035FE1873B4F2967F52FEA4A06AD5A8ECCBE9D0FD73068012C894E2E87CCB5804B024725377345BDE0E9C33AF3C43C0A29A9249F2F2956FA8CFEB55C8573D0262DC8"
|
|
},
|
|
{
|
|
"pnonce_indices": [2, 3],
|
|
"expected": "035FE1873B4F2967F52FEA4A06AD5A8ECCBE9D0FD73068012C894E2E87CCB5804B000000000000000000000000000000000000000000000000000000000000000000",
|
|
"comment": "Sum of second points encoded in the nonces is point at infinity which is serialized as 33 zero bytes"
|
|
}
|
|
],
|
|
"error_test_cases": [
|
|
{
|
|
"pnonce_indices": [0, 4],
|
|
"error": {
|
|
"type": "invalid_contribution",
|
|
"signer": 1,
|
|
"contrib": "pubnonce"
|
|
},
|
|
"comment": "Public nonce from signer 1 is invalid due wrong tag, 0x04, in the first half"
|
|
},
|
|
{
|
|
"pnonce_indices": [5, 1],
|
|
"error": {
|
|
"type": "invalid_contribution",
|
|
"signer": 0,
|
|
"contrib": "pubnonce"
|
|
},
|
|
"comment": "Public nonce from signer 0 is invalid because the second half does not correspond to an X coordinate"
|
|
},
|
|
{
|
|
"pnonce_indices": [6, 1],
|
|
"error": {
|
|
"type": "invalid_contribution",
|
|
"signer": 0,
|
|
"contrib": "pubnonce"
|
|
},
|
|
"comment": "Public nonce from signer 0 is invalid because second half exceeds field size"
|
|
}
|
|
]
|
|
}
|