add test for aes 128 encryption
This commit is contained in:
parent
91f7d66dbb
commit
c603fccd6f
@ -16,6 +16,29 @@ test ('decryption', (t) => {
|
||||
t.is (dec, 'foo');
|
||||
});
|
||||
|
||||
test ('encryption 128', (t) => {
|
||||
const enc = crypto.encrypt_aes (
|
||||
'foo',
|
||||
'bar',
|
||||
crypto.encryption_mode_cbc_128,
|
||||
);
|
||||
t.is (typeof enc, 'string');
|
||||
});
|
||||
|
||||
test ('decryption 128', (t) => {
|
||||
const enc = crypto.encrypt_aes (
|
||||
'foo',
|
||||
'bar',
|
||||
crypto.encryption_mode_cbc_128,
|
||||
);
|
||||
const dec = crypto.decrypt_aes (
|
||||
enc,
|
||||
'bar',
|
||||
crypto.encryption_mode_cbc_128,
|
||||
);
|
||||
t.is (dec, 'foo');
|
||||
});
|
||||
|
||||
test ('fail decryption', (t) => {
|
||||
const enc = crypto.encrypt_aes ('foo', 'bar');
|
||||
const dec = crypto.decrypt_aes (enc, 'baz');
|
||||
|
Loading…
x
Reference in New Issue
Block a user