From 7735e6eca2af3a348d922004592da571f54e584e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carneiro?= Date: Thu, 31 Oct 2024 20:04:08 -0400 Subject: [PATCH] fix: ecdsa sign would return r as a BN.js instance instead of bitcore-lib's monkey patch instance --- packages/bitcore-lib/lib/crypto/ecdsa.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bitcore-lib/lib/crypto/ecdsa.js b/packages/bitcore-lib/lib/crypto/ecdsa.js index 6bea796b8a1..7002d96c2e5 100644 --- a/packages/bitcore-lib/lib/crypto/ecdsa.js +++ b/packages/bitcore-lib/lib/crypto/ecdsa.js @@ -211,7 +211,7 @@ ECDSA.prototype._findSignature = function(d, e) { badrs++; k = this.k; Q = G.mul(k); - r = Q.x.umod(N); + r = Q.getX().umod(N); s = k.invm(N).mul(e.add(d.mul(r))).umod(N); } while (r.cmp(BN.Zero) <= 0 || s.cmp(BN.Zero) <= 0);