pub trait ModPowerOf2Square {
    type Output;

    fn mod_power_of_2_square(self, pow: u64) -> Self::Output;
}
Expand description

Squares a number modulo $2^k$. Assumes the input is already reduced modulo $2^k$.

Required Associated Types

Required Methods

Implementations on Foreign Types

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Squares a number modulo another number $2^k$. Assumes the input is already reduced modulo $2^k$.

$f(x, k) = 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.

Examples

See here.

Implementors