Struct cryptix_field::field::primefield::FpElement
source · pub struct FpElement<I, M: PrimeModular<I>>(pub Element<I, M>);Expand description
Element in field F_p
Tuple Fields§
§0: Element<I, M>Implementations§
source§impl<I, M: PrimeModular<I>> FpElement<I, M>
impl<I, M: PrimeModular<I>> FpElement<I, M>
sourcepub fn new_unchecked(value: I) -> Self
pub fn new_unchecked(value: I) -> Self
Safety
The safey is the same as Element::new_unchecked
Trait Implementations§
source§impl<I, M> AddIdentity for FpElement<I, M>where
M: PrimeModular<I>,
I: BigIntOps + IsBigInt,
impl<I, M> AddIdentity for FpElement<I, M>where M: PrimeModular<I>, I: BigIntOps + IsBigInt,
source§impl<I, M> Field for FpElement<I, M>where
I: BigIntOpsExt,
M: Montgomery<I>,
impl<I, M> Field for FpElement<I, M>where I: BigIntOpsExt, M: Montgomery<I>,
source§impl<I: IsBigInt, M: PrimeModular<I>> From<FpElement<I, M>> for [u8; I::BYTE_LEN]
impl<I: IsBigInt, M: PrimeModular<I>> From<FpElement<I, M>> for [u8; I::BYTE_LEN]
source§impl<I, M> MontgomeryOps<I, M> for FpElement<I, M>where
I: BigIntOpsExt,
M: Montgomery<I>,
impl<I, M> MontgomeryOps<I, M> for FpElement<I, M>where I: BigIntOpsExt, M: Montgomery<I>,
fn mont_mul_fp(self, rhs: FpElement<I, M>) -> Self
source§impl<I, M> Mul<FpElement<I, M>> for FpElement<I, M>where
M: Montgomery<I>,
I: BigIntOpsExt,
impl<I, M> Mul<FpElement<I, M>> for FpElement<I, M>where M: Montgomery<I>, I: BigIntOpsExt,
source§impl<I, M> MulIdentity for FpElement<I, M>where
I: BigIntOpsExt + IsBigInt,
M: Montgomery<I>,
impl<I, M> MulIdentity for FpElement<I, M>where I: BigIntOpsExt + IsBigInt, M: Montgomery<I>,
Safety
1 is the multiplicative ideneity for biguint
source§impl<I, M> MulInverse for FpElement<I, M>where
I: BigIntOpsExt,
M: Montgomery<I>,
impl<I, M> MulInverse for FpElement<I, M>where I: BigIntOpsExt, M: Montgomery<I>,
The montgomery trait bound restricts the modular to odd prime
source§impl<I: Ord, M: Ord + PrimeModular<I>> Ord for FpElement<I, M>
impl<I: Ord, M: Ord + PrimeModular<I>> Ord for FpElement<I, M>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<I: PartialEq, M: PartialEq + PrimeModular<I>> PartialEq<FpElement<I, M>> for FpElement<I, M>
impl<I: PartialEq, M: PartialEq + PrimeModular<I>> PartialEq<FpElement<I, M>> for FpElement<I, M>
source§impl<I: PartialOrd, M: PartialOrd + PrimeModular<I>> PartialOrd<FpElement<I, M>> for FpElement<I, M>
impl<I: PartialOrd, M: PartialOrd + PrimeModular<I>> PartialOrd<FpElement<I, M>> for FpElement<I, M>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<I, M> AbelianGroup for FpElement<I, M>where M: PrimeModular<I>, Self: Group + CommunicativeAdd,
impl<I, M> AssociativeAdd for FpElement<I, M>where M: PrimeModular<I>, Self: Add<Output = Self>,
Safety
Element is backed by biguint, which is associative under addition
impl<I, M> AssociativeMul for FpElement<I, M>where M: Montgomery<I>, I: BigIntOpsExt,
Safety
our element type is backed by biguint, so mod mul is associative
impl<I, M> CommunicativeAdd for FpElement<I, M>where M: PrimeModular<I>, Self: Add<Output = Self>,
Safety
Element is backed by biguint, which is communicative under addition
impl<I, M> CommunicativeMul for FpElement<I, M>where M: Montgomery<I>, I: BigIntOpsExt,
Safety
BigUInt mod mul is communicative
impl<I: Copy, M: PrimeModular<I>> Copy for FpElement<I, M>
impl<I, M> DistributiveMul for FpElement<I, M>where M: Montgomery<I>, I: BigIntOpsExt,
Safety
our element type is backed by biguint, so mod mul is distributive over add
impl<I: Eq, M: Eq + PrimeModular<I>> Eq for FpElement<I, M>
impl<I, M> Group for FpElement<I, M>where M: PrimeModular<I>, I: BigIntOps,
impl<I, M> Ring for FpElement<I, M>where M: PrimeModular<I>, Self: Mul<Output = Self> + AssociativeMul + DistributiveMul + AbelianGroup,
impl<I, M: PrimeModular<I>> StructuralEq for FpElement<I, M>
impl<I, M: PrimeModular<I>> StructuralPartialEq for FpElement<I, M>
Auto Trait Implementations§
impl<I, M> RefUnwindSafe for FpElement<I, M>where I: RefUnwindSafe, M: RefUnwindSafe,
impl<I, M> Send for FpElement<I, M>where I: Send, M: Send,
impl<I, M> Sync for FpElement<I, M>where I: Sync, M: Sync,
impl<I, M> Unpin for FpElement<I, M>where I: Unpin, M: Unpin,
impl<I, M> UnwindSafe for FpElement<I, M>where I: UnwindSafe, M: UnwindSafe,
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