pub struct Eax<C: Cipher> { /* private fields */ }
Expand description
M.Bellare et.al EAX mode of operation.
Implementations§
source§impl<C: Cipher> Eax<C>
impl<C: Cipher> Eax<C>
sourcepub const DIGEST_SIZE: usize = 16usize
pub const DIGEST_SIZE: usize = 16usize
Size of a EAX digest in bytes.
sourcepub fn with_key_and_nonce(key: &[u8], nonce: &[u8]) -> Result<Self>
pub fn with_key_and_nonce(key: &[u8], nonce: &[u8]) -> Result<Self>
Creates a new EAX instance with secret key
and public nonce
.
Examples found in repository?
examples/polymorphic.rs (line 89)
81 82 83 84 85 86 87 88 89 90 91 92 93
fn init_aead(&self) -> Box<dyn Aead> {
if random_bool() {
Box::new(
Gcm::<Aes128>::with_key_and_nonce(&b"123"[..], &b"123"[..])
.unwrap(),
)
} else {
Box::new(
Eax::<Twofish>::with_key_and_nonce(&b"123"[..], &b"123"[..])
.unwrap(),
)
}
}
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Eax<C>where
C: Freeze,
impl<C> RefUnwindSafe for Eax<C>where
C: RefUnwindSafe,
impl<C> !Send for Eax<C>
impl<C> !Sync for Eax<C>
impl<C> Unpin for Eax<C>where
C: Unpin,
impl<C> UnwindSafe for Eax<C>where
C: UnwindSafe + RefUnwindSafe,
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