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.

Metadata

Release files for belfort-heir 2026.10.12.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for belfort-heir 2026.10.12.dev1
File Size Uploaded
belfort_heir-2026.10.12.dev1.tar.gz 16.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for belfort-heir 2026.10.12.dev1
File Interpreter ABI Platform
belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
belfort_heir-2026.10.12.dev1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 124.0 MB

Release files / belfort_heir-2026.10.12.dev1.tar.gz

Download URL belfort_heir-2026.10.12.dev1.tar.gz
Size 16.1 MB
Tags Source
SHA-256 checksum
How to use checksums
3b4483a32962dc7373910063e0161922f52f860318be21bbd0bf7b384b6c9cbc
BLAKE2b-256 checksum
How to use checksums
cb513198a95dc70abdebc4bea88c7433ed8cdc56cf92f13b2414c8c4fa080fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_x86_64.whl
Size 35.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
24d27e69c34b7736d27abb0b1af1d2389dd33c390c2f122ae48b6aa181ad1662
BLAKE2b-256 checksum
How to use checksums
28d9400353c257917ab9762ac1e800ffcbf0d833e7133bf8b2a09f8f64807d52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL belfort_heir-2026.10.12.dev1-cp310-abi3-manylinux_2_28_aarch64.whl
Size 33.3 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
d9738120f38dc2804ead069c35fadfbb5a989caca8bf16d55f618e1d1b941814
BLAKE2b-256 checksum
How to use checksums
670613221b6f2d63e35dd6cde3188541f2eed63c8c6203a75caf3d105483b062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / belfort_heir-2026.10.12.dev1-cp310-abi3-macosx_11_0_arm64.whl

Download URL belfort_heir-2026.10.12.dev1-cp310-abi3-macosx_11_0_arm64.whl
Size 39.3 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
655505ca142a3a6e20436a2a401dd6320c44f5848447b17476a75e3e811c14f8
BLAKE2b-256 checksum
How to use checksums
68852830f0fee372283c7e17780873abd3bc3153ab5052f7ab8cf4cfe5eedafb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log
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