diff --git a/lib/bitauth-browserify.js b/lib/bitauth-browserify.js index 956524a..4895a02 100644 --- a/lib/bitauth-browserify.js +++ b/lib/bitauth-browserify.js @@ -36,7 +36,8 @@ BitAuth._getPublicKeyFromPrivateKey = function(privkey) { }; BitAuth._sign = function(hashBuffer, privkey) { - var signature = ecdsa.sign(hashBuffer.toString('hex'), privkey); + var keys = ecdsa.keyFromPrivate(privkey, 'hex'); + var signature = keys.sign(hashBuffer.toString('hex')); var hexsignature = signature.toDER('hex'); return hexsignature; };