musig: add input JSON files for generating test vectors#1786
musig: add input JSON files for generating test vectors#1786theStack wants to merge 1 commit intobitcoin-core:masterfrom
Conversation
|
Concept ACK I was also able to run these commands and get the same results |
Same for CMake? |
It would be helpful to align this workflow with existing patterns. For We should probably use the same approach for the |
The comment mentions doing this "without further dependencies". Note that Lines 260 to 266 in 2d9137c However, directly invoking |
|
@hebasto: Thanks for reviewing!
Adding support for test vectors generation with CMake has been proposed before, but was rejected, see #1723.
Currently, the
Since that affects all existing test vectors generation targets and not only the musig one, that seems to be a topic for a different PR. (Of course, also happy to include a commit directly in this PR, if its seen as uncontroversial and reviewers prefer that.) |
There was a problem hiding this comment.
While testing this PR by running
$ make clean-testvectors; make testvectors
I expected to get a non-zero diff after arbitrarily modifying the JSON files. However, that's not the case. For example, the following diff does not result in changes to the generated header:
--- a/src/modules/musig/vectors/det_sign_vectors.json
+++ b/src/modules/musig/vectors/det_sign_vectors.json
@@ -26,7 +26,7 @@
},
{
"rand": null,
- "aggothernonce": "0337C87821AFD50A8644D820A8F3E02E499C931865C2360FB43D0A0D20DAFE07EA0287BF891D2A6DEAEBADC909352AA9405D1428C15F4B75F04DAE642A95C2548480",
+ "aggothernonce": "1337C87821AFD50A8644D820A8F3E02E499C931865C2360FB43D0A0D20DAFE07EA0287BF891D2A6DEAEBADC909352AA9405D1428C15F4B75F04DAE642A95C2548480",
"key_indices": [1, 0, 2],
"tweaks": [],
"is_xonly": [],Are those JSON files redundant?
|
@hebasto: Good catch, looks like currently only six out of the eight .json files from the bips repository are used for test vectors generation: Hence, the other two ( |
While looking up past review history of the previous silentpayments PR (take 3), I've found that adding the input JSON files for generating the musig test vectors was suggested once there: #1698 (comment)
Can be tested by first comparing that the .json files match the ones from the bips repository's
bip-0327/vectorsfolder and then running e.g.