{"id":33114625,"url":"https://github.com/secretflow/heu","last_synced_at":"2026-03-05T02:02:56.395Z","repository":{"id":41291872,"uuid":"481940688","full_name":"secretflow/heu","owner":"secretflow","description":"A high-performance homomorphic encryption algorithm library.","archived":false,"fork":false,"pushed_at":"2025-11-25T08:14:44.000Z","size":3931,"stargazers_count":108,"open_issues_count":7,"forks_count":45,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-11-27T20:01:02.921Z","etag":null,"topics":["cryptography","homomorphic-encryption","paillier"],"latest_commit_sha":null,"homepage":"https://www.secretflow.org.cn/docs/heu/en/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secretflow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOGS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-15T11:45:15.000Z","updated_at":"2025-11-27T03:31:09.000Z","dependencies_parsed_at":"2024-02-28T15:47:58.255Z","dependency_job_id":"9fffbb9b-de2a-4dc3-83e8-78afad13e886","html_url":"https://github.com/secretflow/heu","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/secretflow/heu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fheu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fheu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fheu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fheu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secretflow","download_url":"https://codeload.github.com/secretflow/heu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretflow%2Fheu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30106148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","homomorphic-encryption","paillier"],"created_at":"2025-11-15T02:00:23.826Z","updated_at":"2026-03-05T02:02:56.385Z","avatar_url":"https://github.com/secretflow.png","language":"C++","funding_links":[],"categories":["隐私新技术"],"sub_categories":["隐私相关领域法规/条例"],"readme":"# HEU\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/secretflow/heu/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/secretflow/heu/tree/main)\n![PyPI version](https://img.shields.io/pypi/v/sf-heu)\n\n[中文](README_cn.md)\n\nHEU (Homomorphic Encryption processing Unit) is a user-friendly and high-performance homomorphic\nencryption library that supports multiple types and scalable hardware acceleration.\n\n## document\n\nhttps://www.secretflow.org.cn/docs/heu/\n\n## Repo status\n\nHomomorphic encryption algorithms are mainly divided into two categories: partially homomorphic\nencryption (PHE) and fully homomorphic encryption (FHE). Currently, HEU supports most PHE\nalgorithms, while FHE is still under development and will take some time.\n\nSupported algorithms:\n\n- Additive homomorphic encryption\n    - Paillier (recommended)\n    - Okamoto–Uchiyama (recommended)\n    - EC ElGamal\n    - Damgard-Jurik\n    - Damgard-Geisler-Krøigaard (DGK)\n- Fully homomorphic encryption\n    - Under development and is the current focus of work.\n\nEach algorithm includes a variety of different implementations, and some implementations support\nhardware accelerators. For more details, please refer to\nthe [Document](https://www.secretflow.org.cn/docs/heu/latest/zh-Hans/getting_started/algo_choice )\n\n\n### Layout\n\n```text\n.\n├── .circleci  # CI/CD configuration files for circleci\n├── .github    # Configuration files for GitHub\n├── docs       # HEU documentation in Sphinx format\n├── heu        # All the implementation code for HEU\n│   ├── algorithms     # Holds the implementations of all algorithms\n│   ├── experimental   # Contains some standalone experimental code\n│   ├── library        # Implements the application layer functionality of the HE Library\n│   │   ├── algorithms # Legacy algorithms not yet migrated to SPI (this directory will be deprecated after migration)\n│   │   ├── benchmark  # Contains benchmarking code\n│   │   ├── numpy      # Implements a set of Numpy-like interfaces\n│   │   └── phe        # PHE Dispatcher implementation (to be deprecated, with replaced by SPI)\n│   ├── pylib          # Python bindings\n│   └── spi            # Defines the HEU software and hardware access layer interface (SPI)\n│       ├── he         # Contains HE SPI and related Sketches\n│       └── poly       # Defines polynomial interfaces and related Sketches\n└── third_party        # Contains third-party libraries required for compilation; libraries will be automatically downloaded during build\n\n```\n\nHEU is currently transitioning from the old Dispatcher architecture to an SPI-based framework. The\nmain modules and their code path mappings for both architectures are as follows:\n\nDispatcher-based architecture:\n\n```text\n     Python APIs (Python binding)\n          PATH: heu/pylib\n                  │\n                  ├───────────────────┐\n                  │                   ▼\n                  │    Tensor Lib with Numpy-like API\n                  │        PATH: heu/library/numpy\n                  │                   │\n                  │     ┌─────────────┘\n                  │     │\n                  ▼     ▼\n     PHE Dispatcher \u0026 PHE C++ API\n        PATH: heu/library/phe\n                  │\n                  │\n                  ▼\n Various PHE algorithm implementations\n     PATH: heu/library/algorithms\n```\n\nSPI-based architecture:\n\n```text\n    Python APIs (Python binding)\n         PATH: heu/pylib\n                 │\n                 ├───────────────────┐\n                 │                   ▼\n                 │    Tensor Lib with Numpy-like API\n                 │           PATH: heu/numpy\n                 │                   │\n                 │ ┌─────────────────┘\n                 │ │\n                 ▼ ▼\n         HE SPI (C++ APIs)\n         PATH: heu/spi/he\n                 │\n                 │\n                 ▼\n Various HE algorithm implementations\n        PATH: heu/algorithms\n```\n\nFor a more detailed introduction to SPI, please [click here](heu/spi/README.md)\n\n### 2024 Work Plan\n\nArchitecture Transition Milestones:\n\n- [x] HE SPI: Designed a unified interface that supports all PHE/FHE algorithms.\n- [ ] Implementation of SPI Sketches. (in progress)\n- [ ] Migration of existing algorithms to SPI. (in progress)\n- [ ] Automated testing framework for PHE/FHE algorithms. (in progress)\n- [ ] Transition of Tensor Lib's underlying layer from Dispatcher to SPI.\n- [ ] Transition of PyLib's underlying layer from Dispatcher to SPI.\n\nFHE Milestones:\n\n- [ ] Integration of Microsoft SEAL\n- [ ] Integration of OpenFHE.\n- [ ] Support for GPU-accelerated CKKS algorithm.\n- [ ] Provides FHE interfaces in Tensor Lib.\n- [ ] Provides FHE interfaces in PyLib.\n\n## Compile and install\n\n### Environmental requirements\n\n- CPU\n    - x86_64: minimum required AVX instruction set\n    - AArch64: ARMv8\n- OS\n    - Ubuntu 18.04+\n    - Centos 7\n    - macOS 12.0+ (macOS Monterey+)\u003csup\u003e1\u003c/sup\u003e\n- Python\n    - Python 3.9+\n\n1. Due to CI resource limitation, macOS x64 prebuild binary is no longer available.\n\n### Install via Pip\n\n```shell\npip install sf-heu\n```\n\n### Install from source\n\nThe following command will automatically compile and install HEU into the default Python\nenvironment:\n\n```shell\ngit clone git@github.com:secretflow/heu.git\ncd heu\nsh build_wheel_entrypoint.sh\n\n```\n\n### Run unit tests (optional)\n\n\n\n\n\n```shell\n# just compile, do not run any UT (optional)\nbazel build heu/...\n\n# compile and run all UTs\nbazel test heu/...\n```\n\n## Contribution Guidelines\n\nSecretFlow is an open and inclusive community, and we welcome any kind of contribution. If you want\nto improve HEU, please refer to [Contribution Guide](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretflow%2Fheu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecretflow%2Fheu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretflow%2Fheu/lists"}