Skip to main content

power2round

Function power2round 

Source
pub fn power2round(r: i32) -> (i32, i32)
Expand description

Decompose a coefficient into high and low parts using a power-of-2 divisor.

Implements Algorithm 35 of FIPS 204 (Power2Round). Splits r into (r1, r0) such that r = r1 * 2^d + r0 with r0 in the centered range [-(2^{d-1} - 1), 2^{d-1}].

Used during key generation to compress the public vector t into t1 (stored in the public key) and t0 (stored in the secret key).