skip to main content
10.1145/3571786.3573017acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Generating Programs for Polynomial Multiplication with Correctness Assurance

Published:15 January 2023Publication History

ABSTRACT

Program-generation techniques prevail in domains that need high performance, such as linear algebra, image processing, and database. Yet, it is hard to generate high-performance programs with correctness assurance, and cryptography needs both. Masuda and Kameyama proposed a DSL-based framework for implementing a program generator, an analyzer, and a formula generator, and obtained an efficient and correct implementation of Number-Theoretic Transform (NTT) that is necessary for many cryptographic algorithms.

This paper advances their study in two ways. First, we develop a generation-and-analysis framework so that program generation is driven by program analysis. As a concrete result, we have found an optimization missed in previous studies. Second, we investigate whether the framework can be applied to other algorithms, including inverse NTT. By combining generated programs, we have obtained an efficient and correct implementation of polynomial multiplication, the key for several post-quantum cryptographic algorithms.

References

  1. Gorjan Alagic, David Cooper, Quynh Dang, Thinh Dang, John M. Kelsey, Jacob Lichtinger, Yi-Kai Liu, Carl A. Miller, Dustin Moody, Rene Peralta, Ray Perlner, Angela Robinson, Daniel Smith-Tone, and Daniel Apon. 2022. Status Report on the Third Round of the NIST Post-Quantum Cryptography Standardization Process. https://doi.org/10.6028/NIST.IR.8413 Google ScholarGoogle ScholarCross RefCross Ref
  2. Erdem Alkim, Léo Ducas, Thomas Pöppelmann, and Peter Schwabe. 2016. Post-quantum Key Exchange - A New Hope. In 25th USENIX Security Symposium, USENIX Security 16, Austin, TX, USA, August 10-12, 2016, Thorsten Holz and Stefan Savage (Eds.). USENIX Association, 327–343. https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/alkim Google ScholarGoogle Scholar
  3. José Bacelar Almeida, Manuel Barbosa, Gilles Barthe, Arthur Blot, Benjamin Grégoire, Vincent Laporte, Tiago Oliveira, Hugo Pacheco, Benedikt Schmidt, and Pierre-Yves Strub. 2017. Jasmin: High-Assurance and High-Speed Cryptography. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, CCS 2017, Dallas, TX, USA, October 30 - November 03, 2017, Bhavani Thuraisingham, David Evans, Tal Malkin, and Dongyan Xu (Eds.). ACM, 1807–1823. https://doi.org/10.1145/3133956.3134078 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Nada Amin and Tiark Rompf. 2017. LMS-Verify: abstraction without regret for verified systems programming. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017, Giuseppe Castagna and Andrew D. Gordon (Eds.). ACM, 859–873. https://doi.org/10.1145/3009837.3009867 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Roberto Avanzi, Joppe Bos, Léo Ducas, Eike Kiltz, Tancrède Lepoint, Vadim Lyubashevsky, John M. Schanck, Peter Schwabe, Gregor Seiler, and Damien Stehlé. 2021. CRYSTALS-Kyber Algorithm Specifications And Supporting Documentation (version 3.02). https://pq-crystals.org/kyber/data/kyber-specification-round3-20210804.pdf Google ScholarGoogle Scholar
  6. Paul Barrett. 1986. Implementing the Rivest Shamir and Adleman Public Key Encryption Algorithm on a Standard Digital Signal Processor. In Advances in Cryptology - CRYPTO ’86, Santa Barbara, California, USA, 1986, Proceedings, Andrew M. Odlyzko (Ed.) (Lecture Notes in Computer Science, Vol. 263). Springer, 311–323. https://doi.org/10.1007/3-540-47721-7_24 Google ScholarGoogle ScholarCross RefCross Ref
  7. Hanno Becker, Vincent Hwang, Matthias J. Kannwischer, Bo-Yin Yang, and Shang-Yi Yang. 2022. Neon NTT: Faster Dilithium, Kyber, and Saber on Cortex-A72 and Apple M1. IACR Trans. Cryptogr. Hardw. Embed. Syst., 2022, 1 (2022), 221–244. https://doi.org/10.46586/tches.v2022.i1.221-244 Google ScholarGoogle ScholarCross RefCross Ref
  8. Mojtaba Bisheh-Niasar, Reza Azarderakhsh, and Mehran Mozaffari Kermani. 2021. High-Speed NTT-based Polynomial Multiplication Accelerator for CRYSTALS-Kyber Post-Quantum Cryptography. IACR Cryptol. ePrint Arch., 563. https://eprint.iacr.org/2021/563 Google ScholarGoogle Scholar
  9. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. 2009. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program., 19, 5 (2009), 509–543. https://doi.org/10.1017/S0956796809007205 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Donald Donglong Chen, Nele Mentens, Frederik Vercauteren, Sujoy Sinha Roy, Ray C. C. Cheung, Derek Chi-Wai Pao, and Ingrid Verbauwhede. 2015. High-Speed Polynomial Multiplication Architecture for Ring-LWE and SHE Cryptosystems. IEEE Trans. Circuits Syst. I Regul. Pap., 62-I, 1 (2015), 157–166. https://doi.org/10.1109/TCSI.2014.2350431 Google ScholarGoogle ScholarCross RefCross Ref
  11. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms, 3rd Edition. MIT Press. isbn:978-0-262-03384-8 http://mitpress.mit.edu/books/introduction-algorithms Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Patrick Cousot and Radhia Cousot. 2010. A gentle introduction to formal verification of computer systems by abstract interpretation. In Logics and Languages for Reliability and Security, Javier Esparza, Bernd Spanfelner, and Orna Grumberg (Eds.) (NATO Science for Peace and Security Series - D: Information and Communication Security, Vol. 25). IOS Press, 1–29. https://doi.org/10.3233/978-1-60750-100-8-1 Google ScholarGoogle ScholarCross RefCross Ref
  13. Andres Erbsen, Jade Philipoom, Jason Gross, Robert Sloan, and Adam Chlipala. 2020. Simple High-Level Code For Cryptographic Arithmetic: With Proofs, Without Compromises. ACM SIGOPS Oper. Syst. Rev., 54, 1 (2020), 23–30. https://doi.org/10.1145/3421473.3421477 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Arie Gurfinkel, Temesghen Kahsai, and Jorge A. Navas. 2015. SeaHorn: A Framework for Verifying C Programs (Competition Contribution). In Tools and Algorithms for the Construction and Analysis of Systems - 21st International Conference, TACAS 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings, Christel Baier and Cesare Tinelli (Eds.) (Lecture Notes in Computer Science, Vol. 9035). Springer, 447–450. https://doi.org/10.1007/978-3-662-46681-0_41 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Vincent Hwang, Jiaxiang Liu, Gregor Seiler, Xiaomu Shi, Ming-Hsien Tsai, Bow-Yaw Wang, and Bo-Yin Yang. 2022. Verified NTT Multiplications for NISTPQC KEM Lattice Finalists: Kyber, SABER, and NTRU. IACR Trans. Cryptogr. Hardw. Embed. Syst., 2022, 4 (2022), 718–750. https://doi.org/10.46586/tches.v2022.i4.718-750 Google ScholarGoogle ScholarCross RefCross Ref
  16. Patrick Longa and Michael Naehrig. 2016. Speeding up the Number Theoretic Transform for Faster Ideal Lattice-Based Cryptography. In Cryptology and Network Security - 15th International Conference, CANS 2016, Milan, Italy, November 14-16, 2016, Proceedings, Sara Foresti and Giuseppe Persiano (Eds.) (Lecture Notes in Computer Science, Vol. 10052). 124–139. https://doi.org/10.1007/978-3-319-48965-0_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Vadim Lyubashevsky, Chris Peikert, and Oded Regev. 2013. On Ideal Lattices and Learning with Errors over Rings. J. ACM, 60, 6 (2013), 43:1–43:35. https://doi.org/10.1145/2535925 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Masahiro Masuda and Yukiyoshi Kameyama. 2021. FFT Program Generation for Ring LWE-Based Cryptography. In Advances in Information and Computer Security - 16th International Workshop on Security, IWSEC 2021, Virtual Event, September 8-10, 2021, Proceedings, Toru Nakanishi and Ryo Nojima (Eds.) (Lecture Notes in Computer Science, Vol. 12835). Springer, 151–171. https://doi.org/10.1007/978-3-030-85987-9_9 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Masahiro Masuda and Yukiyoshi Kameyama. 2022. Unified Program Generation and Verification: A Case Study on Number-Theoretic Transform. In Functional and Logic Programming - 16th International Symposium, FLOPS 2022, Kyoto, Japan, May 10-12, 2022, Proceedings, Michael Hanus and Atsushi Igarashi (Eds.) (Lecture Notes in Computer Science, Vol. 13215). Springer, 133–151. https://doi.org/10.1007/978-3-030-99461-7_8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Kevin Millar, Marcin Lukowiak, and Stanislaw P. Radziszowski. 2019. Design of a Flexible Schönhage-Strassen FFT Polynomial Multiplier with High- Level Synthesis to Accelerate HE in the Cloud. In 2019 International Conference on ReConFigurable Computing and FPGAs, ReConFig 2019, Cancun, Mexico, December 9-11, 2019, David Andrews, René Cumplido, Claudia Feregrino, and Marco Platzner (Eds.). IEEE, 1–5. https://doi.org/10.1109/ReConFig48160.2019.8994790 Google ScholarGoogle ScholarCross RefCross Ref
  21. Peter L. Montgomery. 1985. Modular Multiplication Without Trial Division. Math. Comp., 44 (1985), 519–521. https://www.ams.org/journals/mcom/1985-44-170/S0025-5718-1985-0777282-X/S0025-5718-1985-0777282-X.pdf Google ScholarGoogle ScholarCross RefCross Ref
  22. Jorge A. Navas, Bruno Dutertre, and Ian A. Mason. 2020. Verification of an Optimized NTT Algorithm. In Software Verification - 12th International Conference, VSTTE 2020, and 13th International Workshop, NSV 2020, Los Angeles, CA, USA, July 20-21, 2020, Revised Selected Papers, Maria Christakis, Nadia Polikarpova, Parasara Sridhar Duggirala, and Peter Schrammel (Eds.) (Lecture Notes in Computer Science, Vol. 12549). Springer, 144–160. https://doi.org/10.1007/978-3-030-63618-0_9 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Thomas Pöppelmann, Tobias Oder, and Tim Güneysu. 2015. High-Performance Ideal Lattice-Based Cryptography on 8-Bit ATxmega Microcontrollers. In Progress in Cryptology - LATINCRYPT 2015 - 4th International Conference on Cryptology and Information Security in Latin America, Guadalajara, Mexico, August 23-26, 2015, Proceedings, Kristin E. Lauter and Francisco Rodríguez-Henríquez (Eds.) (Lecture Notes in Computer Science, Vol. 9230). Springer, 346–365. https://doi.org/10.1007/978-3-319-22174-8_19 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Yang Yang, Sanmukh R. Kuppannagari, Rajgopal Kannan, and Viktor K. Prasanna. 2022. NTTGen: a framework for generating low latency NTT implementations on FPGA. In CF ’22: 19th ACM International Conference on Computing Frontiers, Turin, Italy, May 17 - 22, 2022, Luca Sterpone, Andrea Bartolini, and Anastasiia Butko (Eds.). ACM, 30–39. https://doi.org/10.1145/3528416.3530225 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Tian Ye, Yang Yang, Sanmukh R. Kuppannagari, Rajgopal Kannan, and Viktor K. Prasanna. 2021. FPGA Acceleration of Number Theoretic Transform. In High Performance Computing - 36th International Conference, ISC High Performance 2021, Virtual Event, June 24 - July 2, 2021, Proceedings, Bradford L. Chamberlain, Ana Lucia Varbanescu, Hatem Ltaief, and Piotr Luszczek (Eds.) (Lecture Notes in Computer Science, Vol. 12728). Springer, 98–117. https://doi.org/10.1007/978-3-030-78713-4_6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Neng Zhang, Bohan Yang, Chen Chen, Shouyi Yin, Shaojun Wei, and Leibo Liu. 2020. Highly Efficient Architecture of NewHope-NIST on FPGA using Low-Complexity NTT/INTT. IACR Trans. Cryptogr. Hardw. Embed. Syst., 2020, 2 (2020), 49–72. https://doi.org/10.13154/tches.v2020.i2.49-72 Google ScholarGoogle ScholarCross RefCross Ref
  27. Jean Karim Zinzindohoué, Karthikeyan Bhargavan, Jonathan Protzenko, and Benjamin Beurdouche. 2017. HACL*: A Verified Modern Cryptographic Library. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, CCS 2017, Dallas, TX, USA, October 30 - November 03, 2017, Bhavani Thuraisingham, David Evans, Tal Malkin, and Dongyan Xu (Eds.). ACM, 1789–1806. https://doi.org/10.1145/3133956.3134043 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generating Programs for Polynomial Multiplication with Correctness Assurance

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PEPM 2023: Proceedings of the 2023 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation
        January 2023
        65 pages
        ISBN:9798400700118
        DOI:10.1145/3571786

        Copyright © 2023 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 15 January 2023

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate66of120submissions,55%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader