Browse Source

remove unnecessary bignum conversion

patch-2
Ryan X. Charles 11 years ago
parent
commit
86bb67b76d
  1. 4
      lib/BIP32.js

4
lib/BIP32.js

@ -281,12 +281,12 @@ BIP32.prototype.deriveChild = function(i) {
} else {
var data = Buffer.concat([this.eckey.public, ib]);
var hash = coinUtil.sha512hmac(data, this.chainCode);
var il = bignum.fromBuffer(hash.slice(0, 32), {size: 32});
var il = hash.slice(0, 32);
var ir = hash.slice(32, 64);
// Ki = (IL + kpar)*G = IL*G + Kpar
var ilGkey = new Key();
ilGkey.private = il.toBuffer({size: 32});
ilGkey.private = il;
ilGkey.regenerateSync();
var ilG = Point.fromKey(ilGkey);
var oldkey = new Key();

Loading…
Cancel
Save