pub struct Aes128Ccm { /* private fields */ }Expand description
AES-128 CCM.
CCM authenticated encryption (NIST SP 800-38C, RFC 3610). The nonce is
7 to 13 bytes and the tag 4, 6, 8, 10, 12, 14 or 16 bytes; the tag
length is the length of the tag slice passed to each call. The
nonce must never repeat for a given key.
Implementations§
Source§impl Aes128Ccm
impl Aes128Ccm
Sourcepub fn encrypt(
&self,
nonce: &[u8],
aad: &[u8],
buf: &mut [u8],
tag: &mut [u8],
) -> Result<(), Error>
pub fn encrypt( &self, nonce: &[u8], aad: &[u8], buf: &mut [u8], tag: &mut [u8], ) -> Result<(), Error>
Encrypt buf in place, authenticating it and aad, writing the tag to tag.
Sourcepub fn encrypt_to(
&self,
nonce: &[u8],
aad: &[u8],
input: &[u8],
output: &mut [u8],
tag: &mut [u8],
) -> Result<(), Error>
pub fn encrypt_to( &self, nonce: &[u8], aad: &[u8], input: &[u8], output: &mut [u8], tag: &mut [u8], ) -> Result<(), Error>
Encrypt input to output, authenticating it and aad, writing the tag to tag.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Aes128Ccm
impl !Unpin for Aes128Ccm
impl !UnwindSafe for Aes128Ccm
impl Freeze for Aes128Ccm
impl Send for Aes128Ccm
impl Sync for Aes128Ccm
impl UnsafeUnpin for Aes128Ccm
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