-
Notifications
You must be signed in to change notification settings - Fork 0
Add musig tests #106
base: main
Are you sure you want to change the base?
Add musig tests #106
Conversation
messageDigest: "0000000000000000000000000000000000000000000000000000000000000000", | ||
signature: "b75dea1788881b057ff2a2d5c2847a7bebbfe8d8f9c0d3e76caa7ac462f065780b979f9f782580dc8c410105eda618e3334236428a1522e58c1cb9bdf058a308", | ||
expectedResult: false, | ||
}, |
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 believe the verifier should reject pubkey==generator, right? Need a test for that
|
||
// Encode the modified signature back to hex format | ||
modifiedSigHex := hex.EncodeToString(signatureBytes) | ||
t.Log("Modified Signature: ", modifiedSigHex) |
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.
You build the modified sig, but then you don't check it against expected result
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.
Used this to generate it for the test case above, likely should be considered dead code.
|
||
// Encode the modified signature back to hex format | ||
modifiedSigHex := hex.EncodeToString(signatureBytes) | ||
t.Log("Modified Signature: ", modifiedSigHex) |
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.
again, computed sig is not verified
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.
Same as above
// Encode the modified signature back to hex format | ||
modifiedSigHex := hex.EncodeToString(signatureBytes) | ||
t.Log("Modified Signature: ", modifiedSigHex) | ||
} |
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.
There are no tests here for pubkey/signature aggregation
@@ -80,45 +71,33 @@ func TestSingleSigner(t *testing.T) { | |||
} |
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.
single signer should use musig, not schnorr
@@ -80,45 +71,33 @@ func TestSingleSigner(t *testing.T) { | |||
} | |||
|
|||
func TestMultiSigners(t *testing.T) { |
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.
please build these into test vectors, like you do for the test below.
e.g. provide a list of pubkeys with different corner cases (generator, off the curve, etc), and provide expected results.
What you have right now doesn't exercise failures due to combining invalid keys, etc
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.
please squash your commits
No description provided.