pub trait ModInverse<R: Sized>: Sized {
    type Output: Sized;

    // Required method
    fn mod_inverse(self, m: R) -> Option<Self::Output>;
}
Expand description

Generic trait to implement modular inverse.

Required Associated Types§

Required Methods§

source

fn mod_inverse(self, m: R) -> Option<Self::Output>

Function to calculate the modular multiplicative inverse of an integer a modulo m.

TODO: references Returns the modular inverse of self. If none exists it returns None.

Implementors§