Skip to main content

Variant

Trait Variant 

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

    // 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: StreamCipherCounter

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".

Implementors§