pub struct Ccm<C, const TAG_LEN: usize = 16> { /* private fields */ }Expand description
Counter with CBC-MAC (CCM) with compile-time detached tag length.
TAG_LEN must be one of RFC 3610’s valid lengths:
{4, 6, 8, 10, 12, 14, 16}.
Implementations§
Source§impl<C: BlockCipher, const TAG_LEN: usize> Ccm<C, TAG_LEN>
impl<C: BlockCipher, const TAG_LEN: usize> Ccm<C, TAG_LEN>
Sourcepub fn compute_tag(
&self,
nonce: &[u8],
aad: &[u8],
plaintext: &[u8],
) -> [u8; TAG_LEN]
pub fn compute_tag( &self, nonce: &[u8], aad: &[u8], plaintext: &[u8], ) -> [u8; TAG_LEN]
Compute a detached CCM tag over plaintext and associated data.
Trait Implementations§
Source§impl<C: BlockCipher, const TAG_LEN: usize> Aead for Ccm<C, TAG_LEN>
impl<C: BlockCipher, const TAG_LEN: usize> Aead for Ccm<C, TAG_LEN>
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, const TAG_LEN: usize> Freeze for Ccm<C, TAG_LEN>where
C: Freeze,
impl<C, const TAG_LEN: usize> RefUnwindSafe for Ccm<C, TAG_LEN>where
C: RefUnwindSafe,
impl<C, const TAG_LEN: usize> Send for Ccm<C, TAG_LEN>where
C: Send,
impl<C, const TAG_LEN: usize> Sync for Ccm<C, TAG_LEN>where
C: Sync,
impl<C, const TAG_LEN: usize> Unpin for Ccm<C, TAG_LEN>where
C: Unpin,
impl<C, const TAG_LEN: usize> UnsafeUnpin for Ccm<C, TAG_LEN>where
C: UnsafeUnpin,
impl<C, const TAG_LEN: usize> UnwindSafe for Ccm<C, TAG_LEN>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