Struct scuttlebutt::field::F56b
source · pub struct F56b(/* private fields */);
Expand description
An element of the finite field $\textsf{GF}(2^{56})
$ reduced over $x^{56} + x^8 + x^3 + x^2 + 1
$
Trait Implementations§
source§impl<'a> AddAssign<&'a F56b> for F56b
impl<'a> AddAssign<&'a F56b> for F56b
source§fn add_assign(&mut self, rhs: &'a F56b)
fn add_assign(&mut self, rhs: &'a F56b)
Performs the
+=
operation. Read moresource§impl AddAssign for F56b
impl AddAssign for F56b
source§fn add_assign(&mut self, rhs: F56b)
fn add_assign(&mut self, rhs: F56b)
Performs the
+=
operation. Read moresource§impl CanonicalSerialize for F56b
impl CanonicalSerialize for F56b
§type Serializer = ByteElementSerializer<F56b>
type Serializer = ByteElementSerializer<F56b>
A way to serialize field elements of this type. Read more
§type Deserializer = ByteElementDeserializer<F56b>
type Deserializer = ByteElementDeserializer<F56b>
A way to deserialize field elements of this type. Read more
§type ByteReprLen = <<UInt<UInt<UInt<UTerm, B1>, B1>, B1> as Add<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>>>::Output as Div<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>>::Output
type ByteReprLen = <<UInt<UInt<UInt<UTerm, B1>, B1>, B1> as Add<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>>>::Output as Div<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>>::Output
The number of bytes in the byte representation for this element.
§type FromBytesError = BiggerThanModulus
type FromBytesError = BiggerThanModulus
The error that can result from trying to decode an invalid byte sequence.
source§fn from_bytes(
bytes: &GenericArray<u8, Self::ByteReprLen>
) -> Result<Self, Self::FromBytesError>
fn from_bytes( bytes: &GenericArray<u8, Self::ByteReprLen> ) -> Result<Self, Self::FromBytesError>
Deserialize an element from a byte array. Read more
source§impl ConditionallySelectable for F56b
impl ConditionallySelectable for F56b
source§impl ConstantTimeEq for F56b
impl ConstantTimeEq for F56b
source§impl<'de> Deserialize<'de> for F56b
impl<'de> Deserialize<'de> for F56b
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Distribution<F56b> for Standard
impl Distribution<F56b> for Standard
source§impl<'a> DivAssign<&'a F56b> for F56b
impl<'a> DivAssign<&'a F56b> for F56b
source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
Performs the
/=
operation. Read moresource§impl DivAssign for F56b
impl DivAssign for F56b
source§fn div_assign(&mut self, rhs: F56b)
fn div_assign(&mut self, rhs: F56b)
Performs the
/=
operation. Read moresource§impl FiniteField for F56b
impl FiniteField for F56b
§type PrimeField = F2
type PrimeField = F2
The prime-order subfield of the finite field.
source§fn polynomial_modulus() -> Polynomial<Self::PrimeField>
fn polynomial_modulus() -> Polynomial<Self::PrimeField>
Multiplication over field elements should be reduced over this polynomial.
§type NumberOfBitsInBitDecomposition = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>
type NumberOfBitsInBitDecomposition = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>
The number of bits in the bit decomposition of any element of this finite field. Read more
source§fn bit_decomposition(
&self
) -> GenericArray<bool, Self::NumberOfBitsInBitDecomposition>
fn bit_decomposition( &self ) -> GenericArray<bool, Self::NumberOfBitsInBitDecomposition>
Decompose the given field element into bits. Read more
source§fn decompose<T: FiniteField + IsSubFieldOf<Self>>(
&self
) -> GenericArray<T, DegreeModulo<T, Self>>
fn decompose<T: FiniteField + IsSubFieldOf<Self>>( &self ) -> GenericArray<T, DegreeModulo<T, Self>>
source§fn from_subfield<T: FiniteField + IsSubFieldOf<Self>>(
arr: &GenericArray<T, DegreeModulo<T, Self>>
) -> Self
fn from_subfield<T: FiniteField + IsSubFieldOf<Self>>( arr: &GenericArray<T, DegreeModulo<T, Self>> ) -> Self
Create a field element from an array of subfield
T
elements. Read moresource§impl FiniteRing for F56b
impl FiniteRing for F56b
source§fn from_uniform_bytes(x: &[u8; 16]) -> Self
fn from_uniform_bytes(x: &[u8; 16]) -> Self
Construct an element from the given uniformly chosen random bytes.
source§fn pow_bounded(&self, n: u128, bound: u16) -> Self
fn pow_bounded(&self, n: u128, bound: u16) -> Self
source§fn pow_var_time(&self, n: u128) -> Self
fn pow_var_time(&self, n: u128) -> Self
Compute
self
to the power of n
, in non-constant time.source§impl IsSubFieldOf<F56b> for F2
impl IsSubFieldOf<F56b> for F2
§type DegreeModulo = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>
type DegreeModulo = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>
The value $
n
$ from above.source§fn decompose_superfield(fe: &F56b) -> GenericArray<Self, U56>
fn decompose_superfield(fe: &F56b) -> GenericArray<Self, U56>
Turn
FE
into an array of Self
, a subfield of FE
.source§fn form_superfield(components: &GenericArray<Self, Self::DegreeModulo>) -> F56b
fn form_superfield(components: &GenericArray<Self, Self::DegreeModulo>) -> F56b
Homomorphically lift an array of
Self
into an FE
.source§impl<'a> MulAssign<&'a F56b> for F56b
impl<'a> MulAssign<&'a F56b> for F56b
source§fn mul_assign(&mut self, rhs: &'a F56b)
fn mul_assign(&mut self, rhs: &'a F56b)
Performs the
*=
operation. Read moresource§impl MulAssign for F56b
impl MulAssign for F56b
source§fn mul_assign(&mut self, rhs: F56b)
fn mul_assign(&mut self, rhs: F56b)
Performs the
*=
operation. Read moresource§impl PartialEq for F56b
impl PartialEq for F56b
source§impl SmallBinaryField for F56b
impl SmallBinaryField for F56b
source§impl<'a> SubAssign<&'a F56b> for F56b
impl<'a> SubAssign<&'a F56b> for F56b
source§fn sub_assign(&mut self, rhs: &'a F56b)
fn sub_assign(&mut self, rhs: &'a F56b)
Performs the
-=
operation. Read moresource§impl SubAssign for F56b
impl SubAssign for F56b
source§fn sub_assign(&mut self, rhs: F56b)
fn sub_assign(&mut self, rhs: F56b)
Performs the
-=
operation. Read moresource§impl TransparentWrapper<u64> for F56b
impl TransparentWrapper<u64> for F56b
§fn wrap_ref(s: &Inner) -> &Self
fn wrap_ref(s: &Inner) -> &Self
Convert a reference to the inner type into a reference to the wrapper
type.
§fn wrap_mut(s: &mut Inner) -> &mut Self
fn wrap_mut(s: &mut Inner) -> &mut Self
Convert a mutable reference to the inner type into a mutable reference to
the wrapper type.
§fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
fn wrap_slice(s: &[Inner]) -> &[Self]where
Self: Sized,
Convert a slice to the inner type into a slice to the wrapper type.
§fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
fn wrap_slice_mut(s: &mut [Inner]) -> &mut [Self]where
Self: Sized,
Convert a mutable slice to the inner type into a mutable slice to the
wrapper type.
§fn peel_ref(s: &Self) -> &Inner
fn peel_ref(s: &Self) -> &Inner
Convert a reference to the wrapper type into a reference to the inner
type.
§fn peel_mut(s: &mut Self) -> &mut Inner
fn peel_mut(s: &mut Self) -> &mut Inner
Convert a mutable reference to the wrapper type into a mutable reference
to the inner type.
§fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
fn peel_slice(s: &[Self]) -> &[Inner]where
Self: Sized,
Convert a slice to the wrapped type into a slice to the inner type.
§fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
fn peel_slice_mut(s: &mut [Self]) -> &mut [Inner]where
Self: Sized,
Convert a mutable slice to the wrapped type into a mutable slice to the
inner type.
impl Copy for F56b
impl Eq for F56b
impl IsSubRingOf<F56b> for F2
Auto Trait Implementations§
impl Freeze for F56b
impl RefUnwindSafe for F56b
impl Send for F56b
impl Sync for F56b
impl Unpin for F56b
impl UnwindSafe for F56b
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<FE> IsSubFieldOf<FE> for FEwhere
FE: FiniteField,
impl<FE> IsSubFieldOf<FE> for FEwhere
FE: FiniteField,
§type DegreeModulo = UInt<UTerm, B1>
type DegreeModulo = UInt<UTerm, B1>
The value $
n
$ from above.source§fn decompose_superfield(
fe: &FE
) -> GenericArray<FE, <FE as IsSubFieldOf<FE>>::DegreeModulo>
fn decompose_superfield( fe: &FE ) -> GenericArray<FE, <FE as IsSubFieldOf<FE>>::DegreeModulo>
Turn
FE
into an array of Self
, a subfield of FE
.source§fn form_superfield(
components: &GenericArray<FE, <FE as IsSubFieldOf<FE>>::DegreeModulo>
) -> FE
fn form_superfield( components: &GenericArray<FE, <FE as IsSubFieldOf<FE>>::DegreeModulo> ) -> FE
Homomorphically lift an array of
Self
into an FE
.