Trait malachite_base::num::arithmetic::traits::ModSquare
source · [−]pub trait ModSquare<M = Self> {
type Output;
fn mod_square(self, m: M) -> Self::Output;
}
Expand description
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
Required Associated Types
Required Methods
fn mod_square(self, m: M) -> Self::Output
Implementations on Foreign Types
sourceimpl ModSquare<u8> for u8
impl ModSquare<u8> for u8
sourcefn mod_square(self, m: u8) -> u8
fn mod_square(self, m: u8) -> u8
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u8
sourceimpl ModSquare<u16> for u16
impl ModSquare<u16> for u16
sourcefn mod_square(self, m: u16) -> u16
fn mod_square(self, m: u16) -> u16
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u16
sourceimpl ModSquare<u32> for u32
impl ModSquare<u32> for u32
sourcefn mod_square(self, m: u32) -> u32
fn mod_square(self, m: u32) -> u32
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u32
sourceimpl ModSquare<u64> for u64
impl ModSquare<u64> for u64
sourcefn mod_square(self, m: u64) -> u64
fn mod_square(self, m: u64) -> u64
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u64
sourceimpl ModSquare<u128> for u128
impl ModSquare<u128> for u128
sourcefn mod_square(self, m: u128) -> u128
fn mod_square(self, m: u128) -> u128
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
type Output = u128
sourceimpl ModSquare<usize> for usize
impl ModSquare<usize> for usize
sourcefn mod_square(self, m: usize) -> usize
fn mod_square(self, m: usize) -> usize
Squares a number modulo another number $m$. Assumes the input is already reduced modulo $m$.
$f(x, m) = y$, where $x, y < m$ and $x^2 \equiv y \mod m$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.