Browse Source

lib/hdkey: fixes condition for BIP consistency. Closes #1

master
JP Richardson 10 years ago
parent
commit
8ca9fece57
  1. 2
      lib/hdkey.js

2
lib/hdkey.js

@ -143,7 +143,7 @@ HDKey.prototype.deriveChild = function (index) {
var Ki = curve.G.multiply(pIL).add(this._publicPoint)
// In case parse256(IL) >= n or Ki is the point at infinity, one should proceed with the next value for i
if (curve.isInfinity(Ki)) {
if (pIL.compareTo(curve.n) >= 0 || curve.isInfinity(Ki)) {
return this.derive(index + 1)
}

Loading…
Cancel
Save