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§
Required Methods§
Sourcefn get_block_pos(row: &[u32]) -> Self::Counter
fn get_block_pos(row: &[u32]) -> Self::Counter
Takes a slice of state[12..NONCE_INDEX] to convert it into
Self::Counter.
Sourcefn set_block_pos(row: &mut [u32], pos: Self::Counter)
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.
Sourcefn remaining_blocks(block_pos: Self::Counter) -> Option<usize>
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.