ChaChaCore

Struct ChaChaCore 

Source
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>

Source

pub fn get_block_pos(&self) -> V::Counter

Get the current block position.

Source

pub fn set_block_pos(&mut self, pos: V::Counter)

Set the block position.

Trait Implementations§

Source§

impl<R: Rounds, V: Variant> Debug for ChaChaCore<R, V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Rounds, V: Variant> Generator for ChaChaCore<R, V>

Source§

fn generate(&mut self, buffer: &mut [u32; 64])

Generates 4 blocks in parallel with avx2 & neon, but merely fills 4 blocks with sse2 & soft

Source§

type Output = [u32; 64]

The output type. Read more
Source§

fn drop(&mut self, output: &mut Self::Output)

Destruct the output buffer Read more
Source§

impl<R: Rounds, V: Variant> SeedableRng for ChaChaCore<R, V>

Source§

type Seed = [u8; 32]

Seed type, which is restricted to types mutably-dereferenceable as u8 arrays (we recommend [u8; N] for some N). Read more
Source§

fn from_seed(seed: Self::Seed) -> Self

Create a new PRNG using the given seed. Read more
Source§

fn seed_from_u64(state: u64) -> Self

Create a new PRNG using a u64 seed. Read more
Source§

fn from_rng<R>(rng: &mut R) -> Self
where R: Rng + ?Sized,

Create a new PRNG seeded from an infallible Rng. Read more
Source§

fn try_from_rng<R>(rng: &mut R) -> Result<Self, <R as TryRng>::Error>
where R: TryRng + ?Sized,

Create a new PRNG seeded from a potentially fallible Rng. Read more

Auto Trait Implementations§

§

impl<R, V> Freeze for ChaChaCore<R, V>

§

impl<R, V> RefUnwindSafe for ChaChaCore<R, V>

§

impl<R, V> Send for ChaChaCore<R, V>
where R: Send, V: Send,

§

impl<R, V> Sync for ChaChaCore<R, V>
where R: Sync, V: Sync,

§

impl<R, V> Unpin for ChaChaCore<R, V>
where R: Unpin, V: Unpin,

§

impl<R, V> UnwindSafe for ChaChaCore<R, V>
where R: UnwindSafe, V: 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, 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.