From ff0c84f69963997029b8732376b21286cdd6c825 Mon Sep 17 00:00:00 2001 From: CryptoSpaces Date: Sun, 8 Jul 2018 16:11:58 +0200 Subject: [PATCH] Made sure to generate 'Canonical' signatures. --- src/utils/crypto.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/crypto.js b/src/utils/crypto.js index a426012..731ee7e 100644 --- a/src/utils/crypto.js +++ b/src/utils/crypto.js @@ -204,7 +204,7 @@ function getPubKeyFromPriKey(priKeyBytes) { function ECKeySign(hashBytes, priKeyBytes) { let ec = new EC('secp256k1'); let key = ec.keyFromPrivate(priKeyBytes, 'bytes'); - let signature = key.sign(hashBytes); + let signature = key.sign(hashBytes, { canonical: true }); // Enforce Canonical signatures. let r = signature.r; let s = signature.s; let id = signature.recoveryParam;