pub struct Aes128Ctr(/* private fields */);Expand description
AES-128 in CTR mode.
Create a new cipher with new.
xor_keystream to encrypt or decrypt
(CTR mode is symmetric).
You can move in the keystream with set_counter.
The counter is a full 128-bit big-endian block and is incremented as a whole (NIST SP 800-38A §5.1) after every block, so the keystream would only repeat after 2¹²⁸ blocks. Encrypting more than 2³² blocks under one key and counter is therefore not silently truncated at the 32-bit boundary.
Implementations§
Trait Implementations§
Source§impl StreamCipher for Aes128Ctr
impl StreamCipher for Aes128Ctr
fn xor_keystream(&mut self, in_out: &mut [u8])
Auto Trait Implementations§
impl Freeze for Aes128Ctr
impl RefUnwindSafe for Aes128Ctr
impl Send for Aes128Ctr
impl Sync for Aes128Ctr
impl Unpin for Aes128Ctr
impl UnsafeUnpin for Aes128Ctr
impl UnwindSafe for Aes128Ctr
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