From 9fd46c22fee6540321752ccee18a595abb7ea79d Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 12 Dec 2013 11:13:35 +0100 Subject: [PATCH] missing modulo operation. --- src/bip32.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bip32.js b/src/bip32.js index 36a0d2f..55818b1 100644 --- a/src/bip32.js +++ b/src/bip32.js @@ -83,7 +83,7 @@ BIP32key.prototype.ckd = function(i) { if (this.type == 'priv') { Ikey = Bitcoin.BigInteger.fromByteArrayUnsigned(I.slice(0,32)) - newkey = new key(this.key.priv.add(Ikey)) + newkey = new key(this.key.priv.add(Ikey).mod(ecparams.getN())) newkey.compressed = true fingerprint = util.sha256ripe160(this.key.getPub()).slice(0,4) }