BGV uses almost the same plaintext encoding scheme as BFV as described in Summary D-2.2.5 in §D-2.2.5, with the only difference that the scaling factor is not applied to the plaintext polynomial like BFV does. Instead, BGV applies its own scaling factor to the noise polynomial whenever it encrypts a new ciphertext (will be explained in §D-4.2).
The following is BGV’s encoding and decoding scheme.
Summary D-4.1 BGV’s Encoding and Decoding
Input: An -dimensional integer modulo vector
Encoding:
Convert into by applying the transformation
, where is a basis of the -dimensional vector space crafted as follows:
# where ( is a generator of )
The final output is , which we can also treat as
during encryption/decryption later, because the initial fresh coefficients are guaranteed to be smaller than any where .
Decoding: For the plaintext polynomial , compute , where