diff --git a/CHANGELOG.md b/CHANGELOG.md index 8685941..fe37b5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +0.4.0 / 2014-09-24 +------------------ +- dropped `sha512` dependency and upgraded to crypto-browserify that supports sha512 + 0.3.1 / 2014-07-11 ------------------ - removed superfluous code `this._privateKeyBigInteger` diff --git a/lib/hdkey.js b/lib/hdkey.js index d605406..c65e50f 100644 --- a/lib/hdkey.js +++ b/lib/hdkey.js @@ -5,8 +5,6 @@ var cs = require('coinstring') var ecurve = require('ecurve') var curve = ecurve.getCurveByName('secp256k1') var Point = ecurve.Point -var sha512 = require('sha512') - module.exports = HDKey @@ -118,7 +116,7 @@ HDKey.prototype.deriveChild = function(index) { data = Buffer.concat([this.publicKey, indexBuffer]) } - var I = sha512.hmac(this.chainCode).finalize(data) + var I = crypto.createHmac('sha512', this.chainCode).update(data).digest() var IL = I.slice(0, 32) var IR = I.slice(32) @@ -161,7 +159,7 @@ HDKey.prototype.deriveChild = function(index) { } HDKey.fromMasterSeed = function(seedBuffer, versions) { - var I = sha512.hmac(MASTER_SECRET).finalize(seedBuffer) + var I = crypto.createHmac('sha512', MASTER_SECRET).update(seedBuffer).digest() var IL = I.slice(0, 32) var IR = I.slice(32) diff --git a/package.json b/package.json index 348e723..8ad5aac 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,10 @@ "mocha-lcov-reporter": "0.0.1", "istanbul": "^0.2.10", "secure-random": "^1.0.0", - "mochify": "^0.9.3", - "crypto-browserify": "^2.1.8" + "mochify": "^1.1.2", + "crypto-browserify": "^3.2.4" }, "dependencies": { - "sha512": "0.0.1", "bigi": "^1.1.0", "ecurve": "^1.0.0", "coinstring": "^2.0.0" @@ -39,8 +38,5 @@ "unit": "./node_modules/.bin/mocha", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js", "coveralls": "npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info" - }, - "browser": { - "crypto": "crypto-browserify" } }