test the case when no fromkeypair is used

...during encryption, and make sure you can still decrypt the message.
This commit is contained in:
Ryan X. Charles 2014-09-15 10:52:32 -07:00
parent fbfa64582c
commit 8dc6a5023a
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ describe('#ECIES', function() {
messagebuf2.toString('hex').should.equal(messagebuf.toString('hex'));
});
it('should decrypt that which was encrypted if fromkeypair was randomly generated', function() {
var encbuf = ECIES.encrypt(messagebuf, tokey);
var messagebuf2 = ECIES.decrypt(encbuf, tokey);
messagebuf2.toString('hex').should.equal(messagebuf.toString('hex'));
});
});
});