|
|
@ -23,7 +23,9 @@ describe("ECDSA", function() { |
|
|
|
describe('#set', function() { |
|
|
|
|
|
|
|
it('should set hashbuf', function() { |
|
|
|
should.exist(ECDSA().set({hashbuf: ecdsa.hashbuf}).hashbuf); |
|
|
|
should.exist(ECDSA().set({ |
|
|
|
hashbuf: ecdsa.hashbuf |
|
|
|
}).hashbuf); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
@ -44,7 +46,10 @@ describe("ECDSA", function() { |
|
|
|
var ecdsa = new ECDSA({ |
|
|
|
privkey: Privkey(BN().fromBuffer(Hash.sha256(new Buffer('test')))), |
|
|
|
hashbuf: hashbuf, |
|
|
|
sig: new Signature({r: r, s: s}) |
|
|
|
sig: new Signature({ |
|
|
|
r: r, |
|
|
|
s: s |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
ecdsa.calci(); |
|
|
@ -151,12 +156,6 @@ describe("ECDSA", function() { |
|
|
|
ecdsa.sigError().should.equal('hashbuf must be a 32 byte buffer'); |
|
|
|
}); |
|
|
|
|
|
|
|
it.skip('should return an error if the pubkey is invalid', function() { |
|
|
|
var ecdsa = new ECDSA(); |
|
|
|
ecdsa.hashbuf = Hash.sha256(new Buffer('test')); |
|
|
|
ecdsa.sigError().indexOf("Invalid pubkey").should.equal(0); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should return an error if r, s are invalid', function() { |
|
|
|
var ecdsa = new ECDSA(); |
|
|
|
ecdsa.hashbuf = Hash.sha256(new Buffer('test')); |
|
|
|