From cd326921bc38ce1aa5805ec00300506ca3102155 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 13 May 2014 19:10:20 +1000 Subject: [PATCH] bigi: upgrade to 1.1.0 --- package.json | 2 +- src/ecdsa.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 495e486..6633688 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "compile": "./node_modules/.bin/browserify ./src/index.js -s Bitcoin | ./node_modules/.bin/uglifyjs > bitcoinjs-min.js" }, "dependencies": { - "bigi": "1.0.0", + "bigi": "1.1.0", "crypto-js": "3.1.2-3", "secure-random": "0.2.1" } diff --git a/src/ecdsa.js b/src/ecdsa.js index 1536918..7d73a6d 100644 --- a/src/ecdsa.js +++ b/src/ecdsa.js @@ -88,8 +88,8 @@ function verifyRaw(ecparams, e, r, s, Q) { * Takes two BigIntegers representing r and s and returns a byte array. */ function serializeSig(r, s) { - var rBa = r.toByteArraySigned() - var sBa = s.toByteArraySigned() + var rBa = r.toDERInteger() + var sBa = s.toDERInteger() var sequence = [] sequence.push(0x02); // INTEGER @@ -130,8 +130,8 @@ function parseSig(buffer) { var sB = buffer.slice(2 + offset) return { - r: BigInteger.fromByteArraySigned(rB), - s: BigInteger.fromByteArraySigned(sB) + r: BigInteger.fromDERInteger(rB), + s: BigInteger.fromDERInteger(sB) } }