Trait malachite_base::num::arithmetic::traits::ModSquarePrecomputedAssign
source · [−]pub trait ModSquarePrecomputedAssign<RHS = Self, M = Self>: ModPowPrecomputed<RHS, M> {
fn mod_square_precomputed_assign(&mut self, m: M, data: &Self::Data);
}
Expand description
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
If multiple modular squarings with the same modulus are necessary, it can be quicker to
precompute some piece of data using
precompute_mod_pow_data
function in
ModMulPrecomputed
and reuse it in the squaring calls.
Required Methods
fn mod_square_precomputed_assign(&mut self, m: M, data: &Self::Data)
Implementations on Foreign Types
sourceimpl ModSquarePrecomputedAssign<u64, u8> for u8
impl ModSquarePrecomputedAssign<u64, u8> for u8
sourcefn mod_square_precomputed_assign(&mut self, m: u8, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: u8, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquarePrecomputedAssign<u64, u16> for u16
impl ModSquarePrecomputedAssign<u64, u16> for u16
sourcefn mod_square_precomputed_assign(&mut self, m: u16, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: u16, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquarePrecomputedAssign<u64, u32> for u32
impl ModSquarePrecomputedAssign<u64, u32> for u32
sourcefn mod_square_precomputed_assign(&mut self, m: u32, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: u32, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquarePrecomputedAssign<u64, u64> for u64
impl ModSquarePrecomputedAssign<u64, u64> for u64
sourcefn mod_square_precomputed_assign(&mut self, m: u64, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: u64, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquarePrecomputedAssign<u64, u128> for u128
impl ModSquarePrecomputedAssign<u64, u128> for u128
sourcefn mod_square_precomputed_assign(&mut self, m: u128, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: u128, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl ModSquarePrecomputedAssign<u64, usize> for usize
impl ModSquarePrecomputedAssign<u64, usize> for usize
sourcefn mod_square_precomputed_assign(&mut self, m: usize, data: &Self::Data)
fn mod_square_precomputed_assign(&mut self, m: usize, data: &Self::Data)
Squares a number modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular squarings with the same modulus. The precomputed data should be obtained
using precompute_mod_pow_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.