pub trait ModPowAssign<RHS = Self, M = Self> {
    fn mod_pow_assign(&mut self, exp: RHS, m: M);
}
Expand description

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

Required Methods

Implementations on Foreign Types

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.

$x \gets y$, where $x, y < m$ and $x^n \equiv y \mod m$.

Worst-case complexity

$T(n) = O(n)$

$M(n) = O(1)$

where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits().

Examples

See here.

Implementors