[][src]Struct lsx::twofish::Twofish

pub struct Twofish { /* fields omitted */ }

The key-dependent data for a given Twofish key. This can be used to encrypt or decrypt blocks of data with that key. If you're inexperienced with crypto, you probably just thought of using this to encrypt/decrypt each block of your input directly, one block at a time. If so, I beg you to read Wikipedia's article on block cipher modes of operation so that you will understand that this is the least secure way to use a block cipher!

Implementations

impl Twofish[src]

pub fn new128(key: &[u8; 16]) -> Twofish[src]

Set up a context to en-/decrypt with a given 128-bit key.

pub fn new192(key: &[u8; 24]) -> Twofish[src]

Set up a context to en-/decrypt with a given 192-bit key.

pub fn new256(key: &[u8; 32]) -> Twofish[src]

Set up a context to en-/decrypt with a given 256-bit key.

pub fn encrypt(&self, i: &[u8; 16], o: &mut [u8; 16])[src]

Encrypt a single block.

pub fn decrypt(&self, i: &[u8; 16], o: &mut [u8; 16])[src]

Decrypt a single block.

Trait Implementations

impl Clone for Twofish[src]

impl Copy for Twofish[src]

impl Debug for Twofish[src]

Auto Trait Implementations

impl RefUnwindSafe for Twofish

impl Send for Twofish

impl Sync for Twofish

impl Unpin for Twofish

impl UnwindSafe for Twofish

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.