pub trait ModSquareAssign<M = Self> {
    // Required method
    fn mod_square_assign(&mut self, m: M);
}
Expand description

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

Required Methods§

source

fn mod_square_assign(&mut self, m: M)

Implementations on Foreign Types§

source§

impl ModSquareAssign for u8

source§

fn mod_square_assign(&mut self, m: u8)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModSquareAssign for u16

source§

fn mod_square_assign(&mut self, m: u16)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModSquareAssign for u32

source§

fn mod_square_assign(&mut self, m: u32)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModSquareAssign for u64

source§

fn mod_square_assign(&mut self, m: u64)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModSquareAssign for u128

source§

fn mod_square_assign(&mut self, m: u128)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

source§

impl ModSquareAssign for usize

source§

fn mod_square_assign(&mut self, m: usize)

Squares a number modulo another number $m$, in place. The input must be already reduced modulo $m$.

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if self is greater than or equal to m.

§Examples

See here.

Implementors§