[−][src]Struct rabbit::Rabbit
Rabbit stream cipher state.
Implementations
impl Rabbit[src]
pub fn setup_without_iv(key: [u8; 16]) -> Rabbit[src]
Creates an empty rabbit state, then setups the given key on it.
See RFC 4503 3.2. Initialization Vector (page 5).
pub fn setup(key: [u8; 16], iv: [u8; 8]) -> Rabbit[src]
Creates an empty rabbit state, then setups the given key and iv on it.
pub fn reset(&mut self)[src]
Restores master state (iv will be lost).
pub fn reinit(&mut self, iv: [u8; 8])[src]
Restores master state, than setups initialization vector iv on it.
pub fn encrypt_inplace(&mut self, data: &mut [u8]) -> bool[src]
Encrypts bytes of data inplace.
Returns:
true– OK;false– max message length (16 * 2⁶⁴ bytes) was exceeded.datais not affected.
pub fn decrypt_inplace(&mut self, data: &mut [u8]) -> bool[src]
Decrypts bytes of data inplace (see Rabbit::encrypt_inplace).
Trait Implementations
impl Debug for Rabbit[src]
impl NewStreamCipher for Rabbit[src]
type KeySize = U16
Key size in bytes
type NonceSize = U8
Nonce size in bytes
fn new(key: &Key<Self>, iv: &Nonce<Self>) -> Self[src]
fn new_var(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidKeyNonceLength>[src]
impl SyncStreamCipher for Rabbit[src]
fn try_apply_keystream(&mut self, data: &mut [u8]) -> Result<(), LoopError>[src]
fn apply_keystream(&mut self, data: &mut [u8])[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<C> NewStreamCipher for C where
C: FromBlockCipherMut,
<C as FromBlockCipherMut>::BlockCipher: NewBlockCipher, [src]
C: FromBlockCipherMut,
<C as FromBlockCipherMut>::BlockCipher: NewBlockCipher,
type KeySize = <<C as FromBlockCipherMut>::BlockCipher as NewBlockCipher>::KeySize
Key size in bytes
type NonceSize = <C as FromBlockCipherMut>::NonceSize
Nonce size in bytes
pub fn new(
key: &GenericArray<u8, <C as NewStreamCipher>::KeySize>,
nonce: &GenericArray<u8, <C as NewStreamCipher>::NonceSize>
) -> C[src]
key: &GenericArray<u8, <C as NewStreamCipher>::KeySize>,
nonce: &GenericArray<u8, <C as NewStreamCipher>::NonceSize>
) -> C
pub fn new_var(key: &[u8], nonce: &[u8]) -> Result<C, InvalidKeyNonceLength>[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<C> StreamCipher for C where
C: SyncStreamCipher, [src]
C: SyncStreamCipher,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,