Skip to content

yamanalab/THE-BERT

Repository files navigation

THE-BERT

THE-BERT (TEE + HE BERT) protects inputs and model parameters during BERT-tiny inference using Homomorphic Encryption and Trusted Execution Environment.

Prerequisites

How to build and run

  1. Build and install [OpenFHE].
  2. Build and install [Gramine].
  3. Modify the environment variables ([your_path]) contained in CMakeLists.txt or matmul.manifest.template to suit your environment.
  4. 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).
  5. 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

Contributors

  • Futoshi Hashimoto

License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors