Abstract
Approximated homomorphic encryption (HE) schemes such as CKKS are commonly used to perform computations over encrypted real numbers. It is commonly assumed that these schemes are not “exact” and thus they cannot execute circuits with unbounded depth over discrete sets, such as binary or integer numbers, without error overflows. These circuits are usually executed using BGV and B/FV for integers and TFHE for binary numbers. This artificial separation can cause users to favor one scheme over another for a given computation, without even exploring other, perhaps better, options. We show that by treating step functions as “clean-up” utilities and by leveraging the SIMD capabilities of CKKS, we can extend the homomorphic encryption toolbox with efficient tools. These tools use CKKS to run unbounded circuits that operate over binary and small-integer elements and even combine these circuits with fixed-point real numbers circuits. We demonstrate the results using the Turing-complete Conway’s Game of Life. In our evaluation, for boards of size 256\(\times \)256, these tools achieved orders of magnitude faster latency than previous implementations using other HE schemes. We argue and demonstrate that for large enough real-world inputs, performing binary circuits over CKKS, while considering it as an “exact” scheme, results in comparable or even better performance than using other schemes tailored for similar inputs.















Similar content being viewed by others
Notes
Theorem 6 exists in the peer-reviewed paper in Appendix D but not in the ePrint version.
References
L. Adam, BoringSSL (2015), https://www.imperialviolet.org/2015/10/17/boringssl.html
E. Aharoni, A. Adir, M. Baruch, N. Drucker, G. Ezov, A. Farkash, L. Greenberg, R. Masalha, G. Moshkowich, D. Murik, H. Shaul, O. Soceanu, HeLayers: a tile tensors framework for large neural networks on encrypted data. PoPETs (2023), https://doi.org/10.56553/popets-2023-0020
A. Akavia, M. Vald, On the privacy of protocols based on cpa-secure homomorphic encryption. IACR Cryptol. ePrint Arch. 2021, 803 (2021), https://eprint.iacr.org/2021/803
S. Arita, S. Nakasato, Fully homomorphic encryption for point numbers, in Chen, K., Lin, D., Yung, M. (eds.) Information Security and Cryptology. pp. 253–270. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-54705-3_16
A.A. Badawi, J. Bates, F. Bergamaschi, D.B. Cousins, S. Erabelli, N. Genise, S. Halevi, H. Hunt, A. Kim, Y. Lee, Z. Liu, D. Micciancio, I. Quah, Y. Polyakov, S. Rv, K. Rohloff, J. Saylor, D. Suponitsky, M. Triplett, V. Vaikuntanathan, V. Zucca, OpenFHE: Open-Source Fully Homomorphic Encryption Library. Cryptology ePrint Archive, Paper 2022/915 (2022), https://eprint.iacr.org/2022/915
Y. Bae, J.H. Cheon, W. Cho, J. Kim, T. Kim, META-BTS: Bootstrapping Precision Beyond the Limit. Cryptology ePrint Archive, Paper 2022/1167 (2022), https://eprint.iacr.org/2022/1167
F. Boemer, R. Cammarota, D. Demmler, T. Schneider, H. Yalame, MP2ML: A mixed-protocol machine learning framework for private inference. in Proceedings of the 2020 Workshop on Privacy-Preserving Machine Learning in Practice. pp. 43-45. PPMLP’20, Association for Computing Machinery, New York, NY, USA (2020). https://doi.org/10.1145/3411501.3419425
F. Boemer, A. Costache, R. Cammarota, C. Wierzynski, NGraph-HE2: a high-throughput framework for neural network inference on encrypted data. in Proceedings of the 7th ACM workshop on encrypted computing and applied homomorphic cryptography. pp. 45–56. WAHC’19, Association for Computing Machinery, New York, NY, USA (2019). https://doi.org/10.1145/3338469.3358944
J.P. Bossuat, C. Mouchet, J. Troncoso-Pastoriza, J.P. Hubaux, Efficient bootstrapping for approximate homomorphic encryption with non-sparse keys. in Canteaut, A., Standaert, F.X. (eds.) Advances in Cryptology—EUROCRYPT 2021. pp. 587–617. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-77870-5_21
C. Boura, N. Gama, M. Georgieva, D. Jetchev, CHIMERA: combining ring-LWE-based fully homomorphic encryption schemes. J. Math. Cryptol. 14(1), 316–338 (2020). https://doi.org/10.1515/jmc-2019-0026
Z. Brakerski, Fully Homomorphic Encryption without Modulus Switching from Classical GapSVP. in Safavi-Naini, R., Canetti, R. (eds.) Advances in Cryptology—CRYPTO 2012. vol. 7417 LNCS, pp. 868–886. Springer, Berlin (2012). https://doi.org/10.1007/978-3-642-32009-5_50
Z. Brakerski, C. Gentry, V. Vaikuntanathan, (Leveled) fully homomorphic encryption without bootstrapping. ACM Trans. Comput. Theory 6(3) (2014). https://doi.org/10.1145/2633600
H. Chen, I. Chillotti, Y. Song, Improved bootstrapping for approximate homomorphic encryption. in Y. Ishai, V. Rijmen (eds.) Advances in Cryptology—EUROCRYPT 2019. pp. 34–54. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-17656-3_2
H. Chen, K. Han, Homomorphic lower digits removal and improved FHE bootstrapping. in J.B. Nielsen, V. Rijmen (eds.) Advances in Cryptology—EUROCRYPT 2018. pp. 315–337. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-78381-9_12
J. Cheon, A. Kim, M. Kim, Y. Song, Homomorphic encryption for arithmetic of approximate numbers. in Proceedings of Advances in Cryptology—ASIACRYPT 2017. pp. 409–437. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-70694-8_15
J.H. Cheon, D. Kim, D. Kim, Efficient homomorphic comparison methods with optimal complexity. in International Conference on the Theory and Application of Cryptology and Information Security. pp. 221–256. Springer (2020). https://doi.org/10.1007/978-3-030-64834-3_8
I. Chillotti, N. Gama, M. Georgieva, M. Izabachène, Faster fully homomorphic encryption: bootstrapping in less than 0.1 seconds. in Cheon, J.H., Takagi, T. (eds.) Advances in Cryptology—ASIACRYPT 2016. pp. 3–33. Springer, Berlin (2016). https://doi.org/10.1007/978-3-662-53887-6_1
I. Chillotti, N. Gama, M. Georgieva, M. Izabachène, TFHE: fast fully homomorphic encryption over the torus. J. Cryptol. 33(1), 34–91 (2020). https://doi.org/10.1007/s00145-019-09319-x
I. Chillotti, M. Joye, D. Ligier, J.B. Orfila, S. Tap, CONCRETE: concrete Operates oN Ciphertexts rapidly by extending TfhE. in WAHC 2020–8th Workshop on Encrypted Computing & Applied Homomorphic Cryptography. vol. 15 (2020)
A. Costache, B.R. Curtis, E. Hales, S. Murphy, T. Ogilvie, R. Player, On the precision loss in approximate homomorphic encryption. Cryptology ePrint Archive, Paper 2022/162 (2022), https://eprint.iacr.org/2022/162
CryptoLab: HEaaN: Homomorphic Encryption for Arithmetic of Approximate Numbers, version 0.2.0 (2022), https://www.cryptolab.co.kr/eng/product/heaan.php
Cryptolab: Heaan, crypto lab’s great homomorphic encryption library, manual. Last accessed 07/09/2023 (2023), https://heaan.it/docs/heaan/namespacemembers_vars.html
L. Ducas, D. Stehlé, Sanitization of fhe ciphertexts. In: Fischlin, M., Coron, J.S. (eds.) Advances in Cryptology—EUROCRYPT 2016. pp. 294–310. Springer, Berlin (2016). https://doi.org/10.1007/978-3-662-49890-3_12
J. Fan, F. Vercauteren, Somewhat practical fully homomorphic encryption. in Proceedings of the 15th International Conference on Practice and Theory in Public Key Cryptography pp. 1–16 (2012), https://eprint.iacr.org/2012/144
M. Florent, Game of life using fully homomorphic encryption commit 04b7deebd9b96b2701c13e2d08c141b84f1c8479 (2022), https://github.com/FlorentCLMichel/homomorphic_game_of_life
M. Gardner, The fantastic combinations of John Conway’s new solitaire game “life” (Oct 1970), https://www.scientificamerican.com/article/mathematical-games-1970-10/
C. Gentry, A Fully Homomorphic Encryption Scheme. Ph.D. thesis, Stanford University (2009), https://crypto.stanford.edu/craig
C. Gentry, S. Halevi, N.P. Smart, Better bootstrapping in fully homomorphic encryption. in International Workshop on Public Key Cryptography. pp. 1–16. Springer (2012). https://doi.org/10.1007/978-3-642-30057-8_1
R. Gilad-Bachrach, N. Dowlin, K. Laine, K. Lauter, M. Naehrig, J. Wernsing, Cryptonets: applying neural networks to encrypted data with high throughput and accuracy. in International Conference on Machine Learning. pp. 201–210 (2016), http://proceedings.mlr.press/v48/gilad-bachrach16.pdf
S. Halevi, V. Shoup, Bootstrapping for HElib. in: Oswald, E., Fischlin, M. (eds.) Advances in Cryptology—EUROCRYPT 2015. pp. 641–670. Springer, Berlin (2015). https://doi.org/10.1007/978-3-662-46800-5_25
K. Han, D. Ki, Better bootstrapping for approximate homomorphic encryption. in Cryptographers’ Track at the RSA Conference. pp. 364–390. Springer (2020)
X. Jiang, M. Kim, K. Lauter, Y. Song, Secure outsourced matrix computation and application to neural networks. in Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. pp. 1209–1222. CCS ’18, New York, NY, USA (2018). https://doi.org/10.1145/3243734.3243837
C.S. Jutla, N. Manohar, Sine series approximation of the mod function for bootstrapping of approximate HE. In: Dunkelman, O., Dziembowski, S. (eds.) Advances in Cryptology—EUROCRYPT 2022. pp. 491–520. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-06944-4_17
C. Juvekar, V. Vaikuntanathan, A. Chandrakasan, GAZELLE: a low latency framework for secure neural network inference. In: 27th USENIX Security Symposium (USENIX Security 18). pp. 1651–1669. USENIX Association, Baltimore, MD (2018), https://www.usenix.org/conference/usenixsecurity18/presentation/juvekar
A. Kim, A. Papadimitriou, Y. Polyakov, Approximate homomorphic encryption with reduced approximation error. in Cryptographers’ Track at the RSA Conference, pp. 120–144. Springer (2022). https://doi.org/10.1007/978-3-030-95312-6_6
E. Lee, J.W. Lee, Y.S. Kim, J.S. No, Minimax approximation of sign function by composite polynomial for homomorphic comparison. IEEE Trans. Depend. Secure Comput. (2021). https://doi.org/10.1109/TDSC.2021.3105111
J. Lee, E. Lee, J.W. Lee, Y. Kim, Y.S. Kim, J.S. No, Precise approximation of convolutional neural networks for homomorphically encrypted data. arXiv preprint arXiv:2105.10879 (2021)
Y. Lee, J.W. Lee, Y.S. Kim, Y. Kim, J.S. No, H. Kang, High-precision bootstrapping for approximate homomorphic encryption by error variance minimization. in Dunkelman, O., Dziembowski, S. (eds.) Advances in Cryptology—EUROCRYPT 2022. pp. 551–580. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-06944-4_19
R. Lehmkuhl, P. Mishra, A. Srinivasan, R.A. Popa, Muse: secure inference resilient to malicious clients. in 30th USENIX Security Symposium (USENIX Security 21). pp. 2201–2218. USENIX Association (2021), https://www.usenix.org/conference/usenixsecurity21/presentation/lehmkuhl
B. Li, D. Micciancio, On the security of homomorphic encryption on approximate numbers. in Canteaut, A., Standaert, F.X. (eds.) Advances in Cryptology—EUROCRYPT 2021. pp. 648–677. Springer, Cham (2021)
J. Liu, M. Juuti, Y. Lu, N. Asokan, Oblivious neural network predictions via MiniONN transformations. in Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security. pp. 619–631. CCS ’17, Association for Computing Machinery, New York, NY, USA (2017). https://doi.org/10.1145/3133956.3134056
Q. Lou, L. Jiang, HEMET: a homomorphic-encryption-friendly privacy-preserving mobile neural network architecture. in Meila, M., Zhang, T. (eds.) Proceedings of the 38th International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 139, pp. 7102–7110 (2021), https://proceedings.mlr.press/v139/lou21a.html
W.J. Lu, Z. Huang, C. Hong, Y. Ma, H. Qu, PEGASUS: bridging polynomial and non-polynomial evaluations in homomorphic encryption. in 2021 IEEE Symposium on Security and Privacy (SP). pp. 1057–1073 (2021). https://doi.org/10.1109/SP40001.2021.00043
D. Micciancio, Y. Polyakov, Bootstrapping in FHEW-like cryptosystems. in Proceedings of the 9th on Workshop on Encrypted Computing and Applied Homomorphic Cryptography. p. 17-28. WAHC ’21, Association for Computing Machinery, New York, NY, USA (2021). https://doi.org/10.1145/3474366.3486924
F. Michel, J. Wilson, E. Cottle, Concrete Boolean and Conway’s Game of Life: A Tutorial (2021), https://medium.com/zama-ai/concrete-boolean-and-conways-game-of-life-a-tutorial-f2bcfd614131
F. Michel, J. Wilson, E. Cottle, Fully homomorphic encryption and the game of life (2021), https://medium.com/optalysys/fully-homomorphic-encryption-and-the-game-of-life-d7c37d74bbaf
P. Mishra, R. Lehmkuhl, A. Srinivasan, W. Zheng, R.A. Popa, Delphi: a cryptographic inference service for neural networks. in 29th USENIX Security Symposium (USENIX Security 20). pp. 2505–2522. USENIX Association (aug 2020). https://doi.org/10.1145/3411501.3419418, https://www.usenix.org/conference/usenixsecurity20/presentation/mishra
P. Mohassel, P. Rindal, ABY3: A mixed protocol framework for machine learning. in Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. pp. 35–52. CCS ’18, Association for Computing Machinery, New York, NY, USA (2018). https://doi.org/10.1145/3243734.3243760
P. Mohassel, Y. Zhang, M.L. Secure, A system for scalable privacy-preserving machine learning. in 2017 IEEE Symposium on Security and Privacy (SP). pp. 19–38 (2017). https://doi.org/10.1109/SP.2017.12
D. Rathee, M. Rathee, N. Kumar, N. Chandran, D. Gupta, A. Rastogi, R. Sharma, CrypTFlow2: practical 2-party secure inference. in Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pp. 325–342. Association for Computing Machinery, New York, NY, USA (2020), https://doi.org/10.1145/3372297.3417274
P. Rendell, Turing Universality of the Game of Life, pp. 513–539. Springer, London (2002). https://doi.org/10.1007/978-1-4471-0129-1_18
E. Rescorla, The Transport Layer Security (TLS) Protocol Version 1.3. RFC 8446 (aug 2018). https://doi.org/10.17487/RFC8446
E. Rescorla, T. Dierks, The Transport Layer Security (TLS) Protocol Version 1.2. RFC 5246 (2008). https://doi.org/10.17487/RFC5246
M.S. Riazi, M. Samragh, H. Chen, K. Laine, K. Lauter, F. Koushanfar, XONN: XNOR-based oblivious deep neural network inference. in 28th USENIX Security Symposium (USENIX Security 19). pp. 1501–1518. USENIX Association, Santa Clara, CA (2019), https://www.usenix.org/conference/usenixsecurity19/presentation/riazi
Zama: fhe_game_of_life commit 6d15153ac234482f8b70841e5151a1a98cfc2775 (2022), https://github.com/zama-ai/fhe_game_of_life
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by David Pointcheval and Nigel Smart
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This paper was reviewed by Jean-Philippe Bossuat, Jeongeun Park and an anonymous reviewer.
Appendix A: CKKS Experiment Parameters
Appendix A: CKKS Experiment Parameters
We considered the following sets of parameters for the different experiments.
-
Gates Evaluation we used HEaaN’s FGa parameters preset which uses ring dimension of \(2^{16}\), \(\log _2(PQ)=1,547\), Hamming weight of secret key of 192 bits, security level of 128, scale of 48 bits, initial multiplication depth of 9 and depth of 6 after bootstrapping. The modulus chain primes are
$$\begin{aligned}{} & {} {} \texttt {[ 0x7ffffffffcc0001}, \texttt {0x3ffffffd20001,} \texttt {0x3fffffcc0001,}\\{} & {} \quad \texttt {0x3fffffb20001,} \texttt { 0x3fffffa80001,}{} \texttt {0x3fffff960001,}\\{} & {} \quad \texttt {0x3fffff8e0001,} \texttt { 0x3fffff520001,} \texttt {0x3ffffec20001,} \\{} & {} \quad \texttt {0x3ffffeaa0001,} \texttt {0x7fffffff9840001,} \texttt {0x7ffffffff240001,}\\{} & {} \quad \texttt { 0x7fffffffe900001,} \texttt { 0x7fffffffe3c0001,} \texttt {0x7fffffffe240001,}\\{} & {} \quad \texttt { 0x7fffffffddc0001,} \texttt { 0x7fffffffd740001,} \texttt {0x7fffffffd640001,}\\{} & {} \quad \texttt { 0x7fffffffd080001,} \texttt { 0x7fffffffccc0001,} \texttt {0x7fffffffcbc0001,}\\{} & {} \quad \texttt { 0x3fffffffffe80001,} \texttt {0x3fffffffffb80001,} \texttt {0x1fffffffffe00001,} \\{} & {} \quad \texttt {0x7fffffffb3c0001,} \texttt {0x7fffffffadc0001,} \texttt {0x7fffffffac40001,}\\{} & {} \quad \texttt {0xcccccccc433333]}.\\ \end{aligned}$$In this setup, bootstrapping takes 14 s and multiplying 2 ciphertexts (and then relinearizing and rescaling the result) takes less than 1 s.
-
Game of Life we used HEaaN’s parameters preset which uses ring dimension of \(2^{17}\), \(\log _2(PQ)=2,043\), Hamming weight of secret key of 192 bits, security level of 128, scale of 24 bits, initial multiplication depth of 29 and depth of 13 after bootstrapping. The modulus chain primes are
$$\begin{aligned}{} & {} \texttt {[0x1ffffffffc000001,} \texttt { 0x3ffffffff040001,} \texttt { 0x3fffffff000001,}\\{} & {} {} \texttt {0x3ffffffef40001,} \texttt { 0x3ffffffe800001, } \texttt { 0x3ffffffe080001,}\\{} & {} {} \texttt {0x3ffffffdcc0001, }{} \texttt { 0x3ffffffdb40001, } \texttt { 0x3ffffffd480001,}\\{} & {} {} \texttt {0x3ffffffcfc0001, }{} \texttt { 0x3ffffffc3c0001,} \texttt { 0x3ffffffbc40001,}\\{} & {} {} \texttt {0x3ffffffb580001, }{} \texttt { 0x3ffffffb340001,} \texttt { 0x1fffffffed440001,}\\{} & {} {} \texttt {0x1ffffffffb300001,}{} \texttt { 0x1ffffffffb1c0001, } \texttt { 0x1ffffffffadc0001,}\\{} & {} {} \texttt {0x1ffffffffa400001,}{} \texttt { 0x1ffffffffa140001,} \texttt { 0x1ffffffff9d80001,}\\{} & {} {} \texttt {0x1ffffffff9140001,}{} \texttt { 0x1ffffffff8ac0001,} \texttt { 0x1ffffffff8a80001,}\\{} & {} {} \texttt {0x1ffffffff81c0001, }{} \texttt { 0x1ffffffff7800001,} \texttt { 0x1fffffffef600001,}\\{} & {} {} \texttt {0x1fffffffffc0001,}{} \texttt { 0x1ffffffff8c0001, } \texttt { 0x1ffffffff840001,}\\{} & {} {} \texttt {0x1fffffffebac0001,}{} \texttt { 0x1fffffffeba40001,} \texttt { 0x1fffffffeb4c0001,}\\{} & {} {} \texttt {0x1fffffffeb280001,}{} \texttt { 0x1fffffffea780001, } \texttt { 0x1fffffffea440001,}\\{} & {} {} \texttt {0x1fffffffe9f40001,}{} \texttt { 0x1fffffffe97c0001, }{} \texttt { 0x1fffffffe9300001,} \\{} & {} {} \texttt {0x1fffffffe8d00001].} \\ \end{aligned}$$In this setup bootstrapping takes 14 s and multiplying 2 ciphertexts (and then relinearizing and rescaling the result) takes less than 1 s.
-
Decompose Integers we used HEaaN’s parameters preset which uses ring dimension of \(2^{17}\), \(\log _2(PQ)=2,043\), Hamming weight of secret key of 192 bits, security level of 128, scale of 24 bits, initial multiplication depth of 29 and depth of 13 after bootstrapping. The modulus chain primes are
$$\begin{aligned}{} & {} \texttt {[0x1ffffffffc000001,} \texttt { 0x7fffffc900001,} \texttt {0x7fffffe780001,}\\{} & {} \quad \texttt { 0x8000020240001,} \texttt { 0x7fffffe0c0001,} \texttt { 0x7fffff7400001,}\\{} & {} \quad \texttt { 0x7fffff7f80001,} \texttt { 0x7fffff9000001,} \texttt { 0x8000010040001,}\\{} & {} \quad \texttt { 0x7fffffdc40001,} \texttt { 0x8000006e00001,} \texttt { 0x7fffffdb00001,}\\{} & {} \quad \texttt { 0x8000002200001,} \texttt { 0x8000004240001,} \texttt {0x7fffffddc0001,}\\{} & {} \quad \texttt { 0x8000003ec0001,} \texttt { 0x7fffffd880001,} \texttt { 0x7fffffcfc0001,}\\{} & {} \quad \texttt { 0x8000001d00001,} \texttt {0x8000000940001,} \texttt { 0x8000002480001,}\\{} & {} \quad \texttt { 0x7fffffe900001,} \texttt { 0x7ffffff080001,} \texttt { 0x7ffffff240001,}\\{} & {} \quad \texttt { 0x8000001600001,} \texttt { 0x7ffffff900001,} \texttt { 0x7ffffff9c0001,}\\{} & {} \quad \texttt { 0x8000000500001,} \texttt { 0x80000002c0001,} \texttt { 0x80000001c0001,}\\{} & {} \quad \texttt { 0x1fffffffd80001,} \texttt {0x1fffffff900001,} \texttt {0x1fffffff8c0001,}\\{} & {} \quad \texttt { 0x1fffffff200001,} \texttt {0x1ffffffe880001,} \texttt {0x1ffffffe1c0001,}\\{} & {} \quad \texttt { 0x1ffffffcfc0001,} \texttt {0x1ffffffb880001,} \texttt {0x1ffffffb100001,} \\{} & {} \quad \texttt { 0x1ffffff6000001].} \\ \end{aligned}$$In this setup bootstrapping takes 14 s and multiplying 2 ciphertexts (and then relinearizing and rescaling the result) takes less than 1 s.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Drucker, N., Moshkowich, G., Pelleg, T. et al. BLEACH: Cleaning Errors in Discrete Computations Over CKKS. J Cryptol 37, 3 (2024). https://doi.org/10.1007/s00145-023-09483-1
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s00145-023-09483-1