Struct rsa_cortex_m4::arithmetic::PrimeModular[][src]

pub struct PrimeModular<'p, const D: usize, const E: usize> { /* fields omitted */ }

Implementations

impl<'p, const D: usize, const E: usize> PrimeModular<'p, D, E>[src]

pub fn as_modular(&self) -> &Modular<'p, D, E>[src]

pub fn as_modular_mut(&mut self) -> &mut Modular<'p, D, E>[src]

pub fn zero(p: &'p Prime<D, E>) -> Self[src]

pub fn inverse(&self) -> Self[src]

via Fermat's little theorem

Methods from Deref<Target = Modular<'p, D, E>>

pub fn digit_pow(&self, _exponent: Digit) -> Self[src]

pub fn canonical_lift(&self) -> Unsigned<D, E>[src]

The canonical representative of this residue class.

This is like [lift][lift] in GP/PARI

By virtue of our moduli's convenience, this is just a conditional subtraction. [lift]: https://pari.math.u-bordeaux.fr/dochtml/html/Conversions_and_similar_elementary_functions_or_commands.html#se:lift

pub fn residue(&self) -> &Unsigned<D, E>[src]

Or non-canonical lift

pub fn to_montgomery(&self) -> Montgomery<'n, D, E>[src]

pub fn power<const F: usize, const G: usize>(
    &self,
    exponent: &Unsigned<F, G>
) -> Self
[src]

Trait Implementations

impl<'p, const D: usize, const E: usize> Clone for PrimeModular<'p, D, E>[src]

impl<'p, const D: usize, const E: usize> Debug for PrimeModular<'p, D, E>[src]

impl<'p, const D: usize, const E: usize> Deref for PrimeModular<'p, D, E>[src]

type Target = Modular<'p, D, E>

The resulting type after dereferencing.

impl<'p, const D: usize, const E: usize> DerefMut for PrimeModular<'p, D, E>[src]

impl<'p, const D: usize, const E: usize> Neg for &PrimeModular<'p, D, E>[src]

type Output = PrimeModular<'p, D, E>

The resulting type after applying the - operator.

impl<'a, 'p, const D: usize, const E: usize> Sub<&'a PrimeModular<'p, D, E>> for &'a PrimeModular<'p, D, E>[src]

type Output = PrimeModular<'p, D, E>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<'p, const D: usize, const E: usize> Send for PrimeModular<'p, D, E>[src]

impl<'p, const D: usize, const E: usize> Sync for PrimeModular<'p, D, E>[src]

impl<'p, const D: usize, const E: usize> Unpin for PrimeModular<'p, D, E>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.