pub trait ModPowerOf2SquareTruncated {
type Output;
// Required method
fn mod_power_of_2_square_truncated(self, len: u64, pow: u64) -> Self::Output;
}Expand description
Squares a polynomial modulo $2^k$, keeping only the coefficients of $x^i$ for $i$ less than a given length. The coefficients must already be reduced modulo $2^k$.
With $n$ equal to len, this is squaring in the ring of polynomials with coefficients modulo
$2^k$, taken modulo $x^n$, applied to the image of the polynomial there. Unlike the
coefficients, which must already be reduced, the polynomial need not already be truncated: it
may have any number of coefficients, and only the first len are read.
Required Associated Types§
Required Methods§
Sourcefn mod_power_of_2_square_truncated(self, len: u64, pow: u64) -> Self::Output
fn mod_power_of_2_square_truncated(self, len: u64, pow: u64) -> Self::Output
Squares a polynomial modulo $2^k$ and truncates the square to its first len coefficients.
$$ f(p, n, k) = (p^2 \bmod x^n) \bmod 2^k. $$
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".