-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MuSig2: Catch up to 0.4.0 #1865
Conversation
1a73614
to
a862f9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Happy to see there weren't any fundamental correctness issues discovered with the addition of the new test vectors.
Completed an initial pass, mainly some style comments, and also some suggestions to elevate the utility functions added to the top-level module. This'll allow us to de-dup common routines like parsing a point into jacobian coords across a few of our projects.
Pull Request Test Coverage Report for Build 2759678038Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Bump. |
d7acd5d
to
cb1d4b5
Compare
Added the requested changes, however I'm unsure re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes are looking really good! Just a few minor comments
return nil, err | ||
} | ||
|
||
var nonce, r1J, r2J btcec.JacobianPoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean reducing duplication by moving some of the above into a new routine, so we can use it elsewhere. Don't consider it a blocker though, IIRC there's an existing TODO lingering around somewhere for it
btcec/schnorr/musig2/nonces.go
Outdated
) | ||
|
||
nonceJ, err := btcec.ParseJacobian( | ||
slicer(pubNonceBytes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can fit all one the next line? If not, the closing paren here should be on a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be 81 chars
cc @guggero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice PR! Just a few minor comments, mostly style nits.
This commit XORs the secret key (if a secret key is specified) with the random bytes as per MuSig2 Spec (https://github.com/jonasnick/bips/blob/musig2/bip-musig2.mediawiki#nonce-generation-1)
This commit changes the i's in GenNonces to 0 and 1 as per https://github.com/jonasnick/bips/blob/musig2/bip-musig2.mediawiki#change-log 0.3
This commit adds the testcases specified under version 0.3.1 from https://github.com/jonasnick/bips/blob/musig2/bip-musig2.mediawiki#change-log and the fixes from jonasnick/bips@79438fd
This commit adds the testvectors from jonasnick/bips@20f60b0 to the testcases
This commit adds the testvectors from jonasnick/bips@0ec2aef to the testcases
This commit adds the testvectors from jonasnick/bips@4c06f31 to the testcases
Adds testvectors from jonasnick/bips@ebb6a74 and jonasnick/bips@6788ee5
This commit adds the testvectors from jonasnick/bips@cdc3520
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🌺
This commit updates the musig2 module to allow infinity nonces, as per Musig2 0.4.0.
This commit adds the testvectors from jonasnick/bips@20ba031
This PR fixes nonce generation to include XORing the passed secret key with the random bytes. (see: https://github.com/jonasnick/bips/blob/musig2/bip-musig2.mediawiki#nonce-generation-1)
Additionally I updated the nonce generation to 0.3.0 and added the testcases
(https://github.com/jonasnick/bips/blob/musig2/bip-musig2.mediawiki#Change_Log)
(jonasnick/bips@f421692)
I'm currently in the progress of catching up to 0.4.0