Skip to content

Conversation

@MPins
Copy link

@MPins MPins commented Nov 18, 2025

Fix #2462

Add VerifyLowS helper function to ECDSA signature. It will be used on lightningnetwork/lnd#10372.

Copy link

@GustavoStingelin GustavoStingelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add unit tests covering the VerifyLowS function.

Introduce a VerifyLowS helper to detect non-canonical
high-S ECDSA signatures, along with unit tests.
@MPins
Copy link
Author

MPins commented Dec 23, 2025

Thanks @GustavoStingelin for the review — tests have been added.

Copy link

@GustavoStingelin GustavoStingelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could rename the table test fields to be more readable

signatureTests := []struct {
name string
sig []byte
isLowS error

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isLowS error
wantErr error

}

for _, test := range signatureTests {
isLowS := VerifyLowS(test.sig)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isLowS := VerifyLowS(test.sig)
err := VerifyLowS(test.sig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: add VerifyLowS helper function in btcec for ECDSA signatures

2 participants