pub trait Cipher:
Random
+ Sized
+ Send
+ Sync
+ 'static {
type Tag: Array;
// Required methods
fn seal(self, aad: &[u8], data: &mut [u8]) -> Option<(Self, Self::Tag)>;
fn open(self, aad: &[u8], data: &mut [u8], tag: &Self::Tag) -> Option<Self>;
}Expand description
Authenticated encryption of an ordered sequence of messages.
Every message is encrypted and authenticated with its associated data. The nth call to Cipher::open accepts only the nth message sealed under the same key, so replayed, reordered, or modified messages fail to open. A failed call consumes the cipher. At most one instance may seal under a given key.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".