Skip to content

Commit

Permalink
fix R verification (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Jan 16, 2025
1 parent 8d8b98d commit 4ab4a89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
0.50.11
- [#404](https://github.com/babylonlabs-io/babylon/pull/404) Improve adaptor
signature nonce generation to match reference implementation
- [#413](https://github.com/babylonlabs-io/babylon/pull/413) Fix adaptor
signature R verification

## v1.0.0-rc3

Expand Down
6 changes: 2 additions & 4 deletions crypto/schnorr-adaptor-signature/sign_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ func encVerify(

expRHat.ToAffine()

// fail if expected R'.y is odd
if expRHat.Y.IsOdd() {
return fmt.Errorf("expected R'.y is odd")
if R.Y.IsOdd() {
return fmt.Errorf("expected R.y is odd")
}

// ensure R' is same as the expected R' = s'*G - e*P
if !expRHat.X.Equals(&RHat.X) {
return fmt.Errorf("expected R' = s'*G - e*P is different from the actual R'")
Expand Down

0 comments on commit 4ab4a89

Please sign in to comment.