pub struct StreamCipherCoreWrapper<T: BlockSizeUser>{ /* private fields */ }
Expand description
Wrapper around StreamCipherCore
implementations.
It handles data buffering and implements the slice-based traits.
Implementations§
Trait Implementations§
Source§impl<T: Clone + BlockSizeUser> Clone for StreamCipherCoreWrapper<T>
impl<T: Clone + BlockSizeUser> Clone for StreamCipherCoreWrapper<T>
Source§fn clone(&self) -> StreamCipherCoreWrapper<T>
fn clone(&self) -> StreamCipherCoreWrapper<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Default + BlockSizeUser> Default for StreamCipherCoreWrapper<T>
impl<T: Default + BlockSizeUser> Default for StreamCipherCoreWrapper<T>
Source§fn default() -> StreamCipherCoreWrapper<T>
fn default() -> StreamCipherCoreWrapper<T>
Returns the “default value” for a type. Read more
Source§impl<T> Drop for StreamCipherCoreWrapper<T>
impl<T> Drop for StreamCipherCoreWrapper<T>
Source§impl<T: IvSizeUser + BlockSizeUser> IvSizeUser for StreamCipherCoreWrapper<T>
impl<T: IvSizeUser + BlockSizeUser> IvSizeUser for StreamCipherCoreWrapper<T>
Source§impl<T: KeyInit + BlockSizeUser> KeyInit for StreamCipherCoreWrapper<T>
impl<T: KeyInit + BlockSizeUser> KeyInit for StreamCipherCoreWrapper<T>
Source§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable size key.
Source§fn generate_key(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::KeySize>
fn generate_key( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::KeySize>
Generate random key using the provided
CryptoRng
.Source§impl<T: KeyIvInit + BlockSizeUser> KeyIvInit for StreamCipherCoreWrapper<T>
impl<T: KeyIvInit + BlockSizeUser> KeyIvInit for StreamCipherCoreWrapper<T>
Source§fn new(key: &Key<Self>, iv: &Iv<Self>) -> Self
fn new(key: &Key<Self>, iv: &Iv<Self>) -> Self
Create new value from fixed length key and nonce.
Source§fn new_from_slices(key: &[u8], iv: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slices(key: &[u8], iv: &[u8]) -> Result<Self, InvalidLength>
Create new value from variable length key and nonce.
Source§fn generate_key(
rng: impl CryptoRng + RngCore,
) -> GenericArray<u8, Self::KeySize>
fn generate_key( rng: impl CryptoRng + RngCore, ) -> GenericArray<u8, Self::KeySize>
Generate random key using the provided
CryptoRng
.Source§fn generate_iv(rng: impl CryptoRng + RngCore) -> GenericArray<u8, Self::IvSize>
fn generate_iv(rng: impl CryptoRng + RngCore) -> GenericArray<u8, Self::IvSize>
Generate random IV using the provided
CryptoRng
.Source§fn generate_key_iv(
rng: impl CryptoRng + RngCore,
) -> (GenericArray<u8, Self::KeySize>, GenericArray<u8, Self::IvSize>)
fn generate_key_iv( rng: impl CryptoRng + RngCore, ) -> (GenericArray<u8, Self::KeySize>, GenericArray<u8, Self::IvSize>)
Generate random key and nonce using the provided
CryptoRng
.Source§impl<T: KeySizeUser + BlockSizeUser> KeySizeUser for StreamCipherCoreWrapper<T>
impl<T: KeySizeUser + BlockSizeUser> KeySizeUser for StreamCipherCoreWrapper<T>
Source§impl<T: StreamCipherCore> StreamCipher for StreamCipherCoreWrapper<T>
impl<T: StreamCipherCore> StreamCipher for StreamCipherCoreWrapper<T>
Source§fn try_apply_keystream_inout(
&mut self,
data: InOutBuf<'_, '_, u8>,
) -> Result<(), StreamCipherError>
fn try_apply_keystream_inout( &mut self, data: InOutBuf<'_, '_, u8>, ) -> Result<(), StreamCipherError>
Apply keystream to
inout
data. Read moreSource§fn try_apply_keystream(
&mut self,
buf: &mut [u8],
) -> Result<(), StreamCipherError>
fn try_apply_keystream( &mut self, buf: &mut [u8], ) -> Result<(), StreamCipherError>
Apply keystream to data behind
buf
. Read moreSource§fn apply_keystream_inout(&mut self, buf: InOutBuf<'_, '_, u8>)
fn apply_keystream_inout(&mut self, buf: InOutBuf<'_, '_, u8>)
Apply keystream to
inout
data. Read moreSource§fn apply_keystream(&mut self, buf: &mut [u8])
fn apply_keystream(&mut self, buf: &mut [u8])
Apply keystream to data in-place. Read more
Source§fn apply_keystream_b2b(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<(), StreamCipherError>
fn apply_keystream_b2b( &mut self, input: &[u8], output: &mut [u8], ) -> Result<(), StreamCipherError>
Apply keystream to data buffer-to-buffer. Read more
Source§impl<T: StreamCipherSeekCore> StreamCipherSeek for StreamCipherCoreWrapper<T>
impl<T: StreamCipherSeekCore> StreamCipherSeek for StreamCipherCoreWrapper<T>
Source§fn try_current_pos<SN: SeekNum>(&self) -> Result<SN, OverflowError>
fn try_current_pos<SN: SeekNum>(&self) -> Result<SN, OverflowError>
Try to get current keystream position Read more
Source§fn try_seek<SN: SeekNum>(
&mut self,
new_pos: SN,
) -> Result<(), StreamCipherError>
fn try_seek<SN: SeekNum>( &mut self, new_pos: SN, ) -> Result<(), StreamCipherError>
Try to seek to the given position Read more
Source§fn current_pos<T: SeekNum>(&self) -> T
fn current_pos<T: SeekNum>(&self) -> T
Get current keystream position Read more
impl<T> ZeroizeOnDrop for StreamCipherCoreWrapper<T>where
T: BlockSizeUser + ZeroizeOnDrop,
T::BlockSize: IsLess<U256>,
Le<T::BlockSize, U256>: NonZero,
Auto Trait Implementations§
impl<T> Freeze for StreamCipherCoreWrapper<T>
impl<T> RefUnwindSafe for StreamCipherCoreWrapper<T>where
T: RefUnwindSafe,
<<T as BlockSizeUser>::BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<T> Send for StreamCipherCoreWrapper<T>where
T: Send,
impl<T> Sync for StreamCipherCoreWrapper<T>where
T: Sync,
impl<T> Unpin for StreamCipherCoreWrapper<T>
impl<T> UnwindSafe for StreamCipherCoreWrapper<T>
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