Optimizing Homomorphic Evaluation Circuits by Program Synthesis and Time-bounded Exhaustive Search

Dongkwon Lee, Woosuk Lee, Hakjoo Oh, Kwangkeun Yi

Research output: Contribution to journalArticlepeer-review

1 Citation (Scopus)


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 aim to lower the hurdle, generate outcomes that are typically sub-optimal, as they rely on manually-developed optimization rules. In this article, 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, term rewriting, and equality saturation. 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 uses the equational matching with generalized version of the learned rules, and its soundness property is formally proven. Our optimizations also try to explore every possible alternative order of applying rewrite rules by time-bounded exhaustive search technique called equality saturation. Experimental results show that our method generates circuits that can be homomorphically evaluated 1.08×-3.17× faster (with the geometric mean of 1.56×) than the state-of-the-art method. Our method is also orthogonal to existing domain-specific optimizations.

Original languageEnglish
Article number16
JournalACM Transactions on Programming Languages and Systems
Issue number3
Publication statusPublished - 2023 Sept 22

Bibliographical note

Publisher Copyright:
© 2023 Copyright held by the owner/author(s). Publication rights licensed to ACM.


  • equality saturation
  • Homomorphic encryption circuit
  • program synthesis
  • term rewriting

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'Optimizing Homomorphic Evaluation Circuits by Program Synthesis and Time-bounded Exhaustive Search'. Together they form a unique fingerprint.

Cite this