skip to main content
10.1145/3385412.3385996acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Optimizing homomorphic evaluation circuits by program synthesis and term rewriting

Published: 11 June 2020 Publication History

Abstract

We present a new and general method for optimizing homomorphic evaluation circuits. Although fully homomorphic encryption (FHE) holds the promise of enabling safe and secure third party computation, building FHE applications has been challenging due to their high computational costs. Domain-specific optimizations require a great deal of expertise on the underlying FHE schemes, and FHE compilers that aims to lower the hurdle, generate outcomes that are typically sub-optimal as they rely on manually-developed optimization rules. In this paper, based on the prior work of FHE compilers, we propose a method for automatically learning and using optimization rules for FHE circuits. Our method focuses on reducing the maximum multiplicative depth, the decisive performance bottleneck, of FHE circuits by combining program synthesis and term rewriting. It first uses program synthesis to learn equivalences of small circuits as rewrite rules from a set of training circuits. Then, we perform term rewriting on the input circuit to obtain a new circuit that has lower multiplicative depth. Our rewriting method maximally generalizes the learned rules based on the equational matching and its soundness and termination properties are formally proven. Experimental results show that our method generates circuits that can be homomorphically evaluated 1.18x – 3.71x faster (with the geometric mean of 2.05x) than the state-of-the-art method. Our method is also orthogonal to existing domain-specific optimizations.

References

[1]
2015. The EPFL Combinational Benchmark Suite. https://www.epfl. ch/labs/lsi/page-102566-en-html/benchmarks/.
[2]
R. Alur, R. Bodik, G. Juniwal, M. M. K. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. 2013. Syntax-guided synthesis. In 2013 Formal Methods in Computer-Aided Design (FMCAD ’13). 1–8.
[3]
[4]
Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS ’17), Axel Legay and Tiziana Margaria (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 319–336.
[5]
David W. Archer, José Manuel Calderón Trilla, Jason Dagit, Alex Malozemoff, Yuriy Polyakov, Kurt Rohloff, and Gerard Ryan. 2019.
[6]
RAMPARTS: A Programmer-Friendly System for Building Homomorphic Encryption Applications. In Proceedings of the 7th ACM Workshop on Encrypted Computing & Applied Homomorphic Cryptography (WAHC ’19). ACM, New York, NY, USA, 57–68.
[7]
Pascal Aubry, Sergiu Carpov, and Renaud Sirdey. 2019. Faster homomorphic encryption is not enough: improved heuristic for multiplicative depth minimization of Boolean circuits. Cryptology ePrint Archive, Report 2019/963. https://eprint.iacr.org/2019/963.
[8]
Franz Baader and Tobias Nipkow. 1998. Term Rewriting and All That. Cambridge University Press, New York, NY, USA. Optimizing Homomorphic Evaluation Circuits by Program Synthesis and Term Rewriting PLDI ’20, June 15–20, 2020, London, UK
[9]
Sorav Bansal and Alex Aiken. 2006. Automatic Generation of Peephole Superoptimizers. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’06). ACM, New York, NY, USA, 394–403.
[10]
Dan Boneh, Craig Gentry, Shai Halevi, Frank Wang, and David J. Wu. 2013. Private Database Queries Using Somewhat Homomorphic Encryption. In Applied Cryptography and Network Security, Michael Jacobson, Michael Locasto, Payman Mohassel, and Reihaneh Safavi-Naini (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 102–118.
[11]
James M. Boyle, Terence J. Harmer, and Victor L. Winter. 1997. Modern Software Tools for Scientific Computing. Birkhauser Boston Inc., Cambridge, MA, USA, Chapter The TAMPR Program Transformation System: Simplifying the Development of Numerical Software, 353–372. http://dl.acm.org/citation.cfm?id=266469.266509
[12]
Zvika Brakerski, Craig Gentry, and Vinod Vaikuntanathan. 2012. (Leveled) Fully Homomorphic Encryption Without Bootstrapping. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference (ITCS ’12). ACM, New York, NY, USA, 309–325.
[13]
Martin Bravenboer, Karl Trygve Kalleberg, Rob Vermaas, and Eelco Visser. 2008. Stratego/XT 0.17. A language and toolset for program transformation. Science of Computer Programming 72, 1 (2008), 52 – 70. Special Issue on Second issue of experimental software and toolkits (EST).
[14]
Robert Brayton and Alan Mishchenko. 2010. ABC: An Academic Industrial-strength Verification Tool. In Proceedings of the 22Nd International Conference on Computer Aided Verification (CAV ’10). Springer-Verlag, Berlin, Heidelberg, 24–40. 14295-6_5
[15]
Sebastian Buchwald. 2015. Optgen: A Generator for Local Optimizations. In Compiler Construction, Björn Franke (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 171–189.
[16]
Sergiu Carpov, Pascal Aubry, and Renaud Sirdey. 2018. A Multi-start Heuristic for Multiplicative Depth Minimization of Boolean Circuits. In Combinatorial Algorithms, Ljiljana Brankovic, Joe Ryan, and William F. Smyth (Eds.). Springer International Publishing, Cham, 275–286.
[17]
Sergiu Carpov, Paul Dubrulle, and Renaud Sirdey. 2015. Armadillo: A Compilation Chain for Privacy Preserving Applications. In Proceedings of the 3rd International Workshop on Security in Cloud Computing (SCC ’15). ACM, New York, NY, USA, 13–19.
[18]
[19]
S. Carpov, T. H. Nguyen, R. Sirdey, G. Constantino, and F. Martinelli. 2016. Practical Privacy-Preserving Medical Diagnosis Using Homomorphic Encryption. In 2016 IEEE 9th International Conference on Cloud Computing (CLOUD ’16). 593–599. 2016.0084
[20]
Gizem S. Cetin, Yarkin Doroz, Berk Sunar, and Erkay Savas. 2015. Depth Optimized Efficient Homomorphic Sorting. In Proceedings of the 4th International Conference on Progress in Cryptology - Volume 9230 (LATINCRYPT ’15). Springer-Verlag, Berlin, Heidelberg, 61–80.
[21]
Jung Hee Cheon, Andrey Kim, Miran Kim, and Yongsoo Song. 2017. Homomorphic Encryption for Arithmetic of Approximate Numbers. In Advances in Cryptology (ASIACRYPT ’17), Tsuyoshi Takagi and Thomas Peyrin (Eds.). Springer International Publishing, Cham, 409–437.
[22]
Jung Hee Cheon, Miran Kim, and Kristin Lauter. 2015. Homomorphic Computation of Edit Distance. In Financial Cryptography and Data Security, Michael Brenner, Nicolas Christin, Benjamin Johnson, and Kurt Rohloff (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 194–212.
[23]
Yuki Chiba, Takahito Aoto, and Yoshihito Toyama. 2005. Program Transformation by Templates Based on Term Rewriting. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP ’05). ACM, New York, NY, USA, 59–69.
[24]
Cingulata 2019. Cingulata. https://github.com/CEA-LIST/Cingulata. CEA-LIST.
[25]
Eric Crockett, Chris Peikert, and Chad Sharp. 2018. ALCHEMY: A Language and Compiler for Homomorphic Encryption Made easY. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (CCS ’18). ACM, New York, NY, USA, 1020– 1037.
[26]
Roshan Dathathri, Olli Saarikivi, Hao Chen, Kim Laine, Kristin Lauter, Saeed Maleki, Madanlal Musuvathi, and Todd Mytkowicz. 2019. CHET: An Optimizing Compiler for Fully-homomorphic Neural-network Inferencing. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’19). ACM, New York, NY, USA, 142–156.
[27]
Marten van Dijk, Craig Gentry, Shai Halevi, and Vinod Vaikuntanathan. 2010. Fully Homomorphic Encryption over the Integers. In EUROCRYPT 2010.
[28]
Nathan Dowlin, Ran Gilad-Bachrach, Kim Laine, Kristin Lauter, Michael Naehrig, and John Wernsing. 2016. CryptoNets: Applying Neural Networks to Encrypted Data with High Throughput and Accuracy. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48 (ICML ’16). JMLR.org, 201–210. http://dl.acm.org/citation.cfm?id=3045390.3045413
[29]
Hassan Eldib, Meng Wu, and Chao Wang. 2016. Synthesis of Fault-Attack Countermeasures for Cryptographic Circuits. In Computer Aided Verification, Swarat Chaudhuri and Azadeh Farzan (Eds.). Springer International Publishing, Cham, 343–363.
[30]
Yu Feng, Ruben Martins, Jacob Van Geffen, Isil Dillig, and Swarat Chaudhuri. 2017. Component-based Synthesis of Table Consolidation and Transformation Tasks from Examples. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’17). ACM, New York, NY, USA, 422–436.
[31]
Yu Feng, Ruben Martins, Yuepeng Wang, Isil Dillig, and Thomas W. Reps. 2017. Component-based Synthesis for Complex APIs. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL ’17). ACM, New York, NY, USA, 599–612.
[32]
John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing Data Structure Transformations from Input-output Examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’15). ACM, New York, NY, USA, 229–239.
[33]
Craig Gentry. 2009. Fully Homomorphic Encryption Using Ideal Lattices. In Proceedings of the Forty-first Annual ACM Symposium on Theory of Computing (STOC ’09). ACM, New York, NY, USA, 169–178.
[34]
HEAAN 2019. HEAAN. https://github.com/snucrypto/HEAAN. SNU Crypto Group.
[35]
HElib 2019. HElib. http://github.com/homenc/HElib. IBM Research.
[36]
Stefan Heule, Eric Schkufza, Rahul Sharma, and Alex Aiken. 2016. Stratified Synthesis: Automatically Learning the x86-64 Instruction Set. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). ACM, New York, NY, USA, 237–250.
[37]
Nick Howgrave-Graham. 2001. Approximate Integer Common Divisors. In CaLC.
[38]
Susmit Jha, Sumit Gulwani, Sanjit A. Seshia, and Ashish Tiwari. 2010. Oracle-guided Component-based Program Synthesis. In Proceedings of the 32Nd ACM/IEEE International Conference on Software Engineering - Volume 1 (ICSE ’10). ACM, New York, NY, USA, 215–224.
[39]
Deepak Kapur and Paliath Narendran. 1987. Matching, Unification and Complexity. SIGSAM Bull. 21, 4 (Nov. 1987), 6–9. PLDI ’20, June 15–20, 2020, London, UK DongKwon Lee, Woosuk Lee, Hakjoo Oh, and Kwangkeun Yi 10.1145/36330.36332
[40]
Woosuk Lee, Hyunsook Hong, Kwangkeun Yi, and Jung Hee Cheon. 2015. Static Analysis with Set-Closure in Secrecy. In Static Analysis, Sandrine Blazy and Thomas Jensen (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 18–35.
[41]
Wenjie Lu, Shohei Kawasaki, and Jun Sakuma. 2016. Using Fully Homomorphic Encryption for Statistical Analysis of Categorical, Ordinal and Numerical Data. IACR Cryptology ePrint Archive 2016 (2016), 1163.
[42]
Michael Naehrig, Kristin Lauter, and Vinod Vaikuntanathan. 2011. Can Homomorphic Encryption Be Practical?. In Proceedings of the 3rd ACM Workshop on Cloud Computing Security Workshop (CCSW ’11). ACM, New York, NY, USA, 113–124.
[43]
Goldreich Oded. 2009. Foundations of Cryptography: Volume 2, Basic Applications (1st ed.). Cambridge University Press, New York, NY, USA.
[44]
Detlef Plump. 2002. Essentials of Term Graph Rewriting. Electronic Notes in Theoretical Computer Science 51 (2002), 277 – 289. org/10.1016/S1571-0661(04)80210-X GETGRATS Closing Workshop.
[45]
Raimondas Sasnauskas, Yang Chen, Peter Collingbourne, Jeroen Ketema, Jubi Taneja, and John Regehr. 2017. Souper: A Synthesizing Superoptimizer. CoRR abs/1711.04422 (2017). arXiv: 1711.04422 http://arxiv.org/abs/1711.04422
[46]
Eric Schkufza, Rahul Sharma, and Alex Aiken. 2013. Stochastic Superoptimization. In Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’13). ACM, New York, NY, USA, 305–316.
[47]
SEAL 2019. Microsoft SEAL (release 3.3). https://github.com/Microsoft/ SEAL. Microsoft Research, Redmond, WA.
[48]
Rishabh Singh, Sumit Gulwani, and Armando Solar-Lezama. 2013. Automated Feedback Generation for Introductory Programming Assignments. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’13). ACM, New York, NY, USA, 15–26.
[49]
SyGuS 2019. The 6th Syntax-Guided Synthesis Competition. https: //sygus.org/comp/2019/. SyGuS-Comp 2019.
[50]
Ross Tate, Michael Stepp, Zachary Tatlock, and Sorin Lerner. 2009. Equality Saturation: A New Approach to Optimization. In Proceedings of the 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’09). ACM, New York, NY, USA, 264–276.
[51]
Mark G. J. van den Brand, J. Heering, P. Klint, and P. A. Olivier. 2002. Compiling Language Definitions: The ASF+SDF Compiler. ACM Trans. Program. Lang. Syst. 24, 4 (July 2002), 334–368. 1145/567097.567099
[52]
Alexander Viand and Hossein Shafagh. 2018. Marble: Making Fully Homomorphic Encryption Accessible to All. In Proceedings of the 6th Workshop on Encrypted Computing & Applied Homomorphic Cryptography (WAHC ’18). ACM, New York, NY, USA, 49–60.
[53]
Eelco Visser, Zine-el-Abidine Benaissa, and Andrew Tolmach. 1998. Building Program Optimizers with Rewriting Strategies. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming (ICFP ’98). ACM, New York, NY, USA, 13–26.
[54]
Chenglong Wang, Alvin Cheung, and Rastislav Bodik. 2017. Synthesizing Highly Expressive SQL Queries from Input-output Examples. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’17). ACM, New York, NY, USA, 452–466.
[55]
Henry S. Warren. 2012. Hacker’s Delight (2nd ed.). Addison-Wesley Professional.

