Add BIP32_PRIME constant, 0x80000000
This commit is contained in:
parent
56bb0a0c6d
commit
1cb41fdaba
1 changed files with 2 additions and 1 deletions
|
@ -29,6 +29,7 @@ var BIP32key = function(opts) {
|
|||
|
||||
var PRIVDERIV = BIP32key.PRIVDERIV = '\x04\x88\xAD\xE4'
|
||||
var PUBDERIV = BIP32key.PUBDERIV = '\x04\x88\xB2\x1E'
|
||||
var BIP32_PRIME = BIP32key.PRIME = 0x80000000
|
||||
|
||||
BIP32key.deserialize = function(str) {
|
||||
var bytes = base58.decode(str)
|
||||
|
@ -104,7 +105,7 @@ BIP32key.prototype.ckd = function(i) {
|
|||
}
|
||||
else pub = this.key.export('bytes')
|
||||
|
||||
if (i >= 2147483648) {
|
||||
if (i >= BIP32_PRIME) {
|
||||
if (!priv) throw new Error("Can't do private derivation on public key!")
|
||||
blob = [0].concat(priv.slice(0,32),util.numToBytes(i,4).reverse())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue