From e9bb4de55603696191866e7c009ef3f2aecf19d7 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 14 May 2023 18:29:07 +0200 Subject: [PATCH] Switch to mod 2^k domain and use encrypted channels --- src/CONFIG.mine | 1 + src/Makefile | 13 ++++++++----- src/config.patch | 12 ------------ src/gale_shapley.mpc | 3 --- src/run.sh | 2 +- 5 files changed, 10 insertions(+), 21 deletions(-) create mode 100644 src/CONFIG.mine delete mode 100644 src/config.patch diff --git a/src/CONFIG.mine b/src/CONFIG.mine new file mode 100644 index 0000000..67b2701 --- /dev/null +++ b/src/CONFIG.mine @@ -0,0 +1 @@ +ARCH = -mtune=native -msse4.1 -msse4.2 -maes -mpclmul -mavx -mavx2 -mbmi2 -madx diff --git a/src/Makefile b/src/Makefile index 4271aa8..e6fd6cc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,10 +1,10 @@ MP_SPDZ_PATH := $(CURDIR)/MP-SPDZ -all: patch deps - $(MAKE) -C $(MP_SPDZ_PATH) all +all: config deps ssl + $(MAKE) -C $(MP_SPDZ_PATH) semi2k-party.x -patch: - -git -C $(MP_SPDZ_PATH) apply $(CURDIR)/config.patch +config: + cp -f $(CURDIR)/CONFIG.mine $(MP_SPDZ_PATH)/CONFIG.mine deps: patch sudo apt install automake build-essential clang cmake git libntl-dev \ @@ -12,8 +12,11 @@ deps: patch $(MAKE) -C $(MP_SPDZ_PATH) boost $(MAKE) -C $(MP_SPDZ_PATH) libote mpir +ssl: + cd $(MP_SPDZ_PATH) && Scripts/setup-ssl.sh 3 + %.mpc: _phony - python3 $(MP_SPDZ_PATH)/compile.py $@ + python3 $(MP_SPDZ_PATH)/compile.py -R 64 $@ %: $(MAKE) -C $(MP_SPDZ_PATH) $@ diff --git a/src/config.patch b/src/config.patch deleted file mode 100644 index 3641eb4..0000000 --- a/src/config.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CONFIG b/CONFIG -index 6d5f0f17..217471f7 100644 ---- a/CONFIG -+++ b/CONFIG -@@ -28,7 +28,6 @@ USE_GF2N_LONG = 1 - # ADX is used to optimize big integer additions - # delete the second line to compile for a platform that supports everything - ARCH = -mtune=native -msse4.1 -msse4.2 -maes -mpclmul -mavx -mavx2 -mbmi2 -madx --ARCH = -march=native - - MACHINE := $(shell uname -m) - ARM := $(shell uname -m | grep x86; echo $$?) diff --git a/src/gale_shapley.mpc b/src/gale_shapley.mpc index cbf0648..54e0519 100644 --- a/src/gale_shapley.mpc +++ b/src/gale_shapley.mpc @@ -9,9 +9,6 @@ from Compiler.oram import OptimalORAM from Compiler.library import for_range, do_while, time, if_, print_ln, crash, print_str, break_loop from Compiler.gs import OMatrix, OStack -# Optimizations -program.use_edabit(True) - class Matchmaker: """ diff --git a/src/run.sh b/src/run.sh index 688cc03..9b37141 100755 --- a/src/run.sh +++ b/src/run.sh @@ -8,5 +8,5 @@ if [[ $1 == "-k" ]]; then fi for i in $(seq 0 2); do - ./semi-party.x -N 3 -p "$i" gale_shapley > "../out-p$i.txt" 2>&1 & + ./semi2k-party.x -N 3 -p "$i" -e gale_shapley > "../out-p$i.txt" 2>&1 & done