Skip to content

Commit

Permalink
test: Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Dec 24, 2024
1 parent 9e776f4 commit 9919036
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions crates/abcrypt/tests/decrypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,48 @@ fn out_len() {
#[cfg(feature = "alloc")]
#[test]
fn success_convenience_function() {
let plaintext = abcrypt::decrypt(TEST_DATA_ENC, PASSPHRASE).unwrap();
assert_eq!(plaintext, TEST_DATA);
{
let plaintext = abcrypt::decrypt(
include_bytes!("data/v1/argon2d/v0x10/data.txt.abcrypt"),
PASSPHRASE,
)
.unwrap();
assert_eq!(plaintext, TEST_DATA);
}
{
let plaintext = abcrypt::decrypt(
include_bytes!("data/v1/argon2d/v0x13/data.txt.abcrypt"),
PASSPHRASE,
)
.unwrap();
assert_eq!(plaintext, TEST_DATA);
}
{
let plaintext = abcrypt::decrypt(
include_bytes!("data/v1/argon2i/v0x10/data.txt.abcrypt"),
PASSPHRASE,
)
.unwrap();
assert_eq!(plaintext, TEST_DATA);
}
{
let plaintext = abcrypt::decrypt(
include_bytes!("data/v1/argon2i/v0x13/data.txt.abcrypt"),
PASSPHRASE,
)
.unwrap();
assert_eq!(plaintext, TEST_DATA);
}
{
let plaintext = abcrypt::decrypt(
include_bytes!("data/v1/argon2id/v0x10/data.txt.abcrypt"),
PASSPHRASE,
)
.unwrap();
assert_eq!(plaintext, TEST_DATA);
}
{
let plaintext = abcrypt::decrypt(TEST_DATA_ENC, PASSPHRASE).unwrap();
assert_eq!(plaintext, TEST_DATA);
}
}

0 comments on commit 9919036

Please sign in to comment.