Skip to main content

ModPowerOf2SquareAssign

Trait ModPowerOf2SquareAssign 

Source
pub trait ModPowerOf2SquareAssign {
    // Required method
    fn mod_power_of_2_square_assign(&mut self, pow: u64);
}
Expand description

Squares a number modulo $2^k$ in place. The input must be already reduced modulo $2^k$.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ModPowerOf2SquareAssign for u8

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Source§

impl ModPowerOf2SquareAssign for u16

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Source§

impl ModPowerOf2SquareAssign for u32

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Source§

impl ModPowerOf2SquareAssign for u64

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Source§

impl ModPowerOf2SquareAssign for u128

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Source§

impl ModPowerOf2SquareAssign for usize

Source§

fn mod_power_of_2_square_assign(&mut self, pow: u64)

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

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

§Worst-case complexity

Constant time and additional memory.

§Panics

Panics if pow is greater than Self::WIDTH or if self is greater than or equal to $2^k$.

§Examples

See here.

Implementors§