pub struct Ccm<C: Cipher + BlockSizeIs16> { /* private fields */ }
Expand description
Counter with CBC-MAC mode (NIST SP800-38C).
CCM is a generic AEAD mode for block cipher with 128 bit block size.
Implementations§
source§impl<C: Cipher + BlockSizeIs16> Ccm<C>
impl<C: Cipher + BlockSizeIs16> Ccm<C>
sourcepub const DIGEST_SIZE: usize = 16usize
pub const DIGEST_SIZE: usize = 16usize
Recommended size of the CCM digest in bytes.
sourcepub fn with_key_and_nonce(
key: &[u8],
nonce: &[u8],
ad_len: usize,
msg_len: usize,
digest_len: usize
) -> Result<Self>
pub fn with_key_and_nonce( key: &[u8], nonce: &[u8], ad_len: usize, msg_len: usize, digest_len: usize ) -> Result<Self>
Creates a new instance with secret key
and public nonce
.
The instance expect additional data of ad_len
bytes, a
overall message of msg_len
and will produce a digest of
digest_len
bytes.
Trait Implementations§
source§impl<C: Cipher + BlockSizeIs16> Aead for Ccm<C>
impl<C: Cipher + BlockSizeIs16> Aead for Ccm<C>
source§fn digest_size(&self) -> usize
fn digest_size(&self) -> usize
Length of the digest in bytes.