pub struct Rabbit { /* private fields */ }Expand description
Rabbit stream cipher.
The new constructor applies both the key setup and the RFC IV setup.
without_iv leaves the cipher in the key-only state used by the RFC’s
key-setup test vectors.
Implementations§
Source§impl Rabbit
impl Rabbit
Sourcepub fn new(key: &[u8; 16], iv: &[u8; 8]) -> Self
pub fn new(key: &[u8; 16], iv: &[u8; 8]) -> Self
Create Rabbit from a 128-bit key and 64-bit IV.
Sourcepub fn without_iv(key: &[u8; 16]) -> Self
pub fn without_iv(key: &[u8; 16]) -> Self
Create Rabbit from a 128-bit key without applying the optional IV setup.
Sourcepub fn new_wiping(key: &mut [u8; 16], iv: &mut [u8; 8]) -> Self
pub fn new_wiping(key: &mut [u8; 16], iv: &mut [u8; 8]) -> Self
Create and wipe the caller’s key and IV buffers.
Sourcepub fn without_iv_wiping(key: &mut [u8; 16]) -> Self
pub fn without_iv_wiping(key: &mut [u8; 16]) -> Self
Create without IV setup and wipe the caller’s key buffer.
Sourcepub fn apply_keystream(&mut self, buf: &mut [u8])
pub fn apply_keystream(&mut self, buf: &mut [u8])
XOR the Rabbit keystream into buf in place.
Sourcepub fn fill(&mut self, buf: &mut [u8])
pub fn fill(&mut self, buf: &mut [u8])
Fill buf with keystream bytes by XORing into the existing contents.
Sourcepub fn keystream_block(&mut self) -> [u8; 16]
pub fn keystream_block(&mut self) -> [u8; 16]
Return the next 16 bytes of keystream.
Trait Implementations§
Source§impl StreamCipher for Rabbit
impl StreamCipher for Rabbit
Source§fn apply_keystream(&mut self, buf: &mut [u8])
fn apply_keystream(&mut self, buf: &mut [u8])
Alias for
Self::fill for callers that prefer this terminology.Auto Trait Implementations§
impl Freeze for Rabbit
impl RefUnwindSafe for Rabbit
impl Send for Rabbit
impl Sync for Rabbit
impl Unpin for Rabbit
impl UnsafeUnpin for Rabbit
impl UnwindSafe for Rabbit
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