pub enum Encrypt<'a, R: Read + Seek = File> {
Dh([u8; 32], &'a Vec<[u8; 32]>, Option<[u8; 32]>),
Hmac([u8; 32], [u8; 32], usize),
Session([u8; 32], bool),
Kem(KemKeyReader<R>),
}Expand description
encapsulates the parameters and mode for encryption.
Variants§
Dh([u8; 32], &'a Vec<[u8; 32]>, Option<[u8; 32]>)
generates random content key and encrypts for all recipients with their respective Diffie-Hellman shared secret.
Tuple Fields
Hmac([u8; 32], [u8; 32], usize)
hashes the second tuple member, with the first tuple member as the HMAC key.
Session([u8; 32], bool)
uses the key that is passed in without modification.
Kem(KemKeyReader<R>)
uses key encapsulation to encrypt a copy of the a one-time generated content key for each recipient.
Tuple Fields
§
0: KemKeyReader<R>recipient KEM public keys reader
Auto Trait Implementations§
impl<'a, R> Freeze for Encrypt<'a, R>where
R: Freeze,
impl<'a, R> RefUnwindSafe for Encrypt<'a, R>where
R: RefUnwindSafe,
impl<'a, R> Send for Encrypt<'a, R>where
R: Send,
impl<'a, R> Sync for Encrypt<'a, R>where
R: Sync,
impl<'a, R> Unpin for Encrypt<'a, R>where
R: Unpin,
impl<'a, R> UnsafeUnpin for Encrypt<'a, R>where
R: UnsafeUnpin,
impl<'a, R> UnwindSafe for Encrypt<'a, R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more