Struct rsa_cortex_m4::arithmetic::Wrapping[][src]

#[repr(transparent)]pub struct Wrapping<T>(pub T);

Intentionally-wrapped arithmetic.

We can't use core::num::Wrapping due to type coherence clashing with our usage requirements.

The idea is that T is [Number], and we wrap around $2^N$ where N = T::BITS.

Implementations

impl<const D: usize, const E: usize> Wrapping<Unsigned<D, E>>[src]

pub fn inv(&self) -> Result<Self>[src]

See Unsigned::wrapping_inv.

Trait Implementations

impl<const D: usize, const E: usize> Add<&'_ Wrapping<Unsigned<D, E>>> for &Wrapping<Unsigned<D, E>>[src]

type Output = Wrapping<Unsigned<D, E>>

The resulting type after applying the + operator.

impl<const D: usize, const E: usize> AddAssign<&'_ Wrapping<Unsigned<D, E>>> for Wrapping<Unsigned<D, E>>[src]

impl<T: Clone> Clone for Wrapping<T>[src]

impl<T: Debug> Debug for Wrapping<T>[src]

impl<T: Default> Default for Wrapping<T>[src]

impl<T: Number> Deref for Wrapping<T>[src]

type Target = [Digit]

The resulting type after dereferencing.

impl<T: Number + NumberMut> DerefMut for Wrapping<T>[src]

impl<const D: usize, const E: usize> Mul<&'_ Wrapping<Unsigned<D, E>>> for &Wrapping<Unsigned<D, E>>[src]

type Output = Wrapping<Unsigned<D, E>>

The resulting type after applying the * operator.

impl<const D: usize, const E: usize> Neg for &Wrapping<Unsigned<D, E>>[src]

type Output = Wrapping<Unsigned<D, E>>

The resulting type after applying the - operator.

impl<T: Number> Number for Wrapping<T>[src]

impl<T: Number + NumberMut> NumberMut for Wrapping<T>[src]

impl<T: PartialEq> PartialEq<Wrapping<T>> for Wrapping<T>[src]

impl<T> RefCast for Wrapping<T>[src]

type From = T

impl<T> StructuralPartialEq for Wrapping<T>[src]

impl<const D: usize, const E: usize, const L: usize> Sub<&'_ Wrapping<Array<D, E, L>>> for &Wrapping<Array<D, E, L>>[src]

type Output = Wrapping<Array<D, E, L>>

The resulting type after applying the - operator.

impl<const D: usize, const E: usize> Sub<&'_ Wrapping<Unsigned<D, E>>> for &Wrapping<Unsigned<D, E>>[src]

type Output = Wrapping<Unsigned<D, E>>

The resulting type after applying the - operator.

impl<T, const D: usize, const E: usize> SubAssign<&'_ T> for Wrapping<Unsigned<D, E>> where
    T: Number
[src]

TODO: This implementation (and the analogous one for Array) needs to be properly tested/fuzzed.

It's implemented more generally than for just T = Unsigned<D, E> as we need that in `crate::arithmetic::divide::generic_div_rem.

There, we want to implement for any (dividend, divisor) pair. The only real work is done for dividend > divisor, implying that dividend.len() >= divisor.len(), and, where we're called, minuend >= subtrahend, and hence minuend.len() >= subtrahend.len().

This is needed to make the implementation of sub_assign_borrow (with dropped borrow) valid.

impl<T, const D: usize, const E: usize, const L: usize> SubAssign<&'_ T> for Wrapping<Array<D, E, L>> where
    T: Number
[src]

TODO: See remark about SubAssign for Unsigned<D, E>

Auto Trait Implementations

impl<T> Send for Wrapping<T> where
    T: Send
[src]

impl<T> Sync for Wrapping<T> where
    T: Sync
[src]

impl<T> Unpin for Wrapping<T> where
    T: Unpin
[src]

Blanket Implementations

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

impl<T> Bits for T where
    T: Number
[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.