mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-08 21:18:03 -05:00
66 lines
1.8 KiB
Plaintext
66 lines
1.8 KiB
Plaintext
ROOT = .
|
|
|
|
OPTIM= -O3
|
|
#PROF = -pg
|
|
#DEBUG = -DDEBUG
|
|
#MEMPROTECT = -DMEMPROTECT
|
|
GDEBUG = -g
|
|
|
|
# set this to your preferred local storage directory
|
|
PREP_DIR = '-DPREP_DIR="Player-Data/"'
|
|
|
|
# set for SHE preprocessing (SPDZ and Overdrive)
|
|
USE_NTL = 0
|
|
|
|
# set for using GF(2^128) online phase, OT, MASCOT, or BMR
|
|
# unset for GF(2^40) online and offline phase
|
|
USE_GF2N_LONG = 1
|
|
|
|
# set to -march=<architecture> for optimization
|
|
# SSE4.2 is required homomorphic encryption in GF(2^n) when compiling with clang
|
|
# AES-NI is required for BMR
|
|
# PCLMUL is required for GF(2^128) computation
|
|
# AVX2 support (Haswell or later) is used to optimize OT
|
|
# AVX/AVX2 is required for replicated binary secret sharing
|
|
# BMI2 is used to optimize multiplication modulo a prime
|
|
# ADX is used to optimize big integer additions
|
|
ARCH = -mtune=native -msse4.1 -msse4.2 -maes -mpclmul -mavx -mavx2 -mbmi2 -madx
|
|
|
|
# allow to set compiler in CONFIG.mine
|
|
CXX = g++
|
|
|
|
# use CONFIG.mine to overwrite DIR settings
|
|
-include CONFIG.mine
|
|
|
|
ifeq ($(USE_GF2N_LONG),1)
|
|
GF2N_LONG = -DUSE_GF2N_LONG
|
|
endif
|
|
|
|
# MAX_MOD_SZ (for FHE) must be least and GFP_MOD_SZ (for computation)
|
|
# must be exactly ceil(len(p)/len(word)) for the relevant prime p
|
|
# Default for GFP_MOD_SZ is 2, which is good for 128-bit p
|
|
# Default for MAX_MOD_SZ is 10, which suffices for all Overdrive protocols
|
|
# MOD = -DMAX_MOD_SZ=10 -DGFP_MOD_SZ=2
|
|
|
|
LDLIBS = -lmpirxx -lmpir -lsodium $(MY_LDLIBS)
|
|
LDLIBS += -lboost_system -lssl -lcrypto
|
|
|
|
ifeq ($(USE_NTL),1)
|
|
LDLIBS := -lntl $(LDLIBS)
|
|
endif
|
|
|
|
OS := $(shell uname -s)
|
|
ifeq ($(OS), Linux)
|
|
LDLIBS += -lrt
|
|
endif
|
|
|
|
ifeq ($(OS), Darwin)
|
|
BOOST = -lboost_thread-mt $(MY_BOOST)
|
|
else
|
|
BOOST = -lboost_thread $(MY_BOOST)
|
|
endif
|
|
|
|
CFLAGS += $(ARCH) $(MY_CFLAGS) $(GDEBUG) -Wextra -Wall $(OPTIM) -I$(ROOT) -pthread $(PROF) $(DEBUG) $(MOD) $(MEMPROTECT) $(GF2N_LONG) $(PREP_DIR) -std=c++11 -Werror
|
|
CPPFLAGS = $(CFLAGS)
|
|
LD = $(CXX)
|