Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics †
Abstract
:1. Introduction
Contribution
2. Preliminaries
2.1. Notation
2.2. Background of TFHE
2.2.1. Learning with Errors
2.2.2. Bit-Wise LWEEncryption
- : Let the security parameter be . Select and fix public parameters , ; then, samples a secret key and outputs it.
- : a uniformly random vector and a noise are sampled, where is the Gaussian distribution over with a standard deviation . Then, the algorithm outputs a ciphertext , where
- : The decryption algorithm returns . It outputs plaintext correctly if the size of noise e is bounded asSince , , thus .
2.2.3. Torus LWE(TLWE)
2.2.4. TGSW
2.3. Overview of TFHE Bootstrapping
Algorithm 1: TFHE bootstrapping [6] for binary arithmetics. |
Input: An LWE sample
whose plaintext , a constant , a bootstrapping key , and a keyswitching key , where . Output: An LWE sample , where . 1 , 2 , for each 3 testv 4 5 for to n do // 6 // , 7 return |
2.3.1. Input
2.3.2. Rounding
2.3.3. BlindRotate
2.3.4. Extract
2.3.5. KeySwitch
Algorithm 2: KeySwitch. |
2.4. Integer-Wise LWE Encryption
- : On a input security parameter , and are fixed; a secret key is output.
- : A uniformly random vector and a noise are sampled, where is a Gaussian distribution over with a standard deviation . A ciphertext is output, where
- : The decryption algorithm returns . The decryption works correctly if the size noise is small enough, i.e.,Since and holds from (7).
3. Integer-Wise General Functional Bootstrapping
- We present our general bootstrapping in Algorithm 3 of Section 3.1, which is built upon the integer-wise LWE encryption Section 2.4.
- Our key technique to construct the general bootstrapping is generalizing the setting of the coefficients of the test vector, which is used in the BlindRotate part of the bootstrapping procedure, in Algorithm 4.
- We also discuss the possible security issue that arose after our modification in Section 3.2.
3.1. General Functional Bootstrapping
Algorithm 3: General functional bootstrapping. |
Input: A ciphertext An LWE sample , such that its plaintext , a bootstrapping key , a keyswitching key , where , a constant function , and a set of coefficients of the test vector that. corresponds to the function f Output: An LWE sample , where 1 , for each 2 Set the test vector as 3 4 for to n do 5 6 return |
3.1.1. Input
3.1.2. Rounding (Line 1)
3.1.3. BlindRotate (Line 3 to Line 4)
- When , we have and . Thus, the constant term of the polynomialWe define the value of all elements as . Note that, since , we now have or, equivalently, . Similar to this case, when , the constant term of the polynomial is in , …, , , , …, . The elements of this set are the sign inversions of the elements of the set . Therefore, are already defined as .
- When , we have . From (11), we have < << < N. Thus, we obtain and the constant term of the polynomial is inWe define the value of all as . Similarly, when , we have < < < < . Thus, ,…, , and the constant term of the polynomial is in , …, . These values are the sign inversions of the previously defined for .
Algorithm 4: Our setting of the test vector coefficients defined in (9). |
3.1.4. Extract (Line 5)
3.1.5. KeySwitch (Line 7)
3.2. Security
4. Applications
- : Homomorphic evaluation of the sign function over a ciphertext (Algorithm 5)
- : Homomorphic evaluation of the equality test (Algorithm 6)
- : Homomorphic evaluation of the equality test with a plaintext (Algorithm 7)
- : Homomorphic evaluation of multiplication by a binary number (Algorithm 8)
- : Homomorphic evaluation of division by a plaintext (Algorithm 9)
- : Homomorphic evaluation of division (Algorithm 10)
Algorithm 5:: Homomorphic sign evaluation in our bootstrapping scheme. |
Input: A ciphertext , where . Output: , where 1 return , where if , 0 if . |
Algorithm 6:: Equality test. |
Input: Two ciphertexts and , where . Output: , where 1 return , where if , otherwise. |
Algorithm 7:: Equality test with a constant |
Input: A ciphertext and plaintext , where . Output: , where 1 Encode to . 2 return , where if , otherwise. |
4.1. Homomorphic Evaluation of the Sign Function:
Algorithm 8:: Homomorphic multiplication by binary number |
Input: Ciphertexts , where , . Output: 1 // 2 return // |
Algorithm 9:: Homomorphic division by a constant |
Input: A ciphertext , where , and a constant plaintext . Output: 1 return |
Algorithm 10:: Homomorphic division. |
4.2. Homomorphic Equality Test: and
4.3. Homomorphic Multiplication by a Binary Number:
- If is a ciphertext of 0 (which means ), then is (ciphertext of the constant ). Thus, the phase of is rotated to a position symmetrical about the origin, as illustrated in Figure 4 by the dashed arrow in the left image. Then, the phase of the ciphertext is rotated to a position symmetrical about the x-axis. After bootstrapping with , becomes a ciphertext of .
- If is a ciphertext of (which means ), then is (ciphertext of 0). Thus, remains a ciphertext of .
- if (which means ), the message of in line 1 is , and the output becomes because for all while .
- If (which means ), in line 1, the message of is and the output is .
4.4. Homomorphic Division by a Constant:
4.5. Homomorphic Division:
Generalization to a Two-Variable Function:
5. Results of Homomorphic Division
- The degree of the polynomials in the ring: .
- The dimensions of the LWE and TLWE: and .
- Decomposition basis and length of TGSWciphertexts: and .
- Decomposition basis and length of KeySwitch: and .
- Standard deviation of the noise of the key-switching keys KS: .
- Standard deviation of the noise of the bootstrapping keys BK: .
Algorithm 11:: Homomorphic evaluation of a 2-variable function |
Limitations of Correctness
6. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Gentry, C. A Fully Homomorphic Encryption Scheme. Ph.D. Thesis, Stanford University, Stanford, CA, USA, 2009. [Google Scholar]
- Gentry, C. Fully Homomorphic Encryption Using Ideal Lattices. In STOC 2009; ACM: New York, NY, USA, 2009; pp. 169–178. [Google Scholar] [CrossRef] [Green Version]
- Brakerski, Z.; Vaikuntanathan, V. Efficient Fully Homomorphic Encryption from (Standard) LWE. In FOCS 2011; IEEE: Piscataway, NJ, USA, 2011; pp. 97–106. [Google Scholar] [CrossRef] [Green Version]
- Brakerski, Z.; Vaikuntanathan, V. Fully Homomorphic Encryption from Ring-LWE and Security for Key Dependent Messages. In CRYPTO 2011; Rogaway, P., Ed.; Springer: Berlin/Heidelberg, Germany, 2011; pp. 505–524. [Google Scholar] [CrossRef] [Green Version]
- Brakerski, Z.; Vaikuntanathan, V. Lattice-based FHE As Secure As PKE. In ITCS 2014; ACM: New York, NY, USA, 2014; pp. 1–12. [Google Scholar] [CrossRef] [Green Version]
- Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. Faster Fully Homomorphic Encryption: Bootstrapping in Less Than 0.1 Seconds. In ASIACRYPT 2016; Cheon, J.H., Takagi, T., Eds.; Springer: Berlin/Heidelberg, Germany, 2016; pp. 3–33. [Google Scholar] [CrossRef]
- Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. Faster Packed Homomorphic Operations and Efficient Circuit Bootstrapping for TFHE. In ASIACRYPT 2017; Takagi, T., Peyrin, T., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 377–408. [Google Scholar] [CrossRef]
- Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. TFHE: Fast Fully Homomorphic Encryption Over the Torus. J. Cryptol. 2020, 33, 34–91. [Google Scholar] [CrossRef]
- Gentry, C.; Halevi, S.; Smart, N.P. Homomorphic Evaluation of the AES Circuit. In CRYPTO 2012; Safavi-Naini, R., Canetti, R., Eds.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 850–867. [Google Scholar] [CrossRef] [Green Version]
- Gentry, C.; Sahai, A.; Waters, B. Homomorphic Encryption from Learning with Errors: Conceptually-Simpler, Asymptotically-Faster, Attribute-Based. In CRYPTO 2013; Canetti, R., Garay, J.A., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; pp. 75–92. [Google Scholar] [CrossRef] [Green Version]
- Smart, N.P.; Vercauteren, F. Fully Homomorphic Encryption with Relatively Small Key and Ciphertext Sizes. In PKC 2010; Nguyen, P.Q., Pointcheval, D., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 420–443. [Google Scholar] [CrossRef] [Green Version]
- Stehlé, D.; Steinfeld, R. Faster Fully Homomorphic Encryption. In ASIACRYPT 2010; Abe, M., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 377–394. [Google Scholar] [CrossRef] [Green Version]
- van Dijk, M.; Gentry, C.; Halevi, S.; Vaikuntanathan, V. Fully Homomorphic Encryption over the Integers. In EUROCRYPT 2010; Gilbert, H., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 24–43. [Google Scholar] [CrossRef] [Green Version]
- Bourse, F.; Minelli, M.; Minihold, M.; Paillier, P. Fast Homomorphic Evaluation of Deep Discretized Neural Networks. In CRYPTO 2018; Shacham, H., Boldyreva, A., Eds.; Springer International Publishing: Cham, Switzerland, 2018; pp. 483–512. [Google Scholar] [CrossRef] [Green Version]
- Gilad-Bachrach, R.; Dowlin, N.; Laine, K.; Lauter, K.; Naehrig, M.; Wernsing, J. CryptoNets: Applying Neural Networks to Encrypted Data with High Throughput and Accuracy. In Proceedings of the 33rd International Conference on Machine Learning, New York, NY, USA, 19–24 June 2016; Volume 48, pp. 201–210. [Google Scholar] [CrossRef]
- Chen, J.; Feng, Y.; Liu, Y.; Wu, W. Faster Binary Arithmetic Operations on Encrypted Integers. In WCSE 2017; SCIEI: Hong Kong, China, 2017; pp. 956–960. [Google Scholar] [CrossRef]
- Chen, Y.; Gong, G. Integer arithmetic over ciphertext and homomorphic data aggregation. In Proceedings of the IEEE Conference on Communications and Network Security (CNS), Florence, Italy, 28–30 September 2015; pp. 628–632. [Google Scholar] [CrossRef]
- Xu, C.; Chen, J.; Wu, W.; Feng, Y. Homomorphically Encrypted Arithmetic Operations Over the Integer Ring. In ISPEC 2016; Bao, F., Chen, L., Deng, R.H., Wang, G., Eds.; Springer: Berlin/Heidelberg, Germany, 2016; pp. 167–181. [Google Scholar] [CrossRef]
- Çetin, G.S.; Doröz, Y.; Sunar, B.; Savaş, E. Depth Optimized Efficient Homomorphic Sorting. In LATINCRYPT 2015; Lauter, K., Rodríguez-Henríquez, F., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 61–80. [Google Scholar] [CrossRef] [Green Version]
- Bost, R.; Popa, R.A.; Tu, S.; Goldwasser, S. Machine Learning Classification over Encrypted Data. In Proceedings of the Network and Distributed System Security (NDSS) Symposium, San Diego, CA, USA, 8–11 February 2015. [Google Scholar] [CrossRef] [Green Version]
- Juvekar, C.; Vaikuntanathan, V.; Chandrakasan, A. GAZELLE: A Low Latency Framework for Secure Neural Network Inference. In USENIX Security 2018; USENIX Association: Baltimore, MD, USA, 2018; pp. 1651–1669. [Google Scholar]
- Narumanchi, H.; Goyal, D.; Emmadi, N.; Gauravaram, P. Performance Analysis of Sorting of FHE Data: Integer-Wise Comparison. In AINA 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 902–908. [Google Scholar] [CrossRef]
- Okada, H.; Cid, C.; Hidano, S.; Kiyomoto, S. Linear Depth Integer-Wise Homomorphic Division. In WISTP 2018; Blazy, O., Yeun, C.Y., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 91–106. [Google Scholar] [CrossRef]
- Halevi, S.; Shoup, V. HElib—An Implementation of Homomorphic Encryption. 2019. Available online: https://github.com/shaih/HElib/ (accessed on 26 July 2020).
- Cheon, J.H.; Han, K.; Kim, A.; Kim, M.; Song, Y. Bootstrapping for Approximate Homomorphic Encryption. In EUROCRYPT 2018; Nielsen, J.B., Rijmen, V., Eds.; Springer International Publishing: Cham, Switzerland, 2018; pp. 360–384. [Google Scholar] [CrossRef]
- New Jersey Institute of Technology. PALISADE. 2019. Available online: https://git.njit.edu/palisade/PALISADE (accessed on 26 July 2020).
- Chen, H.; Dai, W.; Kannepalli, S.; Khanpour, H.; Laine, K.; Lauter, K.; Singh, T.; Song, Y.; Tieman, J. Microsoft SEAL: Fast and Easy-to-Use Homomorphic Encryption Library. 2019. Available online: https://www.microsoft.com/en-us/research/project/microsoftseal/ (accessed on 26 July 2020).
- Ducas, L.; Micciancio, D. FHEW: Bootstrapping Homomorphic Encryption in Less Than a Second. In EUROCRYPT 2015; Oswald, E., Fischlin, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 617–640. [Google Scholar] [CrossRef] [Green Version]
- Regev, O. On Lattices, Learning with Errors, Random Linear Codes, and Cryptography. In STOC ’05; ACM: New York, NY, USA, 2005; pp. 84–93. [Google Scholar] [CrossRef]
- Cheon, J.H.; Stehlé, D. Fully Homomophic Encryption over the Integers Revisited. In EUROCRYPT 2015; Oswald, E., Fischlin, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 513–536. [Google Scholar] [CrossRef] [Green Version]
- Brakerski, Z.; Gentry, C.; Vaikuntanathan, V. (Leveled) Fully Homomorphic EncryptionWithout Bootstrapping. In ITCS 2012; ACM: New York, NY, USA, 2012; pp. 309–325. [Google Scholar] [CrossRef] [Green Version]
- Lyubashevsky, V.; Peikert, C.; Regev, O. On Ideal Lattices and Learning with Errors over Rings. In EUROCRYPT 2010; Gilbert, H., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 1–23. [Google Scholar] [CrossRef]
- Carpov, S.; Chillotti, I.; Gama, N.; Georgieva, M.; Izabachene, M. TFHE: Fast Fully Homomorphic Encryption over the Torus. 2019. Available online: https://tfhe.github.io/tfhe/ (accessed on 26 July 2020).
- Bourse, F.; Sanders, O.; Traoré, J. Improved Secure Integer Comparison via Homomorphic Encryption. In EUROCRYPT 2020; Jarecki, S., Ed.; Springer International Publishing: Cham, Switzerland, 2020; pp. 391–416. [Google Scholar] [CrossRef]
- Çetin, G.S.; Doröz, Y.; Sunar, B.; Martin, W.J.; Arithmetic Using Word-wise Homomorphic Encryption. Cryptology ePrint Archive, Report 2015/1195. 2015. Available online: https://eprint.iacr.org/2015/1195 (accessed on 26 July 2020).
- Okada, H.; Kiyomoto, S.; Cid, C. Integerwise Functional Bootstrapping on TFHE. In Information Security; Susilo, W., Deng, R.H., Guo, F., Li, Y., Intan, R., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 107–125. [Google Scholar] [CrossRef]
Ctxt | Ptxt | Noise (or Its Bound) | |
---|---|---|---|
Method | FHE lib. | Type | Bits (l) | Time [sec] | Complexity | Security |
---|---|---|---|---|---|---|
[17] | HElib | Bit-wise | 4 | 67.94 | >128 | |
[18] | HElib | Bit-wise | 4 | 14.63 | >128 | |
[16] | HElib | Bit-wise | 4 | 7.74 | >80 | |
[23] | HElib | Integer-wise | 4 | 3.15 | >80 | |
Ours (Div) | TFHE | Integer-wise | 4 | 0.93 | >128 | |
NRD | TFHE | Bit-wise | 4 | 2.05 | >128 |
Functions | # of Bootstrap | Time [msec] | # of Calls | Mean [msec] |
---|---|---|---|---|
(line 5) | 2 | 346.0 (37.2%) | 21.6 | |
(line 4) | 1 | 174.8 (18.8%) | 10.9 | |
(line 3) | 1 | 175.8 (18.9%) | 11.0 | |
(line 5) | 1 | 173.9 (18.7%) | 10.9 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Okada, H.; Kiyomoto, S.; Cid, C. Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics. Information 2021, 12, 297. https://doi.org/10.3390/info12080297
Okada H, Kiyomoto S, Cid C. Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics. Information. 2021; 12(8):297. https://doi.org/10.3390/info12080297
Chicago/Turabian StyleOkada, Hiroki, Shinsaku Kiyomoto, and Carlos Cid. 2021. "Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics" Information 12, no. 8: 297. https://doi.org/10.3390/info12080297
APA StyleOkada, H., Kiyomoto, S., & Cid, C. (2021). Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics. Information, 12(8), 297. https://doi.org/10.3390/info12080297