HEU

δΈζ
HEU (Homomorphic Encryption processing Unit) is a user-friendly and high-performance homomorphic
encryption library that supports multiple types and scalable hardware acceleration.
document
https://www.secretflow.org.cn/docs/heu/
Repo status
Homomorphic encryption algorithms are mainly divided into two categories: partially homomorphic
encryption (PHE) and fully homomorphic encryption (FHE). Currently, HEU supports most PHE
algorithms, while FHE is still under development and will take some time.
Supported algorithms:
- Additive homomorphic encryption
- Paillier (recommended)
- OkamotoβUchiyama (recommended)
- EC ElGamal
- Damgard-Jurik
- Damgard-Geisler-KrΓΈigaard (DGK)
- Fully homomorphic encryption
- Under development and is the current focus of work.
Each algorithm includes a variety of different implementations, and some implementations support
hardware accelerators. For more details, please refer to
the Document
Layout
.
βββ .circleci # CI/CD configuration files for circleci
βββ .github # Configuration files for GitHub
βββ docs # HEU documentation in Sphinx format
βββ heu # All the implementation code for HEU
β βββ algorithms # Holds the implementations of all algorithms
β βββ experimental # Contains some standalone experimental code
β βββ library # Implements the application layer functionality of the HE Library
β β βββ algorithms # Legacy algorithms not yet migrated to SPI (this directory will be deprecated after migration)
β β βββ benchmark # Contains benchmarking code
β β βββ numpy # Implements a set of Numpy-like interfaces
β β βββ phe # PHE Dispatcher implementation (to be deprecated, with replaced by SPI)
β βββ pylib # Python bindings
β βββ spi # Defines the HEU software and hardware access layer interface (SPI)
β βββ he # Contains HE SPI and related Sketches
β βββ poly # Defines polynomial interfaces and related Sketches
βββ third_party # Contains third-party libraries required for compilation; libraries will be automatically downloaded during build
HEU is currently transitioning from the old Dispatcher architecture to an SPI-based framework. The
main modules and their code path mappings for both architectures are as follows:
Dispatcher-based architecture:
Python APIs (Python binding)
PATH: heu/pylib
β
βββββββββββββββββββββ
β βΌ
β Tensor Lib with Numpy-like API
β PATH: heu/library/numpy
β β
β βββββββββββββββ
β β
βΌ βΌ
PHE Dispatcher & PHE C++ API
PATH: heu/library/phe
β
β
βΌ
Various PHE algorithm implementations
PATH: heu/library/algorithms
SPI-based architecture:
Python APIs (Python binding)
PATH: heu/pylib
β
βββββββββββββββββββββ
β βΌ
β Tensor Lib with Numpy-like API
β PATH: heu/numpy
β β
β βββββββββββββββββββ
β β
βΌ βΌ
HE SPI (C++ APIs)
PATH: heu/spi/he
β
β
βΌ
Various HE algorithm implementations
PATH: heu/algorithms
For a more detailed introduction to SPI, please click here
2024 Work Plan
Architecture Transition Milestones:
FHE Milestones:
Compile and install
Environmental requirements
- CPU
- x86_64: minimum required AVX instruction set
- AArch64: ARMv8
- OS
- Ubuntu 18.04+
- Centos 7
- macOS 12.0+ (macOS Monterey+)1
- Python
- Due to CI resource limitation, macOS x64 prebuild binary is no longer available.
Install via Pip
pip install sf-heu
Install from source
The following command will automatically compile and install HEU into the default Python
environment:
git clone git@github.com:secretflow/heu.git
cd heu
sh build_wheel_entrypoint.sh
Run unit tests (optional)
# just compile, do not run any UT (optional)
bazel build heu/...
# compile and run all UTs
bazel test heu/...
Contribution Guidelines
SecretFlow is an open and inclusive community, and we welcome any kind of contribution. If you want
to improve HEU, please refer to Contribution Guide