From 7ac5360118f74eb02da73bdf9f24fd0c72ff5281 Mon Sep 17 00:00:00 2001 From: Markus-MS <45643263+Markus-MS@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:22:53 -0400 Subject: [PATCH] Merge commit from fork --- lib/elliptic/eddsa/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/elliptic/eddsa/index.js b/lib/elliptic/eddsa/index.js index d777983a..cb703a7c 100644 --- a/lib/elliptic/eddsa/index.js +++ b/lib/elliptic/eddsa/index.js @@ -52,6 +52,9 @@ EDDSA.prototype.sign = function sign(message, secret) { EDDSA.prototype.verify = function verify(message, sig, pub) { message = parseBytes(message); sig = this.makeSignature(sig); + if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) { + return false; + } var key = this.keyFromPublic(pub); var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message); var SG = this.g.mul(sig.S());