Trait num_modular::ModularOps
source · [−]pub trait ModularOps<Rhs = Self, Modulus = Self>: ModularCoreOps<Rhs, Modulus> {
fn powm(self, exp: Rhs, m: Modulus) -> Self::Output;
fn invm(self, m: Modulus) -> Option<Self::Output>
where
Self: Sized;
fn jacobi(self, n: Modulus) -> i8;
fn kronecker(self, n: Modulus) -> i8;
fn legendre(self, n: Modulus) -> i8;
}
Expand description
This trait describes modular arithmetic operations
Required methods
Calculate modular inverse (x such that self*x = 1 mod m).
This operation is only available for integer that is coprime to m
. If not,
the result will be None.