Skip to main content

SlicedGhashSq256b

Type Alias SlicedGhashSq256b 

Source
pub type SlicedGhashSq256b<U> = SlicedPackedField<GhashSq256b, PackedPrimitiveType<U, BinaryField128bGhash>, 2>;
Expand description

A GHASH² packing whose two GHASH coordinates pack into PackedPrimitiveType<U, Ghash128b>.

Aliased Type§

pub struct SlicedGhashSq256b<U>(/* private fields */);

Trait Implementations§

Source§

impl<U> InvertOrZero for SlicedGhashSq256b<U>

Source§

fn invert_or_zero(self) -> Self

Inverts through the norm of the degree-two extension. The conjugate of u = a + b·Y sends Y to the other root of Y² + X·Y + X (the roots sum to X and multiply to X), giving ū = (a + X·b) + b·Y. Its norm N = u·ū = a² + X·b·(a + b) lies in GHASH, and u⁻¹ = ū·N⁻¹. A zero lane has norm zero, so invert_or_zero returns zero there.

Source§

unsafe fn invert(self) -> Self
where Self: Sized,

Returns the multiplicative inverse. Read more
Source§

impl<U> Square for SlicedGhashSq256b<U>

Source§

fn square(self) -> Self

(a + b·Y)² = (a² + X·b²) + (X·b²)·Y — the cross term vanishes in characteristic two, and Y² = X·Y + X.

Source§

impl<U> WideMul for SlicedGhashSq256b<U>

Source§

fn wide_mul(lhs: Self, rhs: Self) -> Self::Output

Karatsuba over Y: defers the three GHASH products a·e, b·f, (a+b)·(e+f).

Source§

fn reduce(wide: Self::Output) -> Self

Reduces the three products and folds Y² = X·Y + X. With the Karatsuba cross term recovered as t₁ + t₀ + t₂: z₀ = t₀ + X·t₂, z₁ = (t₁ + t₀ + t₂) + X·t₂ = z₀ + t₁ + t₂.

Source§

type Output = SlicedGhashSqWide<<PackedPrimitiveType<U, BinaryField128bGhash> as WideMul>::Output>