Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.14.dev0.tar.gz (52.8 kB 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.14.dev0-cp310-abi3-manylinux_2_28_x86_64.whl (35.4 MB view details)

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

belfort_heir-2026.9.14.dev0-cp310-abi3-manylinux_2_28_aarch64.whl (33.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

belfort_heir-2026.9.14.dev0-cp310-abi3-macosx_11_0_arm64.whl (39.7 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file belfort_heir-2026.9.14.dev0.tar.gz.

File metadata

  • Download URL: belfort_heir-2026.9.14.dev0.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • 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.14.dev0.tar.gz
Algorithm Hash digest
SHA256 95eaf745d85f37a0df3a3e73b1d1e4c38d9c91aad496c457ea1af84ac4a9992d
MD5 20e50af94b32978b38e08d3cc6e46ef1
BLAKE2b-256 8d4cfd0855bd8236908c61b30057a8f13c353996bf1beb940a8f318c2bce3959

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.14.dev0.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.14.dev0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.14.dev0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 123cbadc26333a51add484ffc67da4031f143324d17df4d79484bee95137f1ed
MD5 20ad8d86bb9ebc9d6d21066db42f40d1
BLAKE2b-256 d3f0e42dcb2e5ac21f2ec0597ad4e5f7992931e03e3648a2e6c815a3d133c714

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.14.dev0-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.14.dev0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.14.dev0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1cf26b6585805f218baf76f787b64454b5cddb6b1b457529fded4d88541254a9
MD5 cfee5c9e367f56870cf863b52d7acb57
BLAKE2b-256 7a2faa6bb0a5a81d7c8215510ee76c149a3043bb5ffe04f6245ff63dabcd5eb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.14.dev0-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.14.dev0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for belfort_heir-2026.9.14.dev0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8438f356819aa44e3ae0ceca2a1fd3084f27ead7b33aef682b9dfcf9b5871827
MD5 a46124f922f58b72e2e4980254c98001
BLAKE2b-256 bc29b103aee4620c84724f61fe2edbc3a2f3afb36b8649a44e8263437b4accfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for belfort_heir-2026.9.14.dev0-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