pub struct WideGhashSqProduct { /* private fields */ }Expand description
The unreduced product of two GHASH^2 elements.
Holds the three GHASH widening products of the Karatsuba decomposition, before any reduction.
Take x = x_0 + x_1·Y and y = y_0 + y_1·Y over GHASH, with Y^2 = Y + X^-1.
Then z = x·y has coordinates:
z_0 = x_0·y_0 + (x_1·y_1)·X^-1z_1 = (x_0+x_1)·(y_0+y_1) + x_0·y_0
The three scalar products it defers are:
x_0·y_0andx_1·y_1, computed together as one packedPackedBinaryGhash2x128bmultiply.(x_0+x_1)·(y_0+y_1), the Karatsuba cross term, a scalar GHASH multiply.
Both the GHASH reduction and the X^-1 scaling are GF(2)-linear.
So a sum of products reduces to the reduction of the XOR of their unreduced forms.
An inner product over GHASH^2 then accumulates by XOR and reduces only once at the end.
Trait Implementations§
Source§impl Add for WideGhashSqProduct
impl Add for WideGhashSqProduct
Source§impl AddAssign for WideGhashSqProduct
impl AddAssign for WideGhashSqProduct
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl Clone for WideGhashSqProduct
impl Clone for WideGhashSqProduct
Source§fn clone(&self) -> WideGhashSqProduct
fn clone(&self) -> WideGhashSqProduct
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WideGhashSqProduct
impl Debug for WideGhashSqProduct
Source§impl Default for WideGhashSqProduct
impl Default for WideGhashSqProduct
Source§fn default() -> WideGhashSqProduct
fn default() -> WideGhashSqProduct
Returns the “default value” for a type. Read more
Source§impl Sub for WideGhashSqProduct
impl Sub for WideGhashSqProduct
Source§impl SubAssign for WideGhashSqProduct
impl SubAssign for WideGhashSqProduct
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl Sum for WideGhashSqProduct
impl Sum for WideGhashSqProduct
impl Copy for WideGhashSqProduct
Auto Trait Implementations§
impl Freeze for WideGhashSqProduct
impl RefUnwindSafe for WideGhashSqProduct
impl Send for WideGhashSqProduct
impl Sync for WideGhashSqProduct
impl Unpin for WideGhashSqProduct
impl UnsafeUnpin for WideGhashSqProduct
impl UnwindSafe for WideGhashSqProduct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more