Skip to content

Commit ff0c84f

Browse files
committed
Made sure to generate 'Canonical' signatures.
1 parent dfab27b commit ff0c84f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/crypto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function getPubKeyFromPriKey(priKeyBytes) {
204204
function ECKeySign(hashBytes, priKeyBytes) {
205205
let ec = new EC('secp256k1');
206206
let key = ec.keyFromPrivate(priKeyBytes, 'bytes');
207-
let signature = key.sign(hashBytes);
207+
let signature = key.sign(hashBytes, { canonical: true }); // Enforce Canonical signatures.
208208
let r = signature.r;
209209
let s = signature.s;
210210
let id = signature.recoveryParam;

0 commit comments

Comments
 (0)