use secured_cipher::{Key, KeyDerivationStrategy};
use crate::EnclaveError;
pub trait Encryptable<const KEY_SIZE: usize> {
fn encrypt(&self, password: String, strategy: KeyDerivationStrategy) -> Vec<u8>;
fn encrypt_with_key(&self, key: &Key<KEY_SIZE, 16>) -> Vec<u8>;
fn encrypt_with_raw_key(&self, key: [u8; KEY_SIZE]) -> Vec<u8>;
fn encrypt_with_metadata<T>(&self, key: [u8; KEY_SIZE], metadata: T) -> Vec<u8>
where
T: From<Vec<u8>> + Into<Vec<u8>> + Clone;
}
pub trait Decryptable<const KEY_SIZE: usize> {
fn decrypt(&self, password: String) -> Result<Vec<u8>, EnclaveError>;
fn decrypt_with_key(&self, key: [u8; KEY_SIZE]) -> Result<Vec<u8>, EnclaveError>;
fn decrypt_with_metadata<T>(&self, key: [u8; KEY_SIZE]) -> Result<(Vec<u8>, T), EnclaveError>
where
T: TryFrom<Vec<u8>> + Into<Vec<u8>> + Clone;
}