pub struct ChaChaCore<R: Rounds, V: Variant> { /* private fields */ }Expand description
The ChaCha core function.
Implementations§
Source§impl<R: Rounds, V: Variant> ChaChaCore<R, V>
impl<R: Rounds, V: Variant> ChaChaCore<R, V>
Sourcepub fn get_block_pos(&self) -> V::Counter
pub fn get_block_pos(&self) -> V::Counter
Get the current block position.
Sourcepub fn set_block_pos(&mut self, pos: V::Counter)
pub fn set_block_pos(&mut self, pos: V::Counter)
Set the block position.
Trait Implementations§
Source§impl<R: Rounds, V: Variant> BlockSizeUser for ChaChaCore<R, V>
Available on crate feature cipher only.
impl<R: Rounds, V: Variant> BlockSizeUser for ChaChaCore<R, V>
Available on crate feature
cipher only.Source§impl<R: Rounds, V: Variant> Drop for ChaChaCore<R, V>
Available on crate feature zeroize only.
impl<R: Rounds, V: Variant> Drop for ChaChaCore<R, V>
Available on crate feature
zeroize only.Source§impl<R: Rounds, V: Variant> Generator for ChaChaCore<R, V>
Available on crate feature rng only.
impl<R: Rounds, V: Variant> Generator for ChaChaCore<R, V>
Available on crate feature
rng only.Source§impl<R: Rounds> IvSizeUser for ChaChaCore<R, Ietf>
Available on crate feature cipher only.
impl<R: Rounds> IvSizeUser for ChaChaCore<R, Ietf>
Available on crate feature
cipher only.Source§impl IvSizeUser for ChaChaCore<R20, Legacy>
Available on crate feature legacy only.
impl IvSizeUser for ChaChaCore<R20, Legacy>
Available on crate feature
legacy only.Source§impl KeyIvInit for ChaChaCore<R20, Legacy>
Available on crate feature legacy only.
impl KeyIvInit for ChaChaCore<R20, Legacy>
Available on crate feature
legacy only.Source§fn new(key: &Key, iv: &LegacyNonce) -> Self
fn new(key: &Key, iv: &LegacyNonce) -> 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. Read more
Source§impl<R: Rounds> KeySizeUser for ChaChaCore<R, Ietf>
Available on crate feature cipher only.
impl<R: Rounds> KeySizeUser for ChaChaCore<R, Ietf>
Available on crate feature
cipher only.Source§impl KeySizeUser for ChaChaCore<R20, Legacy>
Available on crate feature legacy only.
impl KeySizeUser for ChaChaCore<R20, Legacy>
Available on crate feature
legacy only.Source§impl<R: Rounds, V: Variant> SeedableRng for ChaChaCore<R, V>
Available on crate feature rng only.
impl<R: Rounds, V: Variant> SeedableRng for ChaChaCore<R, V>
Available on crate feature
rng only.Source§type Seed = [u8; 32]
type Seed = [u8; 32]
Seed type, which is restricted to types mutably-dereferenceable as
u8
arrays (we recommend [u8; N] for some N). Read moreSource§fn seed_from_u64(state: u64) -> Self
fn seed_from_u64(state: u64) -> Self
Create a new PRNG using a
u64 seed. Read moreSource§impl<R: Rounds, V: Variant> StreamCipherCore for ChaChaCore<R, V>
Available on crate feature cipher only.
impl<R: Rounds, V: Variant> StreamCipherCore for ChaChaCore<R, V>
Available on crate feature
cipher only.Source§fn remaining_blocks(&self) -> Option<usize>
fn remaining_blocks(&self) -> Option<usize>
Return number of remaining blocks before the cipher wraps around. Read more
Source§fn process_with_backend(
&mut self,
f: impl StreamCipherClosure<BlockSize = Self::BlockSize>,
)
fn process_with_backend( &mut self, f: impl StreamCipherClosure<BlockSize = Self::BlockSize>, )
Process data using backend provided to the rank-2 closure.
Source§fn write_keystream_block(&mut self, block: &mut Array<u8, Self::BlockSize>)
fn write_keystream_block(&mut self, block: &mut Array<u8, Self::BlockSize>)
Write keystream block. Read more
Source§fn write_keystream_blocks(&mut self, blocks: &mut [Array<u8, Self::BlockSize>])
fn write_keystream_blocks(&mut self, blocks: &mut [Array<u8, Self::BlockSize>])
Write keystream blocks. Read more
Source§fn apply_keystream_block_inout(
&mut self,
block: InOut<'_, '_, Array<u8, Self::BlockSize>>,
)
fn apply_keystream_block_inout( &mut self, block: InOut<'_, '_, Array<u8, Self::BlockSize>>, )
Apply keystream block. Read more
Source§fn apply_keystream_blocks(&mut self, blocks: &mut [Array<u8, Self::BlockSize>])
fn apply_keystream_blocks(&mut self, blocks: &mut [Array<u8, Self::BlockSize>])
Apply keystream blocks. Read more
Source§fn apply_keystream_blocks_inout(
&mut self,
blocks: InOutBuf<'_, '_, Array<u8, Self::BlockSize>>,
)
fn apply_keystream_blocks_inout( &mut self, blocks: InOutBuf<'_, '_, Array<u8, Self::BlockSize>>, )
Apply keystream blocks. Read more
Source§fn try_apply_keystream_partial(
self,
buf: InOutBuf<'_, '_, u8>,
) -> Result<(), StreamCipherError>
fn try_apply_keystream_partial( self, buf: InOutBuf<'_, '_, u8>, ) -> Result<(), StreamCipherError>
Try to apply keystream to data not divided into blocks. Read more
Source§impl<R: Rounds, V: Variant> StreamCipherSeekCore for ChaChaCore<R, V>
Available on crate feature cipher only.
impl<R: Rounds, V: Variant> StreamCipherSeekCore for ChaChaCore<R, V>
Available on crate feature
cipher only.impl<R: Rounds, V: Variant> ZeroizeOnDrop for ChaChaCore<R, V>
Available on crate feature
zeroize only.Auto Trait Implementations§
impl<R, V> Freeze for ChaChaCore<R, V>
impl<R, V> RefUnwindSafe for ChaChaCore<R, V>where
R: RefUnwindSafe,
V: RefUnwindSafe,
impl<R, V> Send for ChaChaCore<R, V>
impl<R, V> Sync for ChaChaCore<R, V>
impl<R, V> Unpin for ChaChaCore<R, V>
impl<R, V> UnwindSafe for ChaChaCore<R, V>where
R: UnwindSafe,
V: 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