I was wondering if someone could explain the Digit Extraction from HElib in simple words:
Apply a homomorphic (non-linear) digit-extraction procedure, computing $r$ ciphertexts that contain the digits $e − e′ + r − 1$ through $e − e′$ of the integers in the slots, respectively, relative to plaintext space mod-$p^r$. This requires that we generalize the bit-extraction procedure from [21] to a digit-extraction procedure for any prime power $p^r \ge 2$, this is done in Section 5.3. Once we extracted all these digits, we can combine them to get an encryption of the coefficients of $m$ in the slots relative to plaintext space modulo $p^r$.
Does it mean, consider those $z$ for which $[z]_q$ is non-negative?
Or, does it mean, if $0 \leq z < (\frac{q^2}{2} - q)$ then $[z]_q \in [0, \frac{q}{2}]$?
Keep in mind that, $[\cdot]_q$ maps an integer in-between $(\frac{-q}{2}, \frac{q}{2}]$.
– kindi Feb 10 '24 at 00:25