diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -784,4 +784,13 @@ mod test { let plain = aez.decrypt(&[0], &[b"foobar"], 16, &cipher).unwrap(); assert_eq!(plain, message); } + + #[test] + fn test_encrypt_decrypt_empty() { + let aez = Aez::new(b"jimbo"); + let hash = aez.encrypt(&[0], &[b"foobar"], 16, b""); + + assert!(aez.decrypt(&[0], &[b"foobar"], 16, &hash).is_some()); + assert!(aez.decrypt(&[0], &[b"boofar"], 16, &hash).is_none()); + } } |