Struct scuttlebutt::field::F61p
source · pub struct F61p(/* private fields */);
Expand description
A finite field over the Mersenne Prime 2^61 - 1
Trait Implementations§
source§impl AddAssign<&F61p> for F61p
impl AddAssign<&F61p> for F61p
source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+=
operation. Read moresource§impl AddAssign for F61p
impl AddAssign for F61p
source§fn add_assign(&mut self, rhs: F61p)
fn add_assign(&mut self, rhs: F61p)
Performs the
+=
operation. Read moresource§impl CanonicalSerialize for F61p
impl CanonicalSerialize for F61p
§type Serializer = ByteElementSerializer<F61p>
type Serializer = ByteElementSerializer<F61p>
A way to serialize field elements of this type. Read more
§type Deserializer = ByteElementDeserializer<F61p>
type Deserializer = ByteElementDeserializer<F61p>
A way to deserialize field elements of this type. Read more
§type ByteReprLen = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>
type ByteReprLen = UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>
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 F61p
impl ConditionallySelectable for F61p
source§impl ConstantTimeEq for F61p
impl ConstantTimeEq for F61p
source§impl<'de> Deserialize<'de> for F61p
impl<'de> Deserialize<'de> for F61p
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<F61p> for Standard
impl Distribution<F61p> for Standard
source§impl<'a> DivAssign<&'a F61p> for F61p
impl<'a> DivAssign<&'a F61p> for F61p
source§fn div_assign(&mut self, rhs: &Self)
fn div_assign(&mut self, rhs: &Self)
Performs the
/=
operation. Read moresource§impl DivAssign for F61p
impl DivAssign for F61p
source§fn div_assign(&mut self, rhs: F61p)
fn div_assign(&mut self, rhs: F61p)
Performs the
/=
operation. Read moresource§impl FiniteField for F61p
impl FiniteField for F61p
§type PrimeField = F61p
type PrimeField = F61p
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>, B1>, B0>, B1>
type NumberOfBitsInBitDecomposition = UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B1>
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 F61p
impl FiniteRing for F61p
source§fn from_uniform_bytes(x: &[u8; 16]) -> Self
fn from_uniform_bytes(x: &[u8; 16]) -> Self
This has a 2^-61 probability of being a biased draw.
source§fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self
This has a 2^-61 probability of being a biased draw.
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 MulAssign<&F61p> for F61p
impl MulAssign<&F61p> for F61p
source§fn mul_assign(&mut self, rhs: &Self)
fn mul_assign(&mut self, rhs: &Self)
Performs the
*=
operation. Read moresource§impl MulAssign for F61p
impl MulAssign for F61p
source§fn mul_assign(&mut self, rhs: F61p)
fn mul_assign(&mut self, rhs: F61p)
Performs the
*=
operation. Read moresource§impl PartialEq for F61p
impl PartialEq for F61p
source§impl SubAssign<&F61p> for F61p
impl SubAssign<&F61p> for F61p
source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-=
operation. Read moresource§impl SubAssign for F61p
impl SubAssign for F61p
source§fn sub_assign(&mut self, rhs: F61p)
fn sub_assign(&mut self, rhs: F61p)
Performs the
-=
operation. Read moreimpl Copy for F61p
impl Eq for F61p
impl PrimeFiniteField for F61p
Auto Trait Implementations§
impl Freeze for F61p
impl RefUnwindSafe for F61p
impl Send for F61p
impl Sync for F61p
impl Unpin for F61p
impl UnwindSafe for F61p
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
.