pub trait Modulo: Sized {
// Required methods
fn mod_pow(base: &Self, exponent: &Self, m: &Self) -> Self;
fn mod_mul(a: &Self, b: &Self, modulus: &Self) -> Self;
fn mod_sub(a: &Self, b: &Self, modulus: &Self) -> Self;
fn mod_add(a: &Self, b: &Self, modulus: &Self) -> Self;
fn mod_inv(a: &Self, m: &Self) -> Option<Self>;
fn modulus(&self, modulus: &Self) -> Self;
}Expand description
Modular arithmetic for BigInt
Required Methods§
Sourcefn mod_pow(base: &Self, exponent: &Self, m: &Self) -> Self
fn mod_pow(base: &Self, exponent: &Self, m: &Self) -> Self
Calculates base^(exponent) (mod m)
Exponent must not be negative. Function will panic otherwise.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.