From b96f5d728d52c4478f8e686831031accc9da19d3 Mon Sep 17 00:00:00 2001 From: Irfan Bozkurt Date: Sun, 4 Oct 2026 22:53:44 -0400 Subject: [PATCH] Reject neutral r in schnorr --- signature/schnorr/schnorr.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/signature/schnorr/schnorr.go b/signature/schnorr/schnorr.go index b18b345..9d70aac 100644 --- a/signature/schnorr/schnorr.go +++ b/signature/schnorr/schnorr.go @@ -197,7 +197,11 @@ func IsSchnorrSignatureValid(pubKey, hashedMsg gFp5.Element, sig Signature) bool return false } - rV := curve.MulAddG(pubKeyWs, sig.S, sig.E).Encode() // r_v = s*G + e*pk + r := curve.MulAddG(pubKeyWs, sig.S, sig.E) // r = s*G + e*pk + if r.IsNeutral() { + return false + } + rV := r.Encode() preImage := make([]g.GoldilocksField, 5+5) copy(preImage[:5], rV[:])