Thursday, June 30, 2022

[How To] Run HELR (Homomorphic Encryption Logistic Regression) in macOS


HELR is a software project for performing a logistic regression training on encrypted data (Secure Logistic Regression based on Homomorphic Encryption: Design and Evaluation (https://medinform.jmir.org/2018/2/e19/)).


Step 1: brew install GMP

Step 2: brew install NTL

Step 4: cd HELR

Step 5: make new
make clean
rm *.o libHELR.a  || echo nothing to clean
rm: libHELR.a: No such file or directory
nothing to clean
make all
g++ -g -O2 -std=c++11 -pthread -c -I/usr/local/include        Database.cpp  
g++ -g -O2 -std=c++11 -pthread -c -I/usr/local/include        LRtest.cpp  
g++ -g -O2 -std=c++11 -pthread -c -I/usr/local/include        HELR.cpp  
ar -q libHELR.a  Database.o LRtest.o HELR.o
ar: creating archive libHELR.a

Step 6: cp libHELR.a /usr/local/lib/

Step 7: cd src

Step 8: make all
gcc -c -I/usr/local/include -I. -std=c++11 *.cpp
ar rc libheaan.a ../src/*.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libheaan.a(Cipher.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libheaan.a(Message.o) has no symbols

Step 9: g++ -std=c++11 -O2 -I/usr/local/include -pthread Test_HELR.cpp src/libheaan.a libHELR.a -o foo -L/usr/local/lib -lntl -lgmp -lm

Step 10: ./foo data/edint.txt 3 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.