mod helpers;
use crate::{gcm::FloeKey, test_vector, tests::helpers::encrypt_decrypt_single_segment};
#[test]
fn test_aes_gcm() {
let plaintext = b"Hello world";
encrypt_decrypt_single_segment::<64>(plaintext);
}
#[test]
fn test_aes_gcm_empty_plaintext() {
let plaintext = b"";
encrypt_decrypt_single_segment::<32>(plaintext);
}
#[test]
fn test_invalid_key_length() {
let key = FloeKey::try_from([0u8; 33].as_slice());
key.expect_err("We should not be able to create a floe KDF key with an invalid size");
}
test_vector!("rust_GCM256_IV256_64", 64);
test_vector!("rust_GCM256_IV256_4K", 4096);
test_vector!("rust_GCM256_IV256_1M", 1024 * 1024);
test_vector!("go_GCM256_IV256_64", 64);
test_vector!("go_GCM256_IV256_4K", 4096);
test_vector!("go_GCM256_IV256_1M", 1024 * 1024);
test_vector!("cpp_GCM256_IV256_64", 64);
test_vector!("cpp_GCM256_IV256_4K", 4096);
test_vector!("cpp_GCM256_IV256_1M", 1024 * 1024);
test_vector!("java_GCM256_IV256_64", 64);
test_vector!("java_GCM256_IV256_4K", 4096);
test_vector!("java_GCM256_IV256_1M", 1024 * 1024);
test_vector!("pub_java_GCM256_IV256_64", 64);
test_vector!("pub_java_GCM256_IV256_4K", 4096);
test_vector!("pub_java_GCM256_IV256_1M", 1024 * 1024);
test_vector!("java_lastSegAligned", 40);
test_vector!("java_lastSegEmpty", 40);