Cited By

View all
  • (2024)DaCapoProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699291(6993-7010)Online publication date: 14-Aug-2024
  • (2024)Oraqle: A Depth-Aware Secure Computation CompilerProceedings of the 12th Workshop on Encrypted Computing & Applied Homomorphic Cryptography10.1145/3689945.3694808(43-50)Online publication date: 19-Nov-2024
  • (2024)On Error Correction for Nonvolatile Processing-In-Memory2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA)10.1109/ISCA59077.2024.00055(678-692)Online publication date: 29-Jun-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2020
1174 pages
ISBN:9781450376136
DOI:10.1145/3385412
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 ACM 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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 11 June 2020

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Homomorphic Encryption Circuit
  2. Program Synthesis
  3. Term Rewriting

Qualifiers

  • Research-article

Conference

PLDI '20
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)90
  • Downloads (Last 6 weeks)4
Reflects downloads up to 14 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)DaCapoProceedings of the 33rd USENIX Conference on Security Symposium10.5555/3698900.3699291(6993-7010)Online publication date: 14-Aug-2024
  • (2024)Oraqle: A Depth-Aware Secure Computation CompilerProceedings of the 12th Workshop on Encrypted Computing & Applied Homomorphic Cryptography10.1145/3689945.3694808(43-50)Online publication date: 19-Nov-2024
  • (2024)On Error Correction for Nonvolatile Processing-In-Memory2024 ACM/IEEE 51st Annual International Symposium on Computer Architecture (ISCA)10.1109/ISCA59077.2024.00055(678-692)Online publication date: 29-Jun-2024
  • (2023)ELASMProceedings of the 32nd USENIX Conference on Security Symposium10.5555/3620237.3620500(4697-4714)Online publication date: 9-Aug-2023
  • (2023)Fast Instruction Selection for Fast Digital Signal ProcessingProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 410.1145/3623278.3624768(125-137)Online publication date: 25-Mar-2023
  • (2023)Optimizing Homomorphic Evaluation Circuits by Program Synthesis and Time-bounded Exhaustive SearchACM Transactions on Programming Languages and Systems10.1145/359162245:3(1-37)Online publication date: 23-Sep-2023
  • (2023)Inductive Program Synthesis via Iterative Forward-Backward Abstract InterpretationProceedings of the ACM on Programming Languages10.1145/35912887:PLDI(1657-1681)Online publication date: 6-Jun-2023
  • (2023)HEaaN.MLIR: An Optimizing Compiler for Fast Ring-Based Homomorphic EncryptionProceedings of the ACM on Programming Languages10.1145/35912287:PLDI(196-220)Online publication date: 6-Jun-2023
  • (2023)Coyote: A Compiler for Vectorizing Encrypted Arithmetic CircuitsProceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3582016.3582057(118-133)Online publication date: 25-Mar-2023
  • (2023)Simplifying Mixed Boolean-Arithmetic Obfuscation by Program Synthesis and Term RewritingProceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security10.1145/3576915.3623186(2351-2365)Online publication date: 15-Nov-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media