add rethrow option

This commit is contained in:
2020-03-05 10:24:27 +01:00
parent 44cfbc0b9b
commit fedc497b97
2 changed files with 12 additions and 2 deletions

View File

@ -22,6 +22,13 @@ test ('fail decryption', (t) => {
t.is (dec, null);
});
test ('rethrow decryption', (t) => {
const enc = crypto.encrypt_aes ('foo', 'bar');
t.throws (() => {
const dec = crypto.decrypt_aes (enc, 'baz', true);
});
});
test ('unique crypto strings', (t) => {
const enc = [
crypto.encrypt_aes ('foo', 'bar'),