From c9ae343d352ef6e67bdc643ee2aa9d8ed4ce840c Mon Sep 17 00:00:00 2001 From: KonradStaniec Date: Wed, 15 Jan 2025 13:37:03 +0100 Subject: [PATCH] fix R verification --- crypto/schnorr-adaptor-signature/sign_utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/schnorr-adaptor-signature/sign_utils.go b/crypto/schnorr-adaptor-signature/sign_utils.go index 6ce1d984..dd9201de 100644 --- a/crypto/schnorr-adaptor-signature/sign_utils.go +++ b/crypto/schnorr-adaptor-signature/sign_utils.go @@ -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'")