# Secret key generation in the BGV scheme in HElib

This question is about secret key generation, based on section 4.7 in the design document: https://homenc.github.io/HElib/documentation/Design_Document/HElib-design.pdf

It seems that if $$m$$ is not a power of two, then we choose coefficients of the secret key such that the secret key is a polynomial of degree $$m$$. How is it reduced into a polynomial of degree $$\phi(m)$$? If we just reduce mod $$\Phi_m(X)$$ then the coefficients may be outside $$\{-1,1\}$$, so I assume based on the way it is written that there is some other method.

• Considering HElib's code, it seems that they really just reduce the polynomial modulo $\Phi_m(X)$. May 4 '21 at 6:40
• But then the secret key has coefficients outside $\{-1,1\}$. Is this okay with the probability analysis they mention? May 4 '21 at 7:35