feat: add test case for XEX empty

This commit is contained in:
0xalivecow 2024-10-30 18:00:09 +01:00
parent 2e22bd5789
commit 28a8753d55
No known key found for this signature in database

View file

@ -167,4 +167,17 @@ mod tests {
Ok(()) Ok(())
} }
#[test]
fn test_xex_encrypt_empty_case() -> Result<()> {
let key = BASE64_STANDARD.decode("B1ygNO/CyRYIUYhTSgoUysX5Y/wWLi4UiWaVeloUWs0=")?;
let tweak = BASE64_STANDARD.decode("6VXORr+YYHrd2nVe0OlA+Q==")?;
let input = BASE64_STANDARD.decode("")?;
let output = BASE64_STANDARD.encode(xex_encrypt(key, &tweak, &input)?);
assert_eq!(output, "");
Ok(())
}
} }