pub struct Blowfish<T: ByteOrder = BE> {
s: [[u32; 256]; 4],
p: [u32; 18],
_pd: PhantomData<T>,
}
Available on crate feature
utils-blowfish
only.Expand description
Blowfish block cipher instance.
Fields§
§s: [[u32; 256]; 4]
§p: [u32; 18]
§_pd: PhantomData<T>
Implementations§
Source§impl<T: ByteOrder> Blowfish<T>
impl<T: ByteOrder> Blowfish<T>
fn init_state() -> Blowfish<T>
fn expand_key(&mut self, key: &[u8])
fn round_function(&self, x: u32) -> u32
Sourcepub fn encrypt(&self, [l, r]: [u32; 2]) -> [u32; 2]
pub fn encrypt(&self, [l, r]: [u32; 2]) -> [u32; 2]
Encrypts a 64-bit block of data using the Blowfish algorithm.
Sourcepub fn decrypt(&self, [l, r]: [u32; 2]) -> [u32; 2]
pub fn decrypt(&self, [l, r]: [u32; 2]) -> [u32; 2]
Decrypts a 64-bit block of data using the Blowfish algorithm.
Sourcepub fn decrypt_block(&self, buf: &mut [u8])
pub fn decrypt_block(&self, buf: &mut [u8])
Decrypts a block of data in-place.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Blowfish<T>
impl<T> RefUnwindSafe for Blowfish<T>where
T: RefUnwindSafe,
impl<T> Send for Blowfish<T>where
T: Send,
impl<T> Sync for Blowfish<T>where
T: Sync,
impl<T> Unpin for Blowfish<T>where
T: Unpin,
impl<T> UnwindSafe for Blowfish<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more