|
|
@ -58,23 +58,6 @@ ECDSA.prototype.calci = function() { |
|
|
|
ECDSA.fromString = function(str) { |
|
|
|
var obj = JSON.parse(str); |
|
|
|
return new ECDSA(obj); |
|
|
|
|
|
|
|
if (obj.hashbuf) { |
|
|
|
this.hashbuf = new Buffer(obj.hashbuf, 'hex'); |
|
|
|
} |
|
|
|
if (obj.pubkey) { |
|
|
|
this.pubkey = PublicKey.fromString(obj.pubkey); |
|
|
|
} |
|
|
|
if (obj.privkey) { |
|
|
|
this.privkey = PrivateKey.fromString(obj.privkey); |
|
|
|
} |
|
|
|
if (obj.sig) { |
|
|
|
this.sig = Signature.fromString(obj.sig); |
|
|
|
} |
|
|
|
if (obj.k) { |
|
|
|
this.k = BN(obj.k, 10); |
|
|
|
} |
|
|
|
return this; |
|
|
|
}; |
|
|
|
|
|
|
|
ECDSA.prototype.randomK = function() { |
|
|
|