pub struct ChaCha { /* private fields */ }
Expand description
Parameters of a ChaCha stream, including fixed parameters and current position.
Implementations§
Source§impl ChaCha
impl ChaCha
pub fn new(key: &[u8; 32], nonce: &[u8]) -> Self
Sourcepub fn refill4(&mut self, drounds: u32, out: &mut [u8; 256])
pub fn refill4(&mut self, drounds: u32, out: &mut [u8; 256])
Produce 4 blocks of output, advancing the state
Sourcepub fn refill(&mut self, drounds: u32, out: &mut [u8; 64])
pub fn refill(&mut self, drounds: u32, out: &mut [u8; 64])
Produce a block of output, advancing the state
pub fn set_stream_param(&mut self, param: u32, value: u64)
pub fn get_stream_param(&self, param: u32) -> u64
Sourcepub fn stream32_eq(&self, rhs: &Self) -> bool
pub fn stream32_eq(&self, rhs: &Self) -> bool
Return whether rhs represents the same stream, irrespective of current 32-bit position.
Sourcepub fn stream64_eq(&self, rhs: &Self) -> bool
pub fn stream64_eq(&self, rhs: &Self) -> bool
Return whether rhs represents the same stream, irrespective of current 64-bit position.
Trait Implementations§
impl Eq for ChaCha
impl StructuralPartialEq for ChaCha
Auto Trait Implementations§
impl Freeze for ChaCha
impl RefUnwindSafe for ChaCha
impl Send for ChaCha
impl Sync for ChaCha
impl Unpin for ChaCha
impl UnwindSafe for ChaCha
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