THE-BERT (TEE + HE BERT) protects inputs and model parameters during BERT-tiny inference using Homomorphic Encryption and Trusted Execution Environment.
- Ubuntu 20.04.6 LTS
- g++ 9.4.0
- OpenFHE 1.1.1
- cmake 3.28.1
- HDF5 1.12.1
- Gramine 1.6
- Build and install [OpenFHE].
- Build and install [Gramine].
- Modify the environment variables ([your_path]) contained in CMakeLists.txt or matmul.manifest.template to suit your environment.
- Add the contents (ex. libOPENFHEpke.so.1) to the Runtime folder to suit your environment (The required files are listed in the manifest file. And the error message will indicate what is missing).
- Run the following commands at the root of the repository.
- (Running in REE can be done by executing [./test] in the build directory.)
- (Using the [--prepare] option at runtime prepares the keys and encrypted parameters. Please use this first.)
- (As a reference value, 32-thread execution used 10.4 GB of memory.)
$ mkdir build && cd build $ cmake .. $ cmake --build . $ ./test --prepare $ cd ../ $ make SGX=1 $ gramine-sgx matmul
- Futoshi Hashimoto