pub struct Siv<C> { /* private fields */ }Expand description
RFC 5297 SIV construction parameterized by two block-cipher instances.
Implementations§
Source§impl<C> Siv<C>
impl<C> Siv<C>
Sourcepub fn mac_cipher(&self) -> &C
pub fn mac_cipher(&self) -> &C
Borrow the CMAC-side cipher.
Sourcepub fn ctr_cipher(&self) -> &C
pub fn ctr_cipher(&self) -> &C
Borrow the CTR-side cipher.
Source§impl<C: BlockCipher> Siv<C>
impl<C: BlockCipher> Siv<C>
Sourcepub fn encrypt_with_components(
&self,
components: &[&[u8]],
plaintext: &[u8],
) -> (Vec<u8>, [u8; 16])
pub fn encrypt_with_components( &self, components: &[&[u8]], plaintext: &[u8], ) -> (Vec<u8>, [u8; 16])
Encrypt using an explicit ordered vector of associated-data components.
Sourcepub fn decrypt_with_components(
&self,
components: &[&[u8]],
ciphertext: &mut [u8],
tag: &[u8; 16],
) -> bool
pub fn decrypt_with_components( &self, components: &[&[u8]], ciphertext: &mut [u8], tag: &[u8; 16], ) -> bool
Decrypt/authenticate using an explicit vector of associated-data components.
Trait Implementations§
Source§impl<C: BlockCipher> Aead for Siv<C>
impl<C: BlockCipher> Aead for Siv<C>
Source§fn encrypt_in_place(
&self,
nonce: &[u8],
aad: &[u8],
data: &mut [u8],
) -> Self::Tag
fn encrypt_in_place( &self, nonce: &[u8], aad: &[u8], data: &mut [u8], ) -> Self::Tag
Encrypt
data in place and return its authentication tag.Source§fn decrypt_in_place(
&self,
nonce: &[u8],
aad: &[u8],
data: &mut [u8],
tag: &Self::Tag,
) -> bool
fn decrypt_in_place( &self, nonce: &[u8], aad: &[u8], data: &mut [u8], tag: &Self::Tag, ) -> bool
Decrypt
data in place after authenticating tag.Auto Trait Implementations§
impl<C> Freeze for Siv<C>where
C: Freeze,
impl<C> RefUnwindSafe for Siv<C>where
C: RefUnwindSafe,
impl<C> Send for Siv<C>where
C: Send,
impl<C> Sync for Siv<C>where
C: Sync,
impl<C> Unpin for Siv<C>where
C: Unpin,
impl<C> UnsafeUnpin for Siv<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Siv<C>where
C: 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