Skip to content

Commit

Permalink
fix R verification (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec authored Jan 16, 2025
1 parent 43cb649 commit f276552
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 @@ -48,6 +48,8 @@ check of rewards
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 f276552

Please sign in to comment.