Scheme 1. BFV(t, n, q, w, σ, B)
BFV.SecKeyGen(): Sample s ← R
3
. Output: sk = s
BFV.PubKeyGen(sk):
Let sk = s. Sample p
1
← R
q
, and e ← χ. Output:
pk = (p
0
, p
1
) = (−sp
1
+ e, p
1
)
BFV.RelinKeyGen(sk, w):
Let sk = s. Sample r
1
← R
l
q
, e ← χ
l
. Output:
rlk = (r
0
, r
1
) = (s
2
w − sr
1
+ e, r
1
)
BFV.Encrypt(pk, m):
Let pk = (p
0
, p
1
). Sample u ← R
3
and e
0
, e
1
← χ.
Output: ct = (∆m + up
0
+ e
0
, up
1
+ e
1
)
BFV.Decrypt(sk, ct):
Let sk = s, ct = (c
0
, c
1
). Output:
m
0
= [b
t
q
[c
0
+ c
1
s]
q
e]
t
and truncated support over [−B, B] where σ and B are two
cryptosystem parameters.
The security of BFV is based on the hardness of the
decisional-RLWE problem [31] that is informally stated as
follows: Given a uniformly random a ← R
q
, a secret s ← R
3
,
and an error term e ← χ, it is computationally hard for an
adversary that does not know s and e to distinguish between
the distribution of (sa+e, a) and that of (b, a) where b ← R
q
.
Encrypted arithmetic operations must preserve the plaintext
arithmetic. We denote BFV.Add and BFV.Mul the homomor-
phic addition and multiplication, respectively, and we refer
the reader to [34] for their implementation. The BFV.Mul
operation outputs a ciphertext consisting of three R
q
elements
that can be seen as a degree two ciphertext. This higher degree
ciphertext can be further operated on and decrypted. Yet it is
often desirable to reduce this degree back to one, by using a
BFV.Relinearize operation [34]. This operation is public but
requires the generation of a specific public key, referred to as
the relinearization key (rlk).
The decryption of a ciphertext (c
0
, c
1
) can be seen as a two-
step process. The first step requires the secret key to compute
a noisy plaintext in R
q
as
[c
0
+ sc
1
]
q
= ∆m + e
ct
, (1)
where e
ct
is the ciphertext overall error, or ciphertext noise. In
the second step, the message is decoded from the noisy term
in R
q
to a plaintext in R
t
, by rescaling and rounding
[b
t
q
(∆m + e
ct
)e]
t
= [bm + at + ve]
t
, (2)
where m ∈ R
t
, a has integer coefficients, and v has coef-
ficients in Q. Provided that kvk <
1
2
, Eq. (2) outputs m.
Hence, the correctness of the scheme is conditioned on the
noise magnitude ke
ct
k that must be kept below
q
2t
throughout
the homomorphic computation, notably by choosing a suffi-
ciently large q. To preserve this condition when multiplying
with the rlk (as a part of BFV.Relinearize), ciphertexts are
temporarily decomposed in a basis w < q and the product
is performed on each element of the decomposition [34].
We write l = dlog
w
(q)e the number of coefficients in this
decomposition, and w = (w
0
, w
1
, ..., w
l−1
)
T
the base-w
reconstruction vector.
D. Parameter Selection
Selecting the parameters for a given application consti-
tutes a significantly more challenging task for homomorphic-
encryption schemes than for traditional encryption. Although
the standardization document [30] is a good basis for mapping
the subset of commonly used parameter values to bit-security
levels, mapping the correctness and efficiency requirements
to concrete parameters in a systematic way is still an open
question in FHE research: it goes beyond the scope of this
work. Nowadays, we see the rise of compilers for HE [38]
that will, as they evolve, automate this process.
We describe the common heuristic approach for select-
ing BFV parameters; the one we used for the evalua-
tion of our work (Section VI). The task consists in find-
ing (t, n, q, w, σ, B) that satisfy the required security and
homomorphic-capacity parameters (λ, κ) for the set of con-
sidered homomorphic circuits. The standardization document
and most implementations fix the noise standard deviation and
bound to σ ≈ 3.2 and B ≈ 20, respectively. Hence, only the
ring degree n, plaintext-space and ciphertext-space moduli t
and q, and the decomposition basis w remain to be determined.
The message-space characteristics of the application usually
sets t directly, by considering the bit-width of the input values.
The targeted set of homomorphic circuits constrain q and n:
Choosing larger q permits larger circuit depth (Equation (2))
but also reduces the hardness of the RLWE problem. Choosing
larger w reduces the noise incurred by Relinearize (hence en-
ables smaller q) and increases its computation cost and the rlk
size. Choosing larger n increases the security (hence enables
larger q for a fixed security level) but has a significant impact
on the cost incurred by polynomial multiplication. Hence, the
most common strategy is to set q and w experimentally, as
an acceptable trade-off for the application, then to choose the
smallest power-of-two n for the desired security level.
IV. THE MULTIPARTY BFV SCHEME
We introduce a novel multiparty version of the Brakerski-
Fan-Vercauteren (BFV) cryptosystem [34]. Although formu-
lated for the BFV scheme, the introduced protocols can be
straightforwardly adapted to other RLWE-based cryptosys-
tems, such as BGV [39] or the more recent CKKS [40],
which enables homomorphic approximate arithmetic. We im-
plemented both multiparty versions for the BFV and CKKS
schemes in the Lattigo open-source library [16]. Our approach
follows the blueprint of the LWE-based protocols by Asharov
et al. [14], and introduces several improvements to their
schemes. In particular, we propose a novel procedure for the
4