Struct scuttlebutt::field::F128b

source ·
pub struct F128b(/* private fields */);
Expand description

An element of the finite field $\textsf{GF}(2^{128})$ reduced over $x^{128} + x^7 + x^2 + x + 1$

Trait Implementations§

source§

impl<'a> Add<&'a F128b> for F128b

§

type Output = F128b

The resulting type after applying the + operator.
source§

fn add(self, rhs: &'a F128b) -> Self::Output

Performs the + operation. Read more
source§

impl<'a> Add<F128b> for &'a F128b

§

type Output = F128b

The resulting type after applying the + operator.
source§

fn add(self, rhs: F128b) -> Self::Output

Performs the + operation. Read more
source§

impl<'a> Add for &'a F128b

§

type Output = F128b

The resulting type after applying the + operator.
source§

fn add(self, rhs: &'a F128b) -> Self::Output

Performs the + operation. Read more
source§

impl Add for F128b

§

type Output = F128b

The resulting type after applying the + operator.
source§

fn add(self, rhs: F128b) -> Self::Output

Performs the + operation. Read more
source§

impl<'a> AddAssign<&'a F128b> for F128b

source§

fn add_assign(&mut self, rhs: &'a F128b)

Performs the += operation. Read more
source§

impl AddAssign for F128b

source§

fn add_assign(&mut self, rhs: F128b)

Performs the += operation. Read more
source§

impl CanonicalSerialize for F128b

§

type Serializer = ByteElementSerializer<F128b>

A way to serialize field elements of this type. Read more
§

type Deserializer = ByteElementDeserializer<F128b>

A way to deserialize field elements of this type. Read more
§

type ByteReprLen = UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>

The number of bytes in the byte representation for this element.
§

type FromBytesError = BytesDeserializationCannotFail

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>

Deserialize an element from a byte array. Read more
source§

fn to_bytes(&self) -> GenericArray<u8, Self::ByteReprLen>

Serialize an element into a byte array. Read more
source§

impl Clone for F128b

source§

fn clone(&self) -> F128b

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ConditionallySelectable for F128b

source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
source§

impl ConstantTimeEq for F128b

source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
source§

impl Debug for F128b

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for F128b

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for F128b

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl Distribution<F128b> for Standard

source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F128b

Generate a random value of T, using rng as the source of randomness.
source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
source§

impl<'a> Div<&'a F128b> for F128b

§

type Output = F128b

The resulting type after applying the / operator.
source§

fn div(self, rhs: &'a F128b) -> Self::Output

Performs the / operation. Read more
source§

impl<'a> Div<F128b> for &'a F128b

§

type Output = F128b

The resulting type after applying the / operator.
source§

fn div(self, rhs: F128b) -> Self::Output

Performs the / operation. Read more
source§

impl<'a> Div for &'a F128b

§

type Output = F128b

The resulting type after applying the / operator.
source§

fn div(self, rhs: &'a F128b) -> Self::Output

Performs the / operation. Read more
source§

impl Div for F128b

§

type Output = F128b

The resulting type after applying the / operator.
source§

fn div(self, rhs: F128b) -> Self::Output

Performs the / operation. Read more
source§

impl<'a> DivAssign<&'a F128b> for F128b

source§

fn div_assign(&mut self, rhs: &Self)

Performs the /= operation. Read more
source§

impl DivAssign for F128b

source§

fn div_assign(&mut self, rhs: F128b)

Performs the /= operation. Read more
source§

impl FiniteField for F128b

§

type PrimeField = F2

The prime-order subfield of the finite field.
source§

const GENERATOR: Self = _

The generator for the multiplicative group.
source§

fn polynomial_modulus() -> Polynomial<Self::PrimeField>

Multiplication over field elements should be reduced over this polynomial.
§

type NumberOfBitsInBitDecomposition = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, 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>

Decompose the given field element into bits. Read more
source§

fn inverse(&self) -> Self

Compute the multiplicative inverse of self. Read more
source§

fn decompose<T: FiniteField + IsSubFieldOf<Self>>( &self ) -> GenericArray<T, DegreeModulo<T, Self>>

Decompose self into an array of T elements where T is a subfield of Self. Read more
source§

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 more
source§

impl FiniteRing for F128b

source§

fn from_uniform_bytes(x: &[u8; 16]) -> Self

Construct an element from the given uniformly chosen random bytes.
source§

fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self

Generate a random element.
source§

const ZERO: Self = _

The additive identity element.
source§

const ONE: Self = _

The multiplicative identity element.
source§

fn random_nonzero<R: Rng + ?Sized>(rng: &mut R) -> Self

Generate a random non-zero element.
source§

fn pow(&self, n: u128) -> Self

Compute self to the power of n. Read more
source§

fn pow_bounded(&self, n: u128, bound: u16) -> Self

Compute self to the power of n, where n is guaranteed to be <= 2^bound. Read more
source§

fn pow_var_time(&self, n: u128) -> Self

Compute self to the power of n, in non-constant time.
source§

impl From<F2> for F128b

source§

fn from(x: F2) -> Self

Converts to this type from the input type.
source§

impl Hash for F128b

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IsSubFieldOf<F128b> for F2

§

type DegreeModulo = UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>

The value $n$ from above.
source§

fn decompose_superfield(fe: &F128b) -> GenericArray<Self, Self::DegreeModulo>

Turn FE into an array of Self, a subfield of FE.
source§

fn form_superfield(components: &GenericArray<Self, Self::DegreeModulo>) -> F128b

Homomorphically lift an array of Self into an FE.
source§

impl<'a> Mul<&'a F128b> for F128b

§

type Output = F128b

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'a F128b) -> Self::Output

Performs the * operation. Read more
source§

impl<'a> Mul<F128b> for &'a F128b

§

type Output = F128b

The resulting type after applying the * operator.
source§

fn mul(self, rhs: F128b) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<F128b> for F2

§

type Output = F128b

The resulting type after applying the * operator.
source§

fn mul(self, x: F128b) -> F128b

Performs the * operation. Read more
source§

impl<'a> Mul for &'a F128b

§

type Output = F128b

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'a F128b) -> Self::Output

Performs the * operation. Read more
source§

impl Mul for F128b

§

type Output = F128b

The resulting type after applying the * operator.
source§

fn mul(self, rhs: F128b) -> Self::Output

Performs the * operation. Read more
source§

impl<'a> MulAssign<&'a F128b> for F128b

source§

fn mul_assign(&mut self, rhs: &'a F128b)

Performs the *= operation. Read more
source§

impl MulAssign for F128b

source§

fn mul_assign(&mut self, rhs: F128b)

Performs the *= operation. Read more
source§

impl Neg for F128b

§

type Output = F128b

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl One for F128b

source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
source§

impl PartialEq for F128b

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Product for F128b

source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl Serialize for F128b

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> Sub<&'a F128b> for F128b

§

type Output = F128b

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &'a F128b) -> Self::Output

Performs the - operation. Read more
source§

impl<'a> Sub<F128b> for &'a F128b

§

type Output = F128b

The resulting type after applying the - operator.
source§

fn sub(self, rhs: F128b) -> Self::Output

Performs the - operation. Read more
source§

impl<'a> Sub for &'a F128b

§

type Output = F128b

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &'a F128b) -> Self::Output

Performs the - operation. Read more
source§

impl Sub for F128b

§

type Output = F128b

The resulting type after applying the - operator.
source§

fn sub(self, rhs: F128b) -> Self::Output

Performs the - operation. Read more
source§

impl<'a> SubAssign<&'a F128b> for F128b

source§

fn sub_assign(&mut self, rhs: &'a F128b)

Performs the -= operation. Read more
source§

impl SubAssign for F128b

source§

fn sub_assign(&mut self, rhs: F128b)

Performs the -= operation. Read more
source§

impl Sum for F128b

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Zero for F128b

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl Copy for F128b

source§

impl Eq for F128b

source§

impl IsSubRingOf<F128b> for F2

Auto Trait Implementations§

§

impl Freeze for F128b

§

impl RefUnwindSafe for F128b

§

impl Send for F128b

§

impl Sync for F128b

§

impl Unpin for F128b

§

impl UnwindSafe for F128b

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<FE> IsSubFieldOf<FE> for FE
where FE: FiniteField,

§

type DegreeModulo = UInt<UTerm, B1>

The value $n$ from above.
source§

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

Homomorphically lift an array of Self into an FE.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<R> IsSubRingOf<R> for R
where R: FiniteRing,