Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed May 15, 2024
1 parent b59e97d commit 43c03cf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/expr/impl/src/scalar/encrypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ mod test {

#[test]
fn encrypt_testcase() {
let encrypt_wrapper = |data: &[u8], key: &[u8], mode: &str| -> Result<Box<[u8]>> {
let encrypt_wrapper = |data: &[u8], key: &[u8], mode: &str| -> Box<[u8]> {
let config = CipherConfig::parse_cipher_config(key, mode)?;
encrypt(data, &config)
};
let decrypt_wrapper = |data: &[u8], key: &[u8], mode: &str| -> Result<Box<[u8]>> {
let decrypt_wrapper = |data: &[u8], key: &[u8], mode: &str| -> Box<[u8]> {
let config = CipherConfig::parse_cipher_config(key, mode)?;
decrypt(data, &config)
};
Expand All @@ -224,10 +224,9 @@ mod test {
b"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff",
key,
"aes-ecb/pad:none",
)
.unwrap();
);

let decrypted = decrypt_wrapper(&encrypted, key, "aes-ecb/pad:none").unwrap();
let decrypted = decrypt_wrapper(&encrypted, key, "aes-ecb/pad:none");
assert_eq!(
decrypted,
(*b"\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff").into()
Expand Down

0 comments on commit 43c03cf

Please sign in to comment.