Struct rabbit::Rabbit[][src]

pub struct Rabbit { /* fields omitted */ }

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. data is 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 NewCipher for Rabbit[src]

type KeySize = U16

Key size in bytes

type NonceSize = U8

Nonce size in bytes

impl StreamCipher for Rabbit[src]

Auto Trait Implementations

impl Send for Rabbit

impl Sync for Rabbit

impl Unpin for Rabbit

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.