|
|
@ -6,14 +6,20 @@ var Privkey = require('./privkey'); |
|
|
|
var Pubkey = require('./pubkey'); |
|
|
|
var Random = require('./random'); |
|
|
|
|
|
|
|
var ECDSA = function ECDSA(hashbuf, key, sig, k, verified) { |
|
|
|
var ECDSA = function ECDSA(obj) { |
|
|
|
if (!(this instanceof ECDSA)) |
|
|
|
return new ECDSA(hashbuf, key, sig, k, verified); |
|
|
|
this.hashbuf = hashbuf; |
|
|
|
this.key = key; |
|
|
|
this.sig = sig; |
|
|
|
this.k = k; |
|
|
|
this.verified = verified; |
|
|
|
return new ECDSA(obj); |
|
|
|
if (obj) |
|
|
|
this.set(obj); |
|
|
|
}; |
|
|
|
|
|
|
|
ECDSA.prototype.set = function(obj) { |
|
|
|
this.hashbuf = obj.hashbuf || this.hashbuf || undefined; |
|
|
|
this.key = obj.key || this.key || undefined; |
|
|
|
this.sig = obj.sig || this.sig || undefined; |
|
|
|
this.k = obj.k || this.k || undefined; |
|
|
|
this.verified = obj.verified || this.verified || undefined; |
|
|
|
return this; |
|
|
|
}; |
|
|
|
|
|
|
|
ECDSA.prototype.calci = function() { |
|
|
|