|
|
@ -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) |
|
|
|
|
|
|
|