Skip to content

Commit

Permalink
Fixed the expected error message in BIP340 verification test
Browse files Browse the repository at this point in the history
This test was previously failing.

The signature verification algorithm in BIP-340 does not check that the 32
public key bytes in the signature match a valid point on the curve. This check
is effectively implicit in the algorithm later, because G and P are known valid
curve points, so the point R that is calculated is also a valid point. Thus, if
r is not a valid point's X-coordinate, R.X != r.
  • Loading branch information
pdyraga committed Jan 8, 2024
1 parent d50ca09 commit 929f34d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frost/bip340_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ func TestVerifySignature(t *testing.T) {
isValid: false,
expectedErr: "point publicKey is infinite",
},

{
signature: "FFF97BD5755EEEA420453A14355235D382F6472F8568A18B2F057A14602975563CC27944640AC607CD107AE10923D9EF7A73C643E166BE5EBEAFA34B1AC553E2",
publicKeyX: "DFF1D77F2A671C5F36183726DB2341BE58FEAE1DA2DECED843240F7B502BA659",
Expand Down Expand Up @@ -497,7 +496,7 @@ func TestVerifySignature(t *testing.T) {
publicKeyX: "DFF1D77F2A671C5F36183726DB2341BE58FEAE1DA2DECED843240F7B502BA659",
message: "243F6A8885A308D313198A2E03707344A4093822299F31D0082EFA98EC4E6C89",
isValid: false,
expectedErr: "point R is infinite",
expectedErr: "coordinate R.x != r",
},
{
signature: "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F69E89B4C5564D00349106B8497785DD7D1D713A8AE82B32FA79D5F7FC407D39B",
Expand Down

0 comments on commit 929f34d

Please sign in to comment.