Struct rabbit::Rabbit [−][src]
pub struct Rabbit { /* fields omitted */ }
Rabbit stream cipher state.
Implementations
impl Rabbit
[src]
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 NewCipher for Rabbit
[src]
impl NewCipher for Rabbit
[src]type KeySize = U16
Key size in bytes
type NonceSize = U8
Nonce size in bytes
fn new(key: &CipherKey<Self>, iv: &Nonce<Self>) -> Self
[src]
pub fn new_from_slices(key: &[u8], nonce: &[u8]) -> Result<Self, InvalidLength>
[src]
impl StreamCipher for Rabbit
[src]
impl StreamCipher for Rabbit
[src]