D-2.1 Single Value Encoding

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 m as follows:

m = bn1 2n1 + bn2 2n2 + + b1 21 + b0 20 , where each bi q

(Note that there is more than 1 way to decompose the same m)

Encoded Polynomial: M(X) = b0 + b1X + b2X2 + + bn1Xn1 Rn,q

Decoding: M(X = 2) = m

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 m1,m2 as follows:

m1 = i=0n1(b1,i 2i), m2 = i=0n1(b2,i 2i)

Then,

σ(m1 + m2) = σ ( i=0n1(b1,i 2i) + i=0n1(b2,i 2i))

= σ ( i=0n1(b1,i + b2,i) 2i)

= i=0n1(b1,i + b2,i) Xi

= i=0n1b1,i Xi + i=0n1b2,i Xi

= σ ( i=0n1(b1,i 2i)) + σ ( i=0n1(b2,i 2i))

= σ(m1) + σ(m2)

σ(m1 m2) = σ ( i=0n1(b1,i 2i) i=0n1(b2,i 2i))

= σ ( i=02(n1) j=0i(b1,j b2,i1) 2i)

= i=02(n1) j=0i(b1,j b2,i1) Xi

= i=0n1b1,i Xi i=0n1b2,i Xi

= σ ( i=0n1(b1,i 2i)) σ ( i=0n1(b2,i 2i))

= σ(m1) σ(m2)

Since σ(m1 + m2) = σ(m1) + σ(m2) and σ(m1 m2) = σ(m1) σ(m2), 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 m, which can be encoded as different polynomials. For example, suppose that we have the following two input integers and their summation: m1 = 0111, m2 = 0010, m1+2 = m1 + m2 = 1001. Then, their encoded polynomials are as follows:

M1(X) = 0X3 + 1X2 + 1X + 1

M2(X) = 0X3 + 0X2 + 1X + 0

M1+2(X) = 0X3 + 1X2 + 2X + 1

However, the following polynomial is also mapped to m1+2 = 1001:

M3(X) = 1X3 + 0X2 + 0X1 + 1

That being said, both polynomials are mapped to the same m1+2 (i.e., 1001) as follows:

M1+2(2) = 4 + 4 + 1 = 9

M3(2) = 8 + 1 = 9

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.