use crate::asymmetric::encryption::{decrypt, encrypt, get_decryption_params, get_encryption_params, setup};
#[test]
fn encryption() {
let data_to_encrypt_as_bytes = "Some data to encrypt".as_bytes();
let params_path = "/test/encryption_parameters/";
let _ = setup(Some(params_path));
let encryption_params = get_encryption_params(Some(params_path)).unwrap();
let encrypted_bytes = encrypt(encryption_params, data_to_encrypt_as_bytes).unwrap();
let decryption_params = get_decryption_params(Some(params_path)).unwrap();
let decrypted_bytes = decrypt(decryption_params, encrypted_bytes.as_slice()).unwrap();
assert_eq!(data_to_encrypt_as_bytes, decrypted_bytes);
}
#[test]
fn encryption_alternative() {
let data_to_encrypt_as_bytes = "Some data to encrypt".as_bytes();
let params_path = "/test/encryption_parameters/";
let (encryption_params, decryption_params) = setup(Some(params_path)).unwrap();
let encrypted_bytes = encrypt(encryption_params, data_to_encrypt_as_bytes).unwrap();
let decrypted_bytes = decrypt(decryption_params, encrypted_bytes.as_slice()).unwrap();
assert_eq!(data_to_encrypt_as_bytes, decrypted_bytes);
}