update elliptic. remove ec.curve.n workaround.
This commit is contained in:
parent
22e092d6b8
commit
71ea61e467
@ -326,16 +326,7 @@ HDPriv.prototype.derive = function(index, hard) {
|
|||||||
var leftPart = new bn(hash.slice(0, 32));
|
var leftPart = new bn(hash.slice(0, 32));
|
||||||
var chainCode = hash.slice(32, 64);
|
var chainCode = hash.slice(32, 64);
|
||||||
|
|
||||||
// XXX This causes a call stack overflow with bn.js@4.0.5 and elliptic@3.0.3
|
var privateKey = leftPart.add(new bn(this.privateKey)).mod(ec.curve.n).toArray();
|
||||||
// Example: new bn(0).mod(ec.curve.n)
|
|
||||||
//var privateKey = leftPart.add(new bn(this.privateKey)).mod(ec.curve.n).toArray();
|
|
||||||
|
|
||||||
// Use this as a workaround:
|
|
||||||
var n = new bn(
|
|
||||||
'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141',
|
|
||||||
'hex'
|
|
||||||
);
|
|
||||||
var privateKey = leftPart.add(new bn(this.privateKey)).mod(n).toArray();
|
|
||||||
|
|
||||||
return new HDPriv({
|
return new HDPriv({
|
||||||
// version: this.version,
|
// version: this.version,
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^0.8.0",
|
"async": "^0.8.0",
|
||||||
"bn.js": "^4.5.0",
|
"bn.js": "^4.5.0",
|
||||||
"elliptic": "^3.0.3",
|
"elliptic": "^6.0.2",
|
||||||
"hash.js": "^1.0.3",
|
"hash.js": "^1.0.3",
|
||||||
"inherits": "^2.0.1"
|
"inherits": "^2.0.1"
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user