Skip to content

Commit

Permalink
Add OpenFHE backend (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeho authored and jaeho committed Jan 11, 2024
1 parent 8ed1afd commit ce7897f
Show file tree
Hide file tree
Showing 4 changed files with 905 additions and 2 deletions.
1 change: 1 addition & 0 deletions .circleci/build_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if [ ! -d "OpenFHE/build" ] ; then
cmake ..
make -j 10
sudo make install
sudo ln -s /usr/local/lib/libOpenFHEcore.so.1 /usr/lib/libOpenFHEcore.so.1
cd ../..
else
echo "Found in cache"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/clone_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ ! -d "palisade-release" ] ; then
fi

if [ ! -d "OpenFHE" ] ; then
git clone https://github.com/openfheorg/openfhe-development.git
git clone https://github.com/openfheorg/openfhe-development.git OpenFHE
fi

if [ ! -d "tfhe" ] ; then
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/org/twc/terminator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class Main {

enum HE_BACKEND {
NONE, SEAL, TFHE, PALISADE, HELIB, LATTIGO, CLEAR
NONE, SEAL, TFHE, PALISADE, OPENFHE, HELIB, LATTIGO, CLEAR
}

public enum ENC_TYPE {
Expand Down Expand Up @@ -48,6 +48,9 @@ public static void main(String[] args) {
} else if (arg.equalsIgnoreCase("-PALISADE") ||
arg.equalsIgnoreCase("--PALISADE")) {
backend_ = HE_BACKEND.PALISADE;
} else if (arg.equalsIgnoreCase("-OPENFHE") ||
arg.equalsIgnoreCase("--OPENFHE")) {
backend_ = HE_BACKEND.OPENFHE;
} else if (arg.equalsIgnoreCase("-HELIB") ||
arg.equalsIgnoreCase("--HELIB")) {
backend_ = HE_BACKEND.HELIB;
Expand Down Expand Up @@ -179,6 +182,14 @@ public static void main(String[] args) {
dsl_compiler = new T2_2_PALISADE_CKKS(symbol_table, config, ring_dim_);
}
break;
case OPENFHE:
if (scheme_ == ENC_TYPE.ENC_INT) {
dsl_compiler = new T2_2_OpenFHE(symbol_table, config, word_sz_, ring_dim_);
} else if (scheme_ == ENC_TYPE.ENC_DOUBLE) {
throw new RuntimeException("TODO.");
// dsl_compiler = new T2_2_OpenFHE_CKKS(symbol_table, config, ring_dim_);
}
break;
case HELIB:
// if (scheme_ == ENC_TYPE.ENC_INT) {
// dsl_compiler = new T2_2_HElib(symbol_table, config, word_sz_,
Expand Down
Loading

0 comments on commit ce7897f

Please sign in to comment.