feat: v0.5.0, supports ChaCha20/Poly1305
This commit is contained in:
@@ -20,6 +20,14 @@ impl Cryptor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_name(&self) -> String {
|
||||
let name = match self {
|
||||
Cryptor::Aes256Gcm => consts::TINY_ENC_AES_GCM,
|
||||
Cryptor::ChaCha20Poly1305 => consts::TINY_ENC_CHACHA20_POLY1305,
|
||||
};
|
||||
name.to_string()
|
||||
}
|
||||
|
||||
pub fn encryptor(self, key: &[u8], nonce: &[u8]) -> XResult<Box<dyn Encryptor>> {
|
||||
get_encryptor(self, key, nonce)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user