pub struct Bit(/* private fields */);Expand description
GF(2) element; the inner byte is invariantly 0 or 1.
Implementations§
Trait Implementations§
Source§impl AddAssign for Bit
impl AddAssign for Bit
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl CanonicalDeserialize for Bit
impl CanonicalDeserialize for Bit
Source§impl CanonicalSerialize for Bit
impl CanonicalSerialize for Bit
impl Copy for Bit
Source§impl<'de> Deserialize<'de> for Bit
impl<'de> Deserialize<'de> for Bit
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 Bit
Source§impl HardwareField for Bit
impl HardwareField for Bit
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 MulAssign for Bit
impl MulAssign for Bit
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl PackableField for Bit
impl PackableField for Bit
impl StructuralPartialEq for Bit
Source§impl SubAssign for Bit
impl SubAssign for Bit
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl TowerField for Bit
impl TowerField for Bit
Source§const EXTENSION_TAU: Self
const EXTENSION_TAU: Self
τ 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 Bit
impl RefUnwindSafe for Bit
impl Send for Bit
impl Sync for Bit
impl Unpin for Bit
impl UnsafeUnpin for Bit
impl UnwindSafe for Bit
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