#[repr(transparent)]pub struct Block16(pub u16);Expand description
GF(2^16) in the tower basis: lo + hi·X
over Block8, lo in the low 8 bits.
Tuple Fields§
§0: u16Implementations§
Trait Implementations§
Source§impl AddAssign for Block16
impl AddAssign for Block16
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl BinaryFieldExtras for Block16
impl BinaryFieldExtras for Block16
Source§fn trace(&self) -> Bit
fn trace(&self) -> Bit
Returns the absolute trace Σ_{i<BITS} self^(2^i), always
0 or 1; the tower fields compute it as a masked parity.
Source§fn solve_quadratic(c: Self) -> Option<Self>
fn solve_quadratic(c: Self) -> Option<Self>
Returns a root of x^2 + x = c, or
None iff Tr(c) = 1; the other
root is result + ONE. The fixed choice defines the Cantor basis.
The value path is constant time; only Some/None reveals Tr(c).Source§impl CanonicalDeserialize for Block16
impl CanonicalDeserialize for Block16
Source§impl CanonicalSerialize for Block16
impl CanonicalSerialize for Block16
impl Copy for Block16
Source§impl<'de> Deserialize<'de> for Block16
impl<'de> Deserialize<'de> for Block16
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Block16
Source§impl FlatPromote<Block8> for Block16
impl FlatPromote<Block8> for Block16
Source§impl FlatPromote<Block16> for Block128
Available on non-crate feature table-math only.
impl FlatPromote<Block16> for Block128
Available on non-crate feature
table-math only.Source§impl FlatPromote<Block16> for Block256
impl FlatPromote<Block16> for Block256
Source§impl FlatPromote<Block16> for Block32
impl FlatPromote<Block16> for Block32
Source§impl FlatPromote<Block16> for Block64
impl FlatPromote<Block16> for Block64
Source§impl HardwareField for Block16
impl HardwareField for Block16
Source§fn to_hardware(self) -> Flat<Self>
fn to_hardware(self) -> Flat<Self>
Maps
self to the flat basis: φ(self).Source§fn from_hardware(value: Flat<Self>) -> Self
fn from_hardware(value: Flat<Self>) -> Self
Maps
value back to the tower basis: φ⁻¹(value).Source§fn add_hardware_packed(
lhs: PackedFlat<Self>,
rhs: PackedFlat<Self>,
) -> PackedFlat<Self>
fn add_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>
Adds two packed flat vectors lane by lane (XOR).
Source§fn mul_hardware_packed(
lhs: PackedFlat<Self>,
rhs: PackedFlat<Self>,
) -> PackedFlat<Self>
fn mul_hardware_packed( lhs: PackedFlat<Self>, rhs: PackedFlat<Self>, ) -> PackedFlat<Self>
Multiplies two packed flat vectors lane by lane.
Source§fn mul_hardware_scalar_packed(
lhs: PackedFlat<Self>,
rhs: Flat<Self>,
) -> PackedFlat<Self>
fn mul_hardware_scalar_packed( lhs: PackedFlat<Self>, rhs: Flat<Self>, ) -> PackedFlat<Self>
Multiplies every lane of
lhs by the flat scalar rhs.Source§impl Mul<Block16> for PackedBlock16
impl Mul<Block16> for PackedBlock16
Source§impl MulAssign for Block16
impl MulAssign for Block16
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl PackableField for Block16
impl PackableField for Block16
impl StructuralPartialEq for Block16
Source§impl SubAssign for Block16
impl SubAssign for Block16
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl TowerField for Block16
impl TowerField for Block16
Source§const EXTENSION_TAU: Self = Self::TAU
const EXTENSION_TAU: Self = Self::TAU
τ of the next level, F[X] / (X^2 + X + τ), for Block8 up.
Tr(τ) = 1 makes X^2 + X + τ irreducible.
Source§fn invert(&self) -> Self
fn invert(&self) -> Self
Returns
self^-1, or 0 for 0. No branch on the value in the default build.Source§fn from_uniform_bytes(bytes: &[u8; 32]) -> Self
fn from_uniform_bytes(bytes: &[u8; 32]) -> Self
Builds the element from the first
BITS bits
of bytes, little-endian; ignores the rest.Auto Trait Implementations§
impl Freeze for Block16
impl RefUnwindSafe for Block16
impl Send for Block16
impl Sync for Block16
impl Unpin for Block16
impl UnsafeUnpin for Block16
impl UnwindSafe for Block16
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<F> FlatPromote<F> for Fwhere
F: HardwareField,
impl<F> FlatPromote<F> for Fwhere
F: HardwareField,
Source§fn promote_flat(val: Flat<F>) -> Flat<F>
fn promote_flat(val: Flat<F>) -> Flat<F>
Maps a flat
FromF element into the flat basis of Self.Source§fn promote_flat_batch(input: &[Flat<FromF>], output: &mut [Flat<Self>])
fn promote_flat_batch(input: &[Flat<FromF>], output: &mut [Flat<Self>])
Promotes
input[i] into output[i] for every i below
the shorter length; the rest of output is left as it is.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