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

thumbnail


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 

This guide builds and runs HELR on macOS, a project that trains a logistic regression model on encrypted data using homomorphic encryption, based on the referenced research, beginning with dependencies such as GMP through Homebrew.

Training on encrypted data lets a model learn without the raw inputs ever being exposed, which matters for sensitive domains like health records. The native build prerequisites are the main hurdle to getting it running.

Comments

Popular posts from this blog

[Solved] Error: No such keg: /usr/local/Cellar/gcc

[How To] Unfollow Non-followers on Instagram