Variant

Trait Variant 

Source
pub trait Variant: Sealed {
    type Counter: Copy;

    // Required methods
    fn get_block_pos(row: &[u32]) -> Self::Counter;
    fn set_block_pos(row: &mut [u32], pos: Self::Counter);
    fn remaining_blocks(block_pos: Self::Counter) -> Option<usize>;
}
Expand description

A trait that distinguishes some ChaCha variants. Contains configurations for “Legacy” DJB variant and the IETF variant.

Required Associated Types§

Source

type Counter: Copy

The counter’s type.

Required Methods§

Source

fn get_block_pos(row: &[u32]) -> Self::Counter

Takes a slice of state[12..NONCE_INDEX] to convert it into Self::Counter.

Source

fn set_block_pos(row: &mut [u32], pos: Self::Counter)

Breaks down the Self::Counter type into a u32 array for setting the block pos.

Source

fn remaining_blocks(block_pos: Self::Counter) -> Option<usize>

A helper method for calculating the remaining blocks using these types

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Variant for Ietf

Source§

impl Variant for Legacy

Available on crate features legacy or rng only.