HEIR: Homomorphic Encryption Intermediate Representation

What is HEIR?

HEIR is a compiler toolchain for fully homomorphic encryption (FHE). We aim to be the industry-standard compiler for FHE. Application developers, compiler engineers, hardware designers, and cryptography researchers can build upon HEIR to accelerate the research and development of production-strength privacy-first software systems.

Why HEIR?

For application developers, HEIR aims to provide a simple entrypoint to start working with FHE. Write a program in Python, annotate the types to mark which are secret, and HEIR will compile the rest.

For hardware designers, HEIR provides multiple layers of abstraction at which to integrate code generation. This allows HEIR to support code generation for hardware accelerators that implement high-level FHE operations like bootstrap, as well as accelerators that operate at lower-level polynomial arithmetic.

For cryptography researchers, HEIR provides a convenient platform for research. HEIR provides the compiler infrastructure and implements standard optimizations from the literature. A researcher can focus on their novel optimization, and use HEIR for its benchmarking, example programs, and comparisons to alternative approaches. See research with HEIR for research built on HEIR, and tips for doing research with HEIR.

Project Goals

For an overview of the project, see our talk at FHE.org.

  • Compile high level programs to encrypted equivalents.
  • Support all modern FHE schemes.
  • Support code generation for FHE hardware accelerators, including GPU, TPU, FPGA, and custom ASICs.
  • Support code generation for standard FHE libraries, such as OpenFHE and Lattigo.
  • Support front-end languages for ease of development, such as Python and Torch.
  • Design lower-level dialects for optimizing underlying abstract-algebraic operations (e.g., RNS polynomial arithmetic).
  • Provide a platform for research into novel FHE optimizations.
  • Provide a platform for benchmarking.

Contributing to HEIR

There are several ways to contribute to HEIR, including:

We welcome pull requests, and have tagged issues for newcomers:

For new proposals, please open a GitHub issue.

Disclaimers

The HEIR codebase and documentation are maintained by Google.

Logo design by Edward Chen and Erin Park.