pub(crate) trait Word:
Sized
+ Copy
+ Default
+ 'static
+ BitAnd<Output = Self>
+ BitAndAssign
+ BitOr<Output = Self>
+ BitOrAssign
+ BitXor<Output = Self>
+ BitXorAssign
+ Not<Output = Self>
+ Shl<u32, Output = Self>
+ Shr<u32, Output = Self> {
type Blocks: ArraySize;
const ROW_BITS: u32 = _;
const HALF_ROW: u32 = _;
const QUARTER_ROW: u32 = _;
// Required methods
fn ror(self, n: u32) -> Self;
fn uniform_row(b: u8) -> Self;
fn pack_rows(r0: u8, r1: u8, r2: u8, r3: u8) -> Self;
fn byte_repeat(b: u8) -> Self;
fn bitslice(output: &mut [Self], input: &Array<Block, Self::Blocks>);
fn inv_bitslice(input: &[Self]) -> Array<Block, Self::Blocks>;
// Provided method
fn ror_distance(rows: u32, cols: u32) -> u32 { ... }
}Expand description
Width-abstracted machine word holding one row of a bitsliced AES state.
Provided Associated Constants§
Sourceconst ROW_BITS: u32 = _
const ROW_BITS: u32 = _
Width in bits of one row of the bitsliced state (8 for u32, 16 for u64).
Sourceconst QUARTER_ROW: u32 = _
const QUARTER_ROW: u32 = _
Quarter of ROW_BITS.
Required Associated Types§
Required Methods§
Sourcefn uniform_row(b: u8) -> Self
fn uniform_row(b: u8) -> Self
Pack the same byte across all 4 rows of the word.
Sourcefn pack_rows(r0: u8, r1: u8, r2: u8, r3: u8) -> Self
fn pack_rows(r0: u8, r1: u8, r2: u8, r3: u8) -> Self
Place one byte at each of the 4 row positions of the word (row 0 = LSB).
Sourcefn byte_repeat(b: u8) -> Self
fn byte_repeat(b: u8) -> Self
Replicate byte b across every byte of the word.
Sourcefn bitslice(output: &mut [Self], input: &Array<Block, Self::Blocks>)
fn bitslice(output: &mut [Self], input: &Array<Block, Self::Blocks>)
Pack Self::Blocks input blocks into a bitsliced 8-row state slice.
Sourcefn inv_bitslice(input: &[Self]) -> Array<Block, Self::Blocks>
fn inv_bitslice(input: &[Self]) -> Array<Block, Self::Blocks>
Unpack a bitsliced 8-row state slice into Self::Blocks output blocks.
Provided Methods§
Sourcefn ror_distance(rows: u32, cols: u32) -> u32
fn ror_distance(rows: u32, cols: u32) -> u32
Distance in bits to rotate a state row by (rows, cols) positions.
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.
Implementations on Foreign Types§
Source§impl Word for u32
impl Word for u32
Source§fn bitslice(output: &mut [u32], input: &Array<Block, U2>)
fn bitslice(output: &mut [u32], input: &Array<Block, U2>)
Bitslice two 128-bit input blocks into a 256-bit internal state.
Source§fn inv_bitslice(input: &[u32]) -> Array<Block, U2>
fn inv_bitslice(input: &[u32]) -> Array<Block, U2>
Un-bitslice a 256-bit internal state into two 128-bit blocks.
type Blocks = UInt<UInt<UTerm, B1>, B0>
fn ror(self, n: u32) -> u32
fn uniform_row(b: u8) -> u32
fn pack_rows(r0: u8, r1: u8, r2: u8, r3: u8) -> u32
fn byte_repeat(b: u8) -> u32
Source§impl Word for u64
impl Word for u64
Source§fn bitslice(output: &mut [u64], input: &Array<Block, U4>)
fn bitslice(output: &mut [u64], input: &Array<Block, U4>)
Bitslice four 128-bit input blocks into a 512-bit internal state.
Source§fn inv_bitslice(input: &[u64]) -> Array<Block, U4>
fn inv_bitslice(input: &[u64]) -> Array<Block, U4>
Un-bitslice a 512-bit internal state into four 128-bit blocks.