Struct Rc4Core

Source
pub struct Rc4Core<KeySize> { /* private fields */ }
Expand description

Core state of the RC4 stream cipher initialized only with key.

Trait Implementations§

Source§

impl<KeySize> BlockSizeUser for Rc4Core<KeySize>

Source§

type BlockSize = UInt<UTerm, B1>

Size of the block in bytes.
Source§

fn block_size() -> usize

Return block size in bytes.
Source§

impl<KeySize> KeyInit for Rc4Core<KeySize>
where KeySize: ArrayLength<u8>,

Source§

fn new(key: &Key<KeySize>) -> Self

Create new value from fixed size key.
Source§

fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>

Create new value from variable size key.
Source§

impl<KeySize> KeySizeUser for Rc4Core<KeySize>
where KeySize: ArrayLength<u8>,

Source§

type KeySize = KeySize

Key size in bytes.
Source§

fn key_size() -> usize

Return key size in bytes.
Source§

impl<KeySize> StreamCipherCore for Rc4Core<KeySize>

Source§

fn remaining_blocks(&self) -> Option<usize>

Return number of remaining blocks before cipher wraps around. Read more
Source§

fn process_with_backend( &mut self, f: impl StreamClosure<BlockSize = Self::BlockSize>, )

Process data using backend provided to the rank-2 closure.
Source§

fn write_keystream_block( &mut self, block: &mut GenericArray<u8, Self::BlockSize>, )

Write keystream block. Read more
Source§

fn write_keystream_blocks( &mut self, blocks: &mut [GenericArray<u8, Self::BlockSize>], )

Write keystream blocks. Read more
Source§

fn apply_keystream_block_inout( &mut self, block: InOut<'_, '_, GenericArray<u8, Self::BlockSize>>, )

Apply keystream block. Read more
Source§

fn apply_keystream_blocks( &mut self, blocks: &mut [GenericArray<u8, Self::BlockSize>], )

Apply keystream blocks. Read more
Source§

fn apply_keystream_blocks_inout( &mut self, blocks: InOutBuf<'_, '_, GenericArray<u8, Self::BlockSize>>, )

Apply keystream blocks. Read more
Source§

fn try_apply_keystream_partial( self, buf: InOutBuf<'_, '_, u8>, ) -> Result<(), StreamCipherError>

Try to apply keystream to data not divided into blocks. Read more
Source§

fn apply_keystream_partial(self, buf: InOutBuf<'_, '_, u8>)

Try to apply keystream to data not divided into blocks. Read more
Source§

impl<KeySize> ZeroizeOnDrop for Rc4Core<KeySize>
where KeySize: ArrayLength<u8>,

Available on crate feature zeroize only.

Auto Trait Implementations§

§

impl<KeySize> Freeze for Rc4Core<KeySize>

§

impl<KeySize> RefUnwindSafe for Rc4Core<KeySize>
where KeySize: RefUnwindSafe,

§

impl<KeySize> Send for Rc4Core<KeySize>
where KeySize: Send,

§

impl<KeySize> Sync for Rc4Core<KeySize>
where KeySize: Sync,

§

impl<KeySize> Unpin for Rc4Core<KeySize>
where KeySize: Unpin,

§

impl<KeySize> UnwindSafe for Rc4Core<KeySize>
where KeySize: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.