Skip to main content

HEIR: Homomorphic Encryption Intermediate Representation

GitHub Workflow Status (with event) GitHub Contributors GitHub Discussions GitHub License OpenSSF Scorecard

An MLIR-based toolchain for homomorphic encryption compilers. Read the docs at the HEIR website.

For more information on MLIR, see the MLIR homepage.

Quickstart

There are currently three ways to use HEIR:

  • Use bazel and rules_heir with either the OpenFHE or Lattigo backends.
  • Install OpenFHE and use the heir_py Python package.
  • Install HEIR from source and invoke the heir-opt and heir-translate binaries directly, extracting the generated backend code and integrating it into your project manually.

See Getting Started for more details.

Building from source

This project uses bazel for its build system. Install bazelisk to manage the bazel version automatically. Then, with bazel on your path (pointing to bazelisk), run the following to build the main pass-running tool.

bazel build //tools:heir-opt

Or run an end-to-end test like

bazel test //tests/Examples/openfhe/ckks/halevi_shoup_matvec:all

HEIR depends on LLVM (from source) so a clean build may take 30 minutes depending on your machine. For faster builds, use BuildBuddy. Sign up for an account, create an API key, and add the following to .bazelrc.user in the root of the HEIR workspace:

common --remote_header=x-buildbuddy-api-key=<YOUR_API_KEY>
common --config=remote

This should reduce a clean build time to about 5 minutes.

See the bazel tips page for more example commands and tips on using bazel.

Supported backends and schemes

Backend Library BGV BFV CKKS CGGI
OpenFHE
Lattigo
tfhe-rs
Jaxite

Note some backends do not support all schemes.

Contributing

There are many ways to contribute to HEIR:

Citations

The HEIR project can be cited in academic work through the following entry:

@misc{ali2025heir,
      title={HEIR: A Universal Compiler for Homomorphic Encryption},
      author={Asra Ali and Jaeho Choi and Bryant Gipson and Shruthi Gorantala
              and Jeremy Kun and Wouter Legiest and Lawrence Lim and Alexander
              Viand and Meron Zerihun Demissie and Hongren Zheng},
      year={2025},
      eprint={2508.11095},
      archivePrefix={arXiv},
      primaryClass={cs.CR},
      url={https://arxiv.org/abs/2508.11095},
}

Support disclaimer

This is not an officially supported Google product.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

belfort_heir-2026.9.1.tar.gz (16.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_x86_64.whl (35.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_aarch64.whl (33.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

belfort_heir-2026.9.1-cp310-abi3-macosx_11_0_arm64.whl (35.8 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file belfort_heir-2026.9.1.tar.gz.

File metadata

  • Download URL: belfort_heir-2026.9.1.tar.gz
  • Upload date:
  • Size: 16.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for belfort_heir-2026.9.1.tar.gz
Algorithm Hash digest
SHA256 b2ad68fc60a375d3bdf8ca776294ec0d3ee92aff0080a8a3ebb0786ba2a51432
MD5 62369e77f39e038d1a47c124138ff109
BLAKE2b-256 f120d1bc391359a14a23226f2505846954c803c71716d40d4a2799d26471ac6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.1.tar.gz:

Publisher: release.yml on belfortlabs/heir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bdb3b99d748fcc899c17105a478abfe9794c928f1b3e9e43dd9a49380f4a23fe
MD5 03cc6c61351b8fd500a577e6889ebcce
BLAKE2b-256 5ea61950e9ed4171dcc75c2c24113eac9320f16bdb500ac9d0682bef80b103c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on belfortlabs/heir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6b7c07ffe2c33701b1b12bdd207529b0252dd6c1650b93f004ebac6a0787ab5d
MD5 0119bdbb5e914473149f35e066ff1624
BLAKE2b-256 42668f7173f1a488c8dfcf5241577ac24950f190845b5120ff1dd5fa80514e14

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.1-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on belfortlabs/heir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file belfort_heir-2026.9.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85412d359e643c599a2485efbd795f6fb52bb1d1d0c425900a9f1286feadab59
MD5 980144885d64341e6c0c1a37aa8cc5e0
BLAKE2b-256 beae8751bf1f41860924d60b14b727a7dd6213451dde19024cd87b6e84e7b2f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.1-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on belfortlabs/heir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page