Skip to content

Commit

Permalink
Made sure to generate 'Canonical' signatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoSpaces committed Jul 8, 2018
1 parent dfab27b commit 768539f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 768539f

Please sign in to comment.