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 0 (i.e., 0 or any positive integer) as follows:

m = bn1 2n1 + bn2 2n2 + + b1 21 + b0 20 , where each bi {0,1}

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

Decoding: M(X = 2) = m

Let’s analyze whether the encoding scheme in Summary D-2.1 ensures correct decoding after addition and multiplication. This is equivalent to showing that:

Decode(σ(m1) + σ(m2)) = m1 + m2 where σ is the encoding function

Decode(σ(m1) σ(m2)) = m1 m2

Let σ(m1) = M1(X) and σ(m2) = M2(X). Then,

Decode(σ(m1) + σ(m2)) = Decode(M1(X) + M2(X))

= Decode(M1+2(X)) where M1+2(X) = M1(X) + M2(X)

= M1+2(2) since decoding is evaluating the polynomial at X = 2

= M1(2) + M2(2) since evaluating M1+2(X) at X = 2 is computationally the same as splitting M1+2(X) into M1(X) and M2(X), evaluating M1(2) and M2(2) and summing them

Similarly, the decoding preserves correctness over multiplication as well:

Decode(σ(m1) σ(m2)) = Decode(M1(X) M2(X))

= Decode(M12(X)) where M12(X) = M1(X) M2(X)

= M12(2) since decoding is evaluating the polynomial at X = 2

= M1(2) M2(2) since evaluating M12(X) at X = 2 is computationally the same as splitting M12(X) into M1(X) and M2(X), evaluating M1(2) and M2(2) and multiplying them

Therefore, the single value encoding scheme preserves the correctness of decoding after addition and multiplication.

The encoding scheme in Summary D-2.1 can be validly used for fully homomorphic encryption only if the multiplication of the encoded polynomials do not exceed the polynomial ring’s degree n, because once the degree gets reduced due to an overflow, the evaluated values of polynomials lose consistency. Also, the coefficients of polynomials should not wrap modulo t after additions or multiplications. Due to these constraints, the single value encoding is not a good choice for fully homomorphic encryption. Also, the single value encoding is computationally inefficient, because each polynomial can encode only a single value even if it holds n coefficients.