pub trait SymmetricCipher:
Identified
+ Send
+ Sync {
// Required methods
fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>>;
fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>>;
}Expand description
对称加密:同一实例绑定固定密钥,对二进制载荷加解密。
Required Methods§
fn encrypt(&self, plaintext: &[u8]) -> Result<Vec<u8>>
fn decrypt(&self, ciphertext: &[u8]) -> Result<Vec<u8>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".