Skip to main content
Log in

Performance of hierarchical transforms in homomorphic encryption: a case study on logistic regression inference

Journal of Cryptographic Engineering Aims and scope Submit manuscript

Cite this article


Recent works challenged the number-theoretic transform (NTT) as the most efficient method for polynomial multiplication in GPU implementations of fully homomorphic encryption schemes such as CKKS and BFV. In particular, these works argue that the discrete galois transform (DGT) is a better candidate for this particular case. However, these claims were never rigorously validated, and only intuition was used to argue in favor of each transform. This work brings some light on the discussion by developing similar CUDA implementations of the CKKS cryptosystem, differing only in the underlying transform and related data structure. We ran several experiments and collected performance metrics in different contexts, ranging from the basic direct comparison between the transforms to measuring the impact of each one on the inference phase of the logistic regression algorithm. Our observations suggest that, despite some specific polynomial ring configurations, the DGT in a standalone implementation does not offer the same performances of the NTT. However, when we consider the entire cryptosystem, we noticed that the effects of the higher arithmetic density of the DGT on other parts of the implementation are substantial, implying a considerable performance improvement of up to \(15\%\) on the homomorphic multiplication. Furthermore, this speedup is consistent when we consider a more complex application, indicating that the DGT suits better the target architecture.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1


  1. Abramowitz, M., Stegun, I.A., Romer, R.H.: Handbook of mathematical functions with formulas, graphs, and mathematical tables (1988)

  2. Al Badawi, A., Veeravalli, B., Aung, K.M.M.: Efficient polynomial multiplication via modified discrete galois transform and negacyclic convolution. In: Future of Information and Communication Conference, pp. 666–682. Springer (2018)

  3. Albrecht, M.R., Player, R., Scott, S.: On the concrete hardness of learning with errors. J. Math. Cryptol. 9(3), 169–203 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  4. Alves, P.G.M.R., Ortiz, J.N., Aranha, D.F.: Faster homomorphic encryption over gpgpus via hierarchical DGT. IACR Cryptol. ePrint Arch. 2020, 861 (2020)

    MATH  Google Scholar 

  5. Badawi, A.A., Polyakov, Y., Aung, K.M.M., Veeravalli, B., Rohloff, K.: Implementation and performance evaluation of RNS variants of the BFV homomorphic encryption scheme. IEEE Trans. Emerg. Top. Comput. 9(2), 941–956 (2021).

    Article  Google Scholar 

  6. Badawi, A.A., Veeravalli, B., Mun, C.F., Aung, K.M.M.: High-performance FV somewhat homomorphic encryption on gpus: an implementation using CUDA. IACR Trans. Cryptogr. Hardw. Embed. Syst. 2, 70–95 (2018).

    Article  Google Scholar 

  7. Bailey, D.H.: FFTs in external or hierarchical memory. J. Supercomput. 4(1), 23–35 (1990)

    Article  Google Scholar 

  8. Bajard, J., Eynard, J., Hasan, M.A., Zucca, V.: A full RNS variant of FV like somewhat homomorphic encryption schemes. In: Avanzi, R., Heys, H.M. (Eds.) Selected Areas in Cryptography—SAC 2016—23rd International Conference, St. John’s, NL, Canada, August 10-12, 2016, Revised Selected Papers, Volume 10532 of Lecture Notes in Computer Science, pp. 423–442. Springer (2016)

  9. Bajard, J., Martins, P., Sousa, L., Zucca, V.: Improving the efficiency of SVM classification with FHE. IEEE Trans. Inf. Forensics Secur. 15, 1709–1722 (2020).

    Article  Google Scholar 

  10. Benaissa, A., Retiat, B., Cebere, B., Belfedhal, A.E.: Tenseal: a library for encrypted tensor operations using homomorphic encryption arXiv preprint. (2021).

  11. Bergamaschi, F., Halevi, S., Halevi, T.T., Hunt, H.: Homomorphic training of 30, 000 logistic regression models. In: Deng, R.H., Gauthier-Umaña, V., Ochoa, M., Yung, M. (eds.) Applied Cryptography and Network Security—17th International Conference, ACNS 2019, Bogota, Colombia, June 5–7, 2019, Proceedings. Lecture Notes in Computer Science, vol. 11464, pp. 592–611. Springer (2019)

  12. Bos, J.W., Lauter, K.E., Loftus, J., Naehrig, M.: Improved security for a ring-based fully homomorphic encryption scheme. In: Stam, M. (Ed.), Cryptography and Coding—14th IMA International Conference, IMACC 2013, Oxford, UK, December 17-19, 2013. Proceedings, Volume 8308 of Lecture Notes in Computer Science, pp. 45–64. Springer (2013)

  13. Brakerski, Z., Gentry, C., Vaikuntanathan, V.: Fully homomorphic encryption without bootstrapping. In: Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pp 309–325. (2012). Association for Computing Machinery, New York, NY, USA.

  14. Cheon, J.H., Han, K., Kim, A., Kim, M., Song, Y.: A full RNS variant of approximate homomorphic encryption. In: Cid, C., Jr, M.J.J. (Eds.) Selected Areas in Cryptography—SAC 2018—25th International Conference, Calgary, AB, Canada, August 15-17, 2018, Revised Selected Papers, Volume 11349 of Lecture Notes in Computer Science, pp. 347–368. Springer (2018)

  15. Chillotti, I., Gama, N., Georgieva, M., Izabachène, M.: Faster fully homomorphic encryption: bootstrapping in less than 0.1 seconds. In: Cheon, J.H., Takagi, T. (Eds.) Advances in Cryptology—ASIACRYPT 2016—22nd International Conference on the Theory and Application of Cryptology and Information Security, Hanoi, Vietnam, December 4-8, 2016, Proceedings, Part I, Volume 10031 of Lecture Notes in Computer Science, pp. 3–33 (2016)

  16. Chillotti, I., Joye, M., Paillier, P.: Programmable bootstrapping enables efficient homomorphic inference of deep neural networks. In: Dolev, S., Margalit, O., Pinkas, B., Schwarzmann, A.A. (eds.) Cyber Security Cryptography and Machine Learning—5th International Symposium, CSCML 2021, Be’er Sheva, Israel, July 8–9, 2021, Proceedings Lecture Notes in Computer Science, vol. 12716, pp. 1–19. Springer, Berlin (2021)

    Google Scholar 

  17. Cooley, J., Tukey, J.: An algorithm for the machine calculation of complex Fourier series. Math. Comput. 19(90), 297–301 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  18. Crandall, R.E.: Integer convolution via split-radix fast Galois transform. Center for Advanced Computation, Reed College (1999)

  19. Crawford, J.L.H., Gentry, C., Halevi, S., Platt, D., Shoup, V.: Doing real work with FHE: the case of logistic regression. In: Brenner, M., Rohloff, K. (Eds.) Proceedings of the 6th Workshop on Encrypted Computing & Applied Homomorphic Cryptography, WAHC@CCS 2018, Toronto, ON, Canada, October 19, 2018, pp. 1–12. ACM (2018)

  20. Dai, W., Doröz, Y., Polyakov, Y., Rohloff, K., Sajjadpour, H., Savaş, E., Sunar, B.: Implementation and evaluation of a lattice-based key-policy abe scheme. IEEE Trans. Inf. Forens. Secur. 13(5), 1169–1184 (2018).

    Article  Google Scholar 

  21. Dai, W., Sunar, B.: cuhe: a homomorphic encryption accelerator library. In: Pasalic, E., Knudsen, L.R. (eds.) Cryptography and Information Security in the Balkans, pp. 169–186. Springer, Cham (2016)

    Chapter  Google Scholar 

  22. Fan, J., Vercauteren, F.: Somewhat practical fully homomorphic encryption. IACR Cryptol. ePrint Arch. 2012, 144 (2012)

    Google Scholar 

  23. Feldmann, A., Samardzic, N., Krastev, A., Devadas, S., Dreslinski, R., Eldefrawy, K., Genise, N., Peikert, C., Sánchez, D.: F1: a fast and programmable accelerator for fully homomorphic encryption (extended version). CoRR abs/2109.05371. arxiv: org/abs/2109.05371 (2021)

  24. Gamal, T.E.: A public key cryptosystem and a signature scheme based on discrete logarithms. In: CRYPTO, Volume 196 of Lecture Notes in Computer Science, pp. 10–18. Springer (1984)

  25. Gentleman, W.M., Sande, G.: Fast fourier transforms: for fun and profit. In: Proceedings of the November 7-10, 1966, Fall Joint Computer Conference, AFIPS ’66 (Fall), New York, NY, USA, pp. 563–578. Association for Computing Machinery (1966)

  26. Gentry, C.: Fully homomorphic encryption using ideal lattices. In: Mitzenmacher, M. (Ed.) Proceedings of the 41st Annual ACM Symposium on Theory of Computing, STOC 2009, Bethesda, MD, USA, May 31--June 2, 2009, pp. 169–178. ACM (2009a)

  27. Gentry, C.: Fully homomorphic encryption using ideal lattices. In: Proceedings of the Forty-First Annual ACM Symposium on Theory of Computing, STOC ’09, New York, NY, USA, pp. 169–178. Association for Computing Machinery (2009b)

  28. Govindaraju, N.K., Lloyd, B., Dotsenko, Y., Smith, B., Manferdelli, J.: High performance discrete Fourier transforms on graphics processors. In: Proceedings of the ACM/IEEE Conference on High Performance Computing, SC 2008, November 15-21, 2008, Austin, Texas, USA, p. 2. IEEE/ACM (2008)

  29. Han, K., Hong, S., Cheon, J.H., Park, D.: Efficient logistic regression on large encrypted data. IACR Cryptol. ePrint Arch.: 662 (2018)

  30. Harvey, D.: Faster arithmetic for number-theoretic transforms. J. Symbol. Comput. 60, 113–119 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  31. Jung, W., Kim, S., Ahn, J.H., Cheon, J.H., Lee, Y.: Over 100x faster bootstrapping in fully homomorphic encryption through memory-centric optimization with gpus. Cryptology ePrint Archive, Report 2021/508. (2021)

  32. Kim, S., Jung, W., Park, J., Ahn, J.H.: Accelerating number theoretic transformations for bootstrappable homomorphic encryption on gpus. In: IISWC, pp. 264–275. IEEE (2020)

  33. Li, D The mnist database of handwritten digit images for machine learning research [best of the web]. IEEE Signal Process. Mag. 29(6), 141–142 (2012)

  34. López-Alt, A., Tromer, E., Vaikuntanathan, V.: On-the-fly multiparty computation on the cloud via multikey fully homomorphic encryption. In: Karloff, H.J., Pitassi, T. (Eds.) Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012, pp. 1219–1234. ACM (2012)

  35. Lyubashevsky, V., Micciancio, D., Peikert, C., Rosen, A.: SWIFFT: a modest proposal for FFT hashing. In: Nyberg, K. (ed.) Fast Software Encryption, Berlin, Heidelberg, pp. 54–72. Springer, Berlin (2008)

  36. NVIDIA. NVIDIA Nsight Systems. (2021). Accessed 13 Oct 2021

  37. Paillier, P.: Public-key cryptosystems based on composite degree residuosity classes. In: EUROCRYPT, Volume 1592 of Lecture Notes in Computer Science, pp. 223–238. Springer (1999)

  38. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., Chintala, S.: Pytorch: an imperative style, high-performance deep learning library. In: Wallach, H., Larochelle, H., Beygelzimer, A., d’ Alché-Buc, F., Fox, E., Garnett, R. (eds) Advances in Neural Information Processing Systems 32, 8024–8035. Curran Associates, Inc (2019)

  39. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., et al.: Scikit-learn: machine learning in python. J. Mach. Learn. Res. 12(Oct), 2825–2830 (2011)

  40. Pollard, J.M.: The fast Fourier transform in a finite field. Math. Comput. 25, 365–374 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  41. Rivest, R.L., Adleman, L., Dertouzos, M.L., et al.: On data banks and privacy homomorphisms. Found. Secur. Comput. 4(11), 169–180 (1978)

    MathSciNet  Google Scholar 

  42. Ruder, S.: An overview of gradient descent optimization algorithms. CoRR abs/1609.04747. (2016)

Download references


This work was supported in part by the Brazilian National Council for Scientific and Technological Development (CNPq), grants number 164489/2018-5 and 203175/2019-0; and the Brazilian Coordination for the Improvement of Higher Education Personnel Foundation (CAPES) grant number 1591123. We specially thank Google for GCP Research Credits Program under number 106101194491; the Concordium Blockchain Research Center at Aarhus University (COBRA), Denmark; and the European Research Council (ERC) under the European Unions’s Horizon 2020 research and innovation programme under grant agreement No. 803096 (SPEC).

Author information

Authors and Affiliations


Corresponding author

Correspondence to Pedro Geraldo M. R. Alves.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Results were partially obtained while visiting the Department of Computer Science at Aarhus University for 12 months.

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.

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Alves, P.G.M.R., Ortiz, J.N. & Aranha, D.F. Performance of hierarchical transforms in homomorphic encryption: a case study on logistic regression inference. J Cryptogr Eng 13, 295–310 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: