Large-Plaintext Functional Bootstrapping in FHE with Small Bootstrapping Keys
Abstract
Functional bootstrapping is a core technique in Fully Homomorphic Encryption (FHE). For large plaintext, to evaluate a general function homomorphically over a ciphertext, in the FHEW/TFHE approach, since the function in look-up table form is encoded in the coefficients of a test polynomial, the degree of the polynomial must be high enough to hold the entire table. This increases the bootstrapping time complexity and memory cost, as the size of bootstrapping keys and keyswitching keys need to be large accordingly.
In this paper, we propose to encode the look-up table of any function in a polynomial vector, whose coefficients can hold more data. The corresponding representation of the additive group used in the RGSW-based bootstrapping is the group of monic monomial permutation matrices, which integrates the permutation matrix representation used by Alperin-Sheriff and Peikert in 2014, and the monic monomial representation used in the FHEW/TFHE scheme. We make comprehensive investigation of the new representation, and propose a new bootstrapping algorithm based on it. The new algorithm has the prominent benefit of small bootstrapping key size and small key-switching key size, which leads to polynomial factor improvement in key size, in addition to constant factor improvement in run-time cost.
Index Terms:
Fully Homomorphic Encryption, Functional Bootstrapping, FHEW/TFHE, Monic Monomial Permutation Matrix, Test-Coefficient Look-up Property.I Introduction
Fully homomorphic encryption (FHE) schemes allow to perform arbitrary computation on ciphertexts without resorting to decryption. After over a decade, FHE schemes have been well developed, and have been applied to various privacy-preserving tasks, such as private database query [1], private information retrieval [2, 3], private decision tree evaluation [4], etc.
In FHE schemes, ciphertexts must be bootstrapped periodically in order to run on them arbitrary circuits of arbitrary depth. Originally the term referred to refreshing a ciphertext that has a large error so that after the refreshment, the error decreases to a small bound [5]. Later on it was extended to “functional bootstrapping”, which refers to evaluating an arbitrary function that is represented by a look-up table. Bootstrapping is the most important part of FHE schemes.
All bootstrapping schemes are based on Gentry’s idea of running the decryption circuit homomorphically in a new FHE environment. [5]. Take as an example the most popular FHE scheme BFV, whose ciphertexts are of either LWE or its ring variant RLWE format. The decryption of an LWE ciphertext consists of two steps: the first step is to compute the phase of the ciphertext homomorphically, where the phase is , with being the plaintext, being the error, and where . The second step is to remove from the plaintext in the encrypted phase. The first step is generally easy, while the second step is difficult.
The trick lies in how to represent the additive group in the plaintext space, so that when the group acts on a vector or polynomial (called test vector or polynomial) that encodes the look-up table of the function to be evaluated, the group element corresponding to phase results in a vector or polynomial with as its first entry, which can then be extracted homomorphically to get a ciphertext encrypting .
In 2014, Alperin-Sheriff and Peikert [6] proposed a bootstrapping scheme which we call “AP14”. They use permutation matrices to represent group , where every is represented by a matrix
(I.1) |
so that the addition of integers agrees with the multiplication of matrices. By encrypting in a GSW-ciphertext [7], the homomorphic phase computation is realized by successive GSW ciphertext multiplications, and the error is small in the resulting ciphertext that encrypts the phase of the input ciphertext, due to the fact that in , every row and column respectively contain one and only one nonzero entry, and the entry is 1.
For any function defined on , if extending to a function on such that for all and , then for test vector , it is easy to verify that
(I.2) |
So is the first entry of the resulting plaintext vector. (I.2) is called the test-coefficient look-up property of the AP14 scheme.
In 2015, Ducas and Micciancio [8] proposed another bootstrapping scheme called “FHEW”. In this scheme, first is switched to where is a power of 2, then every is represented by a monic monomial , so that the addition of integers agrees with the multiplication of monic monomials. By encrypting every in an RGSW-ciphertext where the polynomial ring is , the homomorphic phase computation is realized by successive RGSW ciphertext multiplications, and the error is small in the resulting ciphertext that encrypts the phase of the input ciphertext.
For any function defined on , if can be extended to a nega-cyclic function on , such that for all , and for all and , where , then for test polynomial , it is easy to verify that
(I.3) |
So is the first entry, a.k.a. the constant term, of the resulting plaintext polynomial. (I.3) is called the test-coefficient look-up property of the FHEW scheme.
Since FHEW scheme adopts RGSW ciphertext format in homomorphic phase computation, FFT can be used to accelerate the computing. As a result, bootstrapping a ciphertext encrypting a single-bit plaintext by FHEW scheme costs less than 1 second. Later on, another scheme called TFHE was proposed by Chillotti et al. in 2016 [9] to optimize homomorphic phase computation in FHEW, which improves the run-time cost to less than 0.1 second. In 2021, both schemes were extended to make functional bootstrapping for arbitrary functions in 2021 [10, 11].
The last few years have witnessed fast developments of bootstrapping algorithms. To name a few, in [12], a scheme was proposed to evaluate several functions on the same ciphertext simultaneously by one bootstrapping. In [10, 13], to bootstrap ciphertexts encrypting long plaintext, a strategy of block-wise bootstrapping from the tail up was proposed; the strategy can be used for functional bootstrapping where the function is either the identity function , or the sign function. In [14, 15], FHEW/TFHE was extended to bootstrap a ciphertext encrypting several plaintexts in SIMD mode.
We notice that for large-plaintext bootstrapping, block-wise bootstrapping works only for some special functions. For a general function, the look-up table representation of the function demands big polynomial degree in RLWE/RGSW ciphertexts. The bigger the polynomial degree, the slower the computation, and the bigger the memory cost due to bootstrapping keys and key-switching keys.
A natural idea is to resort to a polynomial vector instead of only a polynomial to encode the look-up table of a general function . For example, let be the maximal value of ring dimension for efficient computing of RLWE/RGSW ciphertext multiplication. For an ciphertext whose plaintext modulus is big, the ciphertext modulus must be large, say . Let
(I.4) |
After modulus switch from to , and extending to a function defined on such that for all and , where , then can be encoded to the following -dimensional polynomial vector:
(I.5) |
Now that in (I.3) is replaced by test vector (I.5), the representation space of must be replaced by a group of matrices, where in each matrix, every row and column respectively contains one and only one nonzero entry, and the entry is a monic monomial. Such matrices are called monic monomial permutation matrices in this paper. A subgroup of the monic monomial permutation matrices is to be constructed, so that is isomorphic to , and the action of on (I.5) by matrix-vector multiplication has the property that for any , its counterpart when acting on (I.5), changes the vector into one whose first entry has its constant term as . The last property is the test-coefficient look-up property, and is the counterpart of (I.2) and (I.3).
The above analysis outlines the main idea of our work. This paper proposes to use monic monomial permutation matrices to represent the additive group , finds among all its cyclic subgroups those that has the test-coefficient look-up property, and designs a new scheme of FHEW/TFHE style, called BootMMPM, for general functional bootstrapping of LWE ciphertexts encrypting large plaintext.
The new scheme BootMMPM has the feature that the size of bootstrapping keys and the size of key-switching keys are both irrelevant to . This is significant for saving memory cost. Indeed, in recent years there have been several papers dedicated to reducing the size of bootstrapping keys. Yongwoo Lee et al. [16] proposed a modification of FHEW scheme by making phase accumulation with ring automorphisms, which requires much fewer bootstrapping keys on the server. In [17, 18], bootstrapping keys are packed into small number of transfer keys by the client, and then reconstructed by the server upon receival. It reduced the key size on the client’s side. Such method can be applied to TFHE scheme and the new scheme BootMMPM to further reduce the key size both on the client’s side and on the server’s side.
Compared with the TFHE scheme, the new scheme BootMMPM also has slight improvement in run time. The following table shows that for , the time improvement of BootMMPM is a constant factor, while the key-size improvement is a polynomial factor.
Schemes | TFHE | BootMMPM |
phase accumulation time complexity | ||
bootstrapping key size | ||
key-switching key size |
This paper reports the following work:
-
1.
Classification of all monic monomial permutation matrices under similar transformations. It turns out that any monic monomial permutation matrix is similar to a block diagonal matrix, where each block in the diagonal is of the form
(I.6) where , and if , then (I.6) is just .
-
2.
Computation of the order of any monic monomial permutation matrix. Only cyclic subgroups of order in the group of monic monomial permutation matrices are useful in bootstrapping.
-
3.
Classification of cyclic subgroups of by their number of orbits when acting on the following set of monic monomial indicator vectors:
(I.7) where is the -dimensional vector whose -entry is while all other entries are . Only cyclic subgroups of order and 1 orbit have test-coefficient look-up property.
-
4.
construction of test polynomial vector for any cyclic subgroup of order and 1 orbit.
-
5.
A new algorithm BootMMPM for functional bootstrapping based on the cyclic subgroup of order and 1 orbit that is generated by .
-
6.
Implementation of BootMMPM on PALISADE library[19], and experiments of bootstrapping with the identity function on ciphertexts where the plaintext size ranges from 5 bits to 15 bits.
The content is arranged as follows. In Section 2, some terminology, notations, and basics of FHEW/TFHE functional bootstrapping are introduced. In Section 3, theoretical investigation of the monic monomial permutation matrix group is done. In Section 4, the new algorithm BootMMPM is proposed and analyzed. In Section 5, experimental results on BootMMPM are reported.
II Notations and Basics of FHEW/TFHE Functional Bootstrapping
We first present some notations and terminology:
(1) For any integer , denote by the set .
(2) Given a polynomial , denote by its coefficient vector.
(3) Given a matrix , denote by its -th entry.
(4) If is an element of group , denote by the cyclic subgroup generated by .
(5) That a random variable has zero-centered subgaussian distribution with variance proxy , refers to the property that there exists a constant , such that for all , . In particular, if is Gaussian with variance , then it is subgaussian with variance proxy .
The heuristic bound of subgaussian random variable is , where constant is determined by the failure probability of the bound.
(6) Let be both powers of 2, where . Let be three positive integers, where is even. For any and , set
(II.1) |
(7) Let be an even positive integer. A function is said to be nega-cyclic, if for any , .
Let , and let be a nega-cyclic function such that for all , all satisfying ,
(II.2) |
Then is called a nega-cyclic extension of from to .
(8) An ciphertext of BFV format, with modulus , dimension , and secret , is of the form , where , , and the phase
(II.3) |
such that is the plaintext, and is the error. The ciphertext is decryptable if and only if .
Given a message , the trivial encryption of in is the ciphertext . It is independent of secret .
(9) Given an ciphertext , the modulus switch from to outputs an ciphertext that encrypts the same plaintext as the input ciphertext:
(II.4) |
(10) Let be an integer. The -digit decomposition (or gadget decomposition) of an integer generates an integer sequence of length : , where each , and .
The -digit decomposition operation on is denoted by . Integer is called the digit decomposition base.
(11) Given an ciphertext with secret , the key switch from to outputs an ciphertext encrypting the same plaintext as the input ciphertext but under secret .
Key switch requires not only all the components of to be encrypted with beforehand, but also the multiples of the components of the form , where (i) , (ii) is the digit decomposition base, (iii) where , (iv) . Let be an ciphertext encrypting with secret . These ciphertexts are called the key-switching keys; they cannot be decrypted correctly with .
Let , and for each taken as an integer in , let be its -digit decomposition. Then
(II.5) |
(12) An ciphertext of BFV format, with modulus , ring dimension that is a power of 2, and secret key , is of the form , where , and the phase
(II.6) |
such that is the plaintext, and is the error.
The ciphertext is decryptable if and only if Given a message , the trivial encryption of in is the ciphertext . It is independent of secret .
(13) Given an ciphertext (where , ) encrypting a message with secret key , the constant-term extraction outputs an ciphertext encrypting the constant term with secret key :
(II.7) |
(14) An ciphertext with modulus , ring dimension that is a power of 2, secret key , and digit decomposition base , is an matrix with entries in , where , such that the phase
(II.8) |
with , being the plaintext, and being the error.
The ciphertext is decryptable if and only if Given a message , the trivial encryption of in is the ciphertext . It is independent of secret .
The multiplication of an ciphertext with an ciphertext under the same secret, is
(II.9) |
where the -digit decomposition operator acts on separately, so that . (II.9) is an ciphertext encrypting the product of the plaintexts in the two ciphertexts respectively. Similarly, the multiplication between two ciphertexts , is .
(15) The CMux (controlled multiple executions) operator controlled by ternary variable and three operations , outputs operation . Set
(II.10) |
Then the CMux operator can be denoted by , whose expression is
(II.11) |
Definition 1
Given an ciphertext encrypting message , and a nega-cyclic function , the functional bootstrapping is a procedure of generating a decryptable ciphertext encrypting message with the same secret key as the input.
Gentry’s bootstrapping idea is to execute the decryption circuit homomorphically. As the decryption needs to use the secret key , it must be provided beforehand and in a ciphertext form. The first step of decryption is to compute the phase of the input LWE ciphertext , which is essentially the inner product between vectors . Now that is encrypted, the inner product is between a plaintext vector and a ciphertext vector. This can be done similar to the key switch procedure.
For example, for , let be the -digit decomposition of , where ; if is the new secret key, then as in (II.5), for , let each be encrypted to an ciphertext with secret key , then
(II.12) |
is an ciphertext encrypting . The procedure of computing the additions in (II.12) homomorphically is called phase accumulation. The ciphertexts are called FHEW bootstrapping keys.
The second step of decryption is to remove the error in the phase by rounding, and execute the “modulo-” operation. In bootstrapping, both need to be done homomorphically. To get rid of the error part of , the FHEW scheme uses the monomial representation of : for a power-of-2 integer , first the input ciphertext is changed into an ciphertext by modulus switch, then each is represented as a monic monomial before being encrypted in an ciphertext.
In the plaintext, the additions in phase accumulation (II.12) are done in the exponent space of a monomial; in the ciphertext, the additions are done by RGSW ciphertext multiplications. Since RGSW ciphertexts have the unique property that the error in the product of two RGSW ciphertexts is additive in the error of the second ciphertext, ciphertext has small error growth. After phase accumulation, the plaintext becomes
(II.13) |
where the error satisfies .
For a nega-cyclic function , let be a nega-cyclic extension of , so that for all , where , and satisfies ,
(II.14) |
The right side of (II.14) is a polynomial in , called the test polynomial of .
In FHEW scheme, the trivial -encryption of test polynomial (II.14) is multiplied with ciphertext , the result is an ciphertext encrypting plaintext .
The constant term of the plaintext in is exactly . Then constant-term extraction is used to obtain from an ciphertext encrypting with secret key , according to (II.7).
After this, the key switch procedure is used to change the secret key to , resulting in an ciphertext . Finally, the modulus switch from to changes to an ciphertext , which is the output. This is the whole procedure of the FHEW scheme.
The TFHE scheme improves upon the FHEW scheme by merging the generation of and it starts from the trivial -encryption of test polynomial (II.14), and consecutively multiplies it from the right side with an ciphertext each encrypting a term of (II.12). Then is generated without generating . This trick replaces the product of two matrices to the product between a matrix and a vector.
A typical setting is where is ternary, namely, where each . In this setting, the plaintext that corresponds to the term in , has three possibilities: , if , respectively. In terms of the CMux operator and its expression (II.11), for and ,
(II.15) |
In (II.15), if both are encrypted as ciphertexts, and 1 is trivially encrypted, then the right side becomes the sum of three ciphertexts; it replaces the product in FHEW phase accumulation (II.12). The ciphertexts encrypting the are called TFHE bootstrapping keys when the secret is ternary.
In summary, the procedure of TFHE functional bootstrapping for LWE ciphertext with ternary secret is as follows:
Input:
-
1.
ciphertext to be bootstrapped, whose plaintext modulus is , whose plaintext is and whose secret is ;
-
2.
TFHE bootstrapping keys encrypting for , which are ciphertexts whose secret is ;
-
3.
test polynomial of the form (II.14) in , which encodes the nega-cyclic function ;
-
4.
key-switching keys, which are ciphertexts encrypting with secret for all , , , where is the digit decomposition base for key switch.
Output: ciphertext encrypting .
Step 1. Modulus switch from to . The result is an ciphertext with secret .
Step 2. Phase accumulation (or blind rotation). It starts from the product of the trivial encryption of the test polynomial and the trivial encryption of , for every , updates by multiplying it from the right side with an ciphertext encrypting . The result, still denoted by , is an ciphertext with secret .
Step 3. Constant-term extraction (also called sample extract) of . The result is an ciphertext encrypting with secret .
Step 4. Key switch from to . The result is an ciphertext .
Step 5. Modulus switch from to . The result is an ciphertext .
III Monomial Matrix Representation of Additive Cyclic Group
The order of an element in a group, denoted by , is the smallest positive integer such that , where 1 is the identity element.
When a group acts on a set , the action is said to be transitive, if for all , there exists a such that . The action is said to be regular or faithful, if for any , for all if and only if .
An -representation of a group is a homomorphism from to some , where is a finite-dimensional -vector space. Two representations for , are said to be equivalent, if there is an -linear isomorphism , such that for all , .
Now fix the field as the following one, where is a power of 2:
(III.1) |
For any , an element of is called a monic monomial permutation matrix if in the matrix, every row and every column respectively contains one and only one nonzero entry, and the entry is a monic monomial. All monic monomial permutation matrices form a finite subgroup of . It is easy to see that any monic monomial permutation matrix is of the form
(III.2) |
where , is the Kronecker symbol, and is a permutation acting on .
Consider the additive cyclic group , where . The identity element is 0, and the generator is 1. Let be a representation of group . Then is a subgroup generated by matrix .
Lemma 1
Matrix is similar to , where if setting , then with , , such that
(III.3) |
with each .
Proof:
Let be the smallest among all the positive integers satisfying . Then , and is the orbit of 0 under the action of , which contains different elements. Choose an arbitrary bijection . Construct the following element : for all ,
(III.4) |
Set matrix . Then . For all , the -entry of matrix is
(III.5) |
Set , set , and set if .
For any , if , then by (III.4), so if and only if . If , then , so . In particular, is invariant under .
So matrix is block-diagonal, the first block in the diagonal is , and the second block is . ∎
Lemma 2
Matrix is similar to , where , and for every , , where each , , and each is of the form (III.3).
Proof:
Lemma 3
Let matrix , where for all , then for all ,
(III.6) |
Proof:
When , the conclusion is trivial. Assume that the conclusion holds for all . When ,
(III.7) |
∎
Proof:
By induction, it is easy to prove that for all . So . As a consequence, is independent of .
By (III.6) and ,
(III.9) |
where is the identity matrix. So We prove that is the smallest among all the positive integers such that .
Example 1
Let
(III.11) |
Then . When , (III.11) is just the monic monomial representation used in FHEW/TFHE. When setting , (III.11) is the the permutation matrix representation used in AP14.
For any , where ,
(III.12) |
In particular, For any ,
(III.13) |
which equals the Hadamard product between vectors and , .
Let be the canonical basis of , namely, the -th entry of is 1, while all other entries are 0. Set
(III.14) |
For any ,
(III.15) |
So is closed under the action of .
Lemma 5
Let take the form in Lemma 2, namely, , where for , with , such that for all . Then the action of group on set is regular, and the number of orbits is
(III.16) |
Proof:
Since contains the basis of , any linear transformation of leaving each element of invariant must be the identity transformation. So the action of on is regular. Below we prove (III.16) by induction.
Set
(III.17) |
Then generates a subgroup of . We prove that the number of orbits in under the action of is .
By (III.8),
(III.18) |
Now that generates a cyclic group of order , and generates a subgroup of order , there are
(III.19) |
cosets of in . Select one element from each coset respectively, and let them be .
We claim (1) under the action of subgroup , for any such that , the orbits of and do not overlap. Suppose the converse is true, namely there exists such that . As , let , where . By (III.9), , so
(III.20) |
If , by (III.6), does not preserve the 1-space spanned by , and the last equality in (III.20) is false. So , and . This indicates that are in the same coset of in , contradiction. This proves claim (1).
We claim (2) for any , the number of elements in the orbit of under is at least . To prove the claim we only need to show that for any such that , .
Suppose the converse is true. Without loss of generality, assume . Then , and . On the other hand, by (III.6), does not preserve the 1-space spanned by , contradiction. This proves claim (2).
Set
(III.21) |
Obviously every element of is fixed by , and the set is invariant under .
We claim (3) is the union of the orbits of under the action of . Denote by the orbit of under , and for any set , denote by the number of elements in the set. By claims (1), (2), and using (III.19), we get
(III.22) |
So . This proves claim (3). As a corollary, for all , and the number of orbits in under the action of is .
When takes the general form , by induction, the conclusion (III.16) can be easily proved. ∎
Theorem 1
For any group representation , the action of on is transitive if and only if is similar to
(III.23) |
where .
Proof:
Only cyclic subgroups of order and transitive on can have test-coefficient look-up property, because for any test polynomial vector , for any monomial in the -th entry of , only in such a subgroup can there be one and only one element that changes the monomial to , i.e., the constant term, in the first entry of the resulting vector in . In the following, we consider the design of test polynomial vectors encoding nega-cyclic functions.
Lemma 6
Let be a group representation taking the form of (III.23), where . Then and for any , the elements in set
(III.24) |
are -linearly independent vectors.
Proof:
The first conclusion is direct from (III.9) and . For the second conclusion, for any , set
(III.25) |
We prove that every is a -linearly independent set of vectors.
When , is -linearly independent. Assume that for all , is -linearly independent. For , if is not -linearly independent, then for some .
Let be any vector in . For any , set
(III.26) |
By Lemma 6, is -linearly independent. It is easy to see that for any , , and for any , .
The following lemma indicates that can serve as the test polynomial vector.
Lemma 7 (Test-coefficient look-up property)
Proof:
No matter if or not, it is always true that is a term of , and
(III.27) |
is a term of , i.e., the constant-term in the first entry of . ∎
Example 2
For taking the form of Lemma 6, let , where . By (III.6), the -entry of matrix is , while all other entries in the first column of are zero, namely, . By (III.9), . So
(III.28) |
and
(III.29) |
In particular, if takes the form (III.11), then for any nega-cyclic function , set for all . Then for all . The test polynomial vector is
(III.30) |
For any , where , equals
(III.31) |
It is easy to see that for any , changes the term of ,i.e., the -st term in the -st row of test polynomial vector , into the term of , i.e., the constant term in the first row of the resulting polynomial vector. This is the test-coefficient look-up property demanded in bootstrapping.
IV New Functional Bootstrapping Scheme
From now on, we always set to be of the form (III.11). By Theorem 1, this choice does not lose generality.
Given a plaintext vector , its RLWE encryption is done component-wise, resulting in a vector of RLWE ciphertexts, called an -dimensional RLWE vector encrypting . The space of -dimensional vectors is denoted by . Any -dimensional vector is a matrix in .
According to (III.13), for any , for any any -dimensional vector encrypting a plaintext vector , the usual matrix product of plaintext matrix with matrix , results in an vector ( matrix) encrypting plaintext vector . This defines the multiplication between plaintext matrix and RLWE vector .
Let , and let and . If the are each encrypted as an RGSW ciphertext, then the ciphertext multiplication between RLWE vector and the RGSW ciphertext encrypting (or ) is done component-wise between each component of the RLWE vector and the the RGSW ciphertext. The result is an RLWE vector encrypting (or ). This defines the multiplication between an RLWE vector and an RGSW ciphertext.
By (II.11), for any ,
(IV.1) |
The expression can be evaluated homomorphically if are encrypted as RLWE vector, RGSW ciphertext, RGSW ciphertext respectively, and the multiplications are between an RLWE vector and an RGSW ciphertext.
We are ready to extend the classical TFHE scheme to a new scheme “BootMMPM” based on the monic monomial permutation matrix representation of where takes the form (III.11), as follows:
-
•
with secret , plaintext ;
-
•
test polynomial vector whose coefficients encode a nega-cyclic extension of ;
-
•
bootstrapping keys: for all , are ciphertexts encrypting respectively with secret , the gadget base is , and ;
-
•
key-switching keys from ciphertexts with secret to ciphertexts with secret , the gadget base is , and .
The algorithm would be correct if we could control the error bound in the output ciphertext, and in particular, if the error growth in the homomorphic CMux operation is slow. In the product of a plaintext matrix and an RLWE vector , the error bound is the same with that of , due to the Hadamard product nature of this product.
The -digit decomposition of an RLWE vector is done component-wise. Recall that when an RLWE ciphertext takes the form of a 2-dimensional row vector, after digit decomposition, it becomes an -dimensional row vector. So an -dimensional vector as a matrix of size , after digit decomposition, becomes a matrix of size .
Recall that an RGSW ciphertext is a matrix in . The multiplication of an RLWE vector with an RGSW ciphertext encrypting an element of is done component-wise, resulting in a new RLWE vector , where is the -digit decomposition operation.
Let the error vectors in be , , respectively, then as in the case of , we have
(IV.2) |
By Corollary 3.15 of [9], if are subgaussian with variance proxy respectively, then is subgaussian with variance proxy
(IV.3) |
Lemma 8
Let , and let be defined as in (II.10). Let be three vectors where the errors are all subgaussian with variance proxy , and let be ciphertexts encrypting respectively, where the errors are independent subgaussian with variance proxy . If the errors in are independent of the errors in , then the homomorphic evaluation result of has a subgaussian error vector with variance proxy
(IV.4) |
Proof:
Let the error vectors in be respectively, where the first two are in , the latter three are in . For a subgaussian random variable , we use to denote its variance proxy.
Theorem 2
In the input of Algorithm 1, let be respectively the variance proxies of the bootstrapping keys and key-switching keys. Then for any input ciphertext encrypting a message , as long as after modulus switch from to , the ciphertext is correctly decryptable, Algorithm 1 outputs an ciphertext encrypting message with a subgaussian error of variance proxy
(IV.7) |
Proof:
In computing , the initial value is error-free. By Lemma IV.4, every round of the for-loop increases the variance proxy of the subgaussian error by . So after the phase accumulation loop, the error has variance proxy .
The constant-term extraction of the first row of changes the RLWE ciphertext with secret into an LWE ciphertext with secret , but does not change the the variance proxy of the error.
In the key switch procedure, by Lemma 6 of [8], for any ciphertext with subgaussian error of variance proxy , the procedure generates an ciphertext with subgaussian error of variance proxy .
In the modulus switch procedure in the last step of the algorithm, by [8], for any ciphertext with subgaussian error of variance proxy , the modulus switch from to based on non-randomized rounding function , generates an ciphertext with subgaussian error of variance proxy
(IV.8) |
where is the -norm of the secret , and is the variance of the uniform distribution on . So the modulus switch modifies the variance proxy of the subgaussian error by first scaling it with , then adding a term of rounding error . ∎
For general functional bootstrapping where the evaluation function is not nega-cyclic, the routine procedure used in FHEW/TFHE [12, 10] is to take the input plaintext as an integer in , take the plaintext modulus as , and take as a cyclic function defined on , namely, for all . The plaintext encrypted in the input ciphertext, now being in , has an extra bit as the new MSB or sign bit, whose value is unknown.
On the other hand, the original plaintext is positive, so the new MSB must be removed before functional bootstrapping based on . To extract the new MSB, one bootstrapping based on nega-cyclic function
(IV.9) |
is sufficient, because for any ,
(IV.10) |
After being extracted, the MSB is subtracted from the input plaintext, so that after this modification, the plaintext is always in . Then another bootstrapping based on the trivial nega-cyclic extension of from to suffices.
V Complexity and experiments
In BootMMPM, the most important factor is the dimension of the test polynomial vector. By (I.4), , and should be as small as possible.
On the other hand, the choice of should guarantee that the ciphertext after modulus switch from to is decryptable. Let the error of the input ciphertext be subgaussian with variance proxy . By (IV.8), the modulus switch from to changes the variance proxy to
(V.1) |
For the ciphertext after modulus switch to be decryptable, it is sufficient that the heuristic bound of the error , where is a constant determined by the decryption failure probability. By (V.1), the inequality becomes
(V.2) |
When
(V.3) |
where the are positive real numbers, and , then (V.2) requires . On the other hand, requires . So
(V.4) |
The efficiency factors of Algorithm BootMMPM on the server’s side include memory cost and run-time cost. The former is heavily influenced by the size of bootstrapping keys and key-switching keys, while the latter mainly depends on the time complexity of the phase accumulation loop.
(1) Bootstrapping key size.
There are bootstrapping keys, and each key is an RGSW ciphertext that is a matrix in . Every element of is a polynomial of degree with coefficient in , so it has bits. Overall, in BootMMPM the total number of bits in the bootstrapping keys is .
In contrast, directly using TFHE to make functional bootstrapping requires to be a power of 2, and the ring to be . The bootstrapping keys in TFHE have bits. In the setting of (V.3), this size is polynomially bigger than that in BootMMPM.
(2) key-switching key size.
The key-switching keys are the for all . So in BootMMPM, the total number of bits in the key-switching keys is bits.
In contrast, in TFHE the ring is , so the key-switching keys in TFHE have bits. In the setting of (V.3), this size is polynomially bigger than that in BootMMPM..
(3) Phase-accumulation time complexity.
The phase accumulation procedure consists of CMux operations. In BootMMPM, each CMux requires 2 multiplications between an RLWE vector and an RGSW ciphertext, or equivalently, multiplications between an RLWE ciphertext and an RGSW ciphertext.
The multiplication between an RLWE ciphertext and an RGSW ciphertext is the usual matrix product between a matrix in and a matrix in . It contains polynomial multiplications in . By FFT, each polynomial multiplication requires at most integer multiplications in . So the multiplication between an RLWE ciphertext and an RGSW ciphertext has integer multiplication complexity . Overall, the phase accumulation procedure in BootMMPM has integer multiplication complexity .
In contrast, in TFHE, each CMux requires 2 multiplications between RLWE ciphertext and RGSW ciphertext, where the polynomial ring is . So the phase accumulation procedure in TFHE has integer multiplication complexity . In the setting of (V.3), this complexity is times larger than that of Algorithm BootMMPM.
Experiments:
We implement BootMMPM on Palisade platform[19] and run it on two different hardware platforms. We use the identity function for bootstrapping test. This function is not nega-cyclic, so two rounds of bootstrapping are required, with the first extracting the MSB homomorphically. The first bootstrapping can be replaced by the homomorphic sign computing algorithm in [10] to improve efficiency. For the purpose of making comparison with TFHE scheme, we adopt the same algorithm in both rounds of bootstrapping, namely, either both are TFHE, or both are BootMMPM.
Platform 1. IBM-Compatible PC with Intel(R) Core(TM) i7-10700 CPU @ 2.90 GHz and 16.0 GB RAM. Software: PALISADE v1.11.9 with compiler g++ 11.3.0. Plaintext size: respectively. Following the parameter setting in [10], we choose
(V.5) |
average time (s) | BootKeys +KSKeys | |||||
TFHE | 5 | 12 | 11 | 0.6969 | 256 MB +2.35 GB | |
6 | 13 | 12 | 3.6953 | 512 MB +4.70 GB | ||
7 | 14 | 13 | 10.092 | 1 GB +9.39 GB | ||
Boot- MMPM | 5 | 12 | 11 | 0 | 0.7375 | 256 MB +2.35 GB |
6 | 13 | 1 | 1.3625 | |||
7 | 14 | 2 | 2.6376 | |||
8 | 15 | 3 | 5.2578 | |||
9 | 16 | 4 | 10.203 | |||
10 | 17 | 5 | 20.261 | |||
11 | 18 | 6 | 41.795 |
In Table 1, the TFHE bootstrapping program stops running when the plaintext size reaches 8 bits, with nothing coming out; on the other hand, the BootMMPM program still runs when the plaintext size reaches 11 bits, and finishes in 42 seconds with correct result. When the plaintext has 7 bits, running TFHE costs over 10 seconds, while running BootMMPM costs less than 3 seconds; the latter is faster by about 3 times. For each plaintext size, 10 plaintexts of the specific size are randomly generated, and the algorithms run on the ciphertexts encrypting them separately to get the average run-time.
As to the key size, it can be reduced on the client’s side using packing techniques [17, 18], for both TFHE and BootMMPM, with the same scale. In the experiments, these improvements are not implemented for sharper comparison.
Platform 2. HP Workstation with Intel(R) Xeon(R) Gold 6258R CPU @ 2.70 GHz and 1.00 TB RAM. Software: PALISADE v1.11.8 with compiler g++ 11.3.0. Plaintext size: respectively. Following [20], we increase to .
Although the security level of BootMMPM under the above setting is lower than that of TFHE when , the increase of security level in TFHE is passively driven by the need of larger exponent space, so that the whole look-up table can be encoded.
average time (s) | BootKeys +KSKeys | |||||
TFHE | 5 | 12 | 11 | 1.7382 | 512 MB +4.69 GB | |
6 | 13 | 12 | 3.5343 | 1 GB +9.38 GB | ||
7 | 14 | 13 | 7.2890 | 2 MB +18.8 GB | ||
8 | 15 | 14 | 14.894 | 4 GB +37.5 GB | ||
9 | 16 | 15 | 30.678 | 8 GB +75.1 GB | ||
10 | 17 | 16 | 61.116 | 16 GB +150 GB | ||
11 | 18 | 17 | 123.47 | 32 GB +300 GB | ||
Boot- MMPM | 5 | 12 | 11 | 0 | 1.7687 | 512 MB +4.69 GB |
6 | 13 | 1 | 3.3859 | |||
7 | 14 | 2 | 6.4064 | |||
8 | 15 | 3 | 12.402 | |||
9 | 16 | 4 | 24.379 | |||
10 | 17 | 5 | 49.792 | |||
11 | 18 | 6 | 96.132 | |||
12 | 19 | 7 | 202.56 | |||
13 | 20 | 8 | 413.22 | |||
14 | 21 | 9 | 834.60 | |||
15 | 22 | 10 | 1676.3 |
In Table 2, both programs run correctly for plaintext size up to 11 bits, and BootMMPM is slightly faster. For example, when the plaintext size is 11 bits, TFHE costs more than 120 seconds, while BootMMPM costs less than 100 seconds.
On both platforms, BootMMPM remains constant bootstrapping key size 512 MB and key-switching key size 4.69 GB, while TFHE requires the bootstrapping key size to grow from 512 MB to 32 GB, and the key-switching key size to grow from 4.69 GB to 300 GB.
VI Conclusion
For general functional bootstrapping of ciphertexts encrypting long plaintext, this paper proposes to encode the look-up table of the function by a polynomial vector, instead of only a polynomial in FHEW/TFHE. This motivates a thorough investigation of the group of monic monomial permutation matrices and its cyclic subgroups, based on which a new algorithm for general functional bootstrapping is proposed. The algorithm features in small bootstrapping and key-switching key size, which benefits communication cost and memory cost in bootstrapping.
On the other hand, the new algorithm provides only slight improvement in time cost. One may consider using a multivariate polynomial instead of a polynomial vector to encode the look-up table of a general function. This idea may lead to significant speed-up, just as in the case of parallel FHEW/TFHE bootstrapping [14, 15]. New explorations are expected to make improvement on time cost in this direction.
Acknowledgments
This research was supported partially by China National Key Research and Development Project Grant No. 2020YFA0712300.
References
- [1] B. H. M. Tan, H. T. Lee, H. Wang, S. Ren, and K. M. M. Aung, “Efficient private comparison queries over encrypted databases using fully homomorphic encryption with finite fields,” IEEE Transactions on Dependable and Secure Computing, vol. 18, no. 6, pp. 2861–2874, 2020.
- [2] X. Yi, M. G. Kaosar, R. Paulet, and E. Bertino, “Single-database private information retrieval from fully homomorphic encryption,” IEEE Transactions on Knowledge and Data Engineering, vol. 25, no. 5, pp. 1125–1134, 2012.
- [3] S. Angel, H. Chen, K. Laine, and S. Setty, “Pir with compressed queries and amortized query processing,” in 2018 IEEE symposium on security and privacy (SP). IEEE, 2018, pp. 962–979.
- [4] K. Cong, D. Das, J. Park, and H. V. Pereira, “Sortinghat: Efficient private decision tree evaluation via homomorphic encryption and transciphering,” in Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security, 2022, pp. 563–577.
- [5] C. Gentry, “Fully homomorphic encryption using ideal lattices,” in Proceedings of the forty-first annual ACM symposium on Theory of computing, 2009, pp. 169–178.
- [6] J. Alperin-Sheriff and C. Peikert, “Faster bootstrapping with polynomial error,” in Annual Cryptology Conference. Springer, 2014, pp. 297–314.
- [7] R. Hiromasa, M. Abe, and T. Okamoto, “Packing messages and optimizing bootstrapping in gsw-fhe,” IEICE TRANSACTIONS on Fundamentals of Electronics, Communications and Computer Sciences, vol. 99, no. 1, pp. 73–82, 2016.
- [8] L. Ducas and D. Micciancio, “Fhew: bootstrapping homomorphic encryption in less than a second,” in Annual international conference on the theory and applications of cryptographic techniques. Springer, 2015, pp. 617–640.
- [9] I. Chillotti, N. Gama, M. Georgieva, and M. Izabachene, “Faster fully homomorphic encryption: Bootstrapping in less than 0.1 seconds,” in international conference on the theory and application of cryptology and information security. Springer, 2016, pp. 3–33.
- [10] Z. Liu, D. Micciancio, and Y. Polyakov, “Large-precision homomorphic sign evaluation using fhew/tfhe bootstrapping,” Cryptology ePrint Archive, 2021.
- [11] I. Chillotti, D. Ligier, J.-B. Orfila, and S. Tap, “Improved programmable bootstrapping with larger precision and efficient arithmetic circuits for tfhe,” in Advances in Cryptology–ASIACRYPT 2021: 27th International Conference on the Theory and Application of Cryptology and Information Security, Singapore, December 6–10, 2021, Proceedings, Part III 27. Springer, 2021, pp. 670–699.
- [12] I. Chillotti, N. Gama, M. Georgieva, and M. Izabachène, “Tfhe: fast fully homomorphic encryption over the torus,” Journal of Cryptology, vol. 33, no. 1, pp. 34–91, 2020.
- [13] Z. Yang, X. Xie, H. Shen, S. Chen, and J. Zhou, “Tota: Fully homomorphic encryption with smaller parameters and stronger security,” Cryptology ePrint Archive, 2021.
- [14] F.-H. Liu and H. Wang, “Batch bootstrapping i: a new framework for simd bootstrapping in polynomial modulus,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer, 2023, pp. 321–352.
- [15] Liu, Feng-Hao and Wang, Han, “Batch bootstrapping ii: bootstrapping in polynomial modulus only requires o~(1) fhe multiplications in amortization,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer, 2023, pp. 353–384.
- [16] Y. Lee, D. Micciancio, A. Kim, R. Choi, M. Deryabin, J. Eom, and D. Yoo, “Efficient fhew bootstrapping with small evaluation keys, and applications to threshold homomorphic encryption,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques. Springer, 2023, pp. 227–256.
- [17] A. Kim, M. Deryabin, J. Eom, R. Choi, Y. Lee, W. Ghang, and D. Yoo, “General bootstrapping approach for rlwe-based homomorphic encryption,” Cryptology ePrint Archive, 2021.
- [18] A. Kim, Y. Lee, M. Deryabin, J. Eom, and R. Choi, “Lfhe: Fully homomorphic encryption with bootstrapping key size less than a megabyte,” Cryptology ePrint Archive, 2023.
- [19] “Palisade lattice cryptography library,” https://palisade-crypto.org/, 2022.
- [20] M. Albrecht, M. Chase, H. Chen, J. Ding, S. Goldwasser, S. Gorbunov, S. Halevi, J. Hoffstein, K. Laine, K. Lauter et al., “Homomorphic encryption standard,” Protecting privacy through homomorphic encryption, pp. 31–62, 2021.
Dengfa Liu received Bachelor of Science degree from Fujian Normal University in 2019. He is currently pursuing a PhD at AMSS, Chinese Academy of Sciences. His research interest is Algorithm Design in Privacy Computation. |
Hongbo Li is Kwan Chao-Chi Chair Professor and Director of the Institute of Systems Science, AMSS, Chinese Academy of Sciences. He received BS, MS, PhD from the Department of Mathematics at Beijing University in 1988, 1991, 1994, respectively. His research interests include Automated Reasoning, Symbolic Computation, Geometric Algebra, Quantum Computing, Privacy Computation, etc. He is Director of the Computer Mathematics Committee of Chinese Mathematics Society. |