BFV supports two encoding schemes: single value encoding and batch encoding. In this subsection, we will explain the single value encoding scheme.
Summary D-2.1 BFV Encoding
Input Integer: Decompose the input integer as follows:
, where each
(Note that there is more than 1 way to decompose the same )
Encoded Polynomial:
Decoding:
Let’s analyze whether the encoding scheme in Summary D-2.1 preserves isomorphism: homomorphic and bijective.
Homomorphism: Let’s denote the above encoding scheme as the mapping . Suppose we have two integers as follows:
,
Then,
Since and , the encoding scheme in Summary D-2.1 is homomorphic.
One-to-Many Mappings: This encoding scheme preserves one-to-many mappings between the input integers and the encoded polynomials, because there is more than 1 way to encode the same input integer , which can be encoded as different polynomials. For example, suppose that we have the following two input integers and their summation: , , . Then, their encoded polynomials are as follows:
However, the following polynomial is also mapped to :
That being said, both polynomials are mapped to the same (i.e., ) as follows:
Although the encoding scheme in Summary D-2.1 is not bijective but only one-to-many mappings, it preserves homomorphism and the decoded number decomposition sums to the same original integer. Therefore, this encoding scheme can be validly used for fully homomorphic encryption.