BMR, Use your Brain, Semi/Semi2k.

This commit is contained in:
Marcel Keller
2019-04-30 17:24:11 +10:00
parent 9cde9548d2
commit b5d8123ae0
214 changed files with 4233 additions and 1550 deletions

10
Scripts/brain.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
export PLAYERS=3
. $HERE/run-common.sh
run_player brain-party.x $* || exit 1

View File

@@ -4,10 +4,11 @@ function build
{
echo ARCH = $1 >> CONFIG.mine
echo GDEBUG = >> CONFIG.mine
echo MOD = -DMAX_MOD_SZ=4 >> CONFIG.mine
make clean
rm -R static
mkdir static
make -j 12 static-release
make -j 4 static-release
mkdir bin
dest=bin/`uname`-$2
rm -R $dest
@@ -15,6 +16,5 @@ function build
strip $dest/*
}
build '' amd64
build '-msse4.1 -maes -mpclmul' aes
build '-msse4.1 -maes -mpclmul -mavx -mavx2 -mbmi2' avx2
build '-maes -mpclmul -DCHECK_AES -DCHECK_PCLMUL -DCHECK_AVX' amd64
build '-msse4.1 -maes -mpclmul -mavx -mavx2 -mbmi2 -madx -DCHECK_ADX' avx2

8
Scripts/fake-spdz-real-bmr.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
. $HERE/run-common.sh
run_player real-bmr-party.x $* -F || exit 1

10
Scripts/mal-rep-bmr.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
export PLAYERS=${PLAYERS:-3}
. $HERE/run-common.sh
run_player mal-rep-bmr-party.x $* || exit 1

10
Scripts/mal-shamir-bmr.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
export PLAYERS=${PLAYERS:-3}
. $HERE/run-common.sh
run_player mal-shamir-bmr-party.x $* || exit 1

8
Scripts/real-bmr.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
. $HERE/run-common.sh
run_player real-bmr-party.x $* || exit 1

10
Scripts/rep-bmr.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
export PLAYERS=${PLAYERS:-3}
. $HERE/run-common.sh
run_player rep-bmr-party.x $* || exit 1

View File

@@ -7,4 +7,4 @@ export PLAYERS=3
. $HERE/run-common.sh
run_player replicated-ring-party.x ${1:-test_all} || exit 1
run_player replicated-ring-party.x $* || exit 1

View File

@@ -18,7 +18,7 @@ run_player() {
fi
if [[ $bin = Player-Online.x || $bin =~ 'party.x' ]]; then
params="$* -pn $port -h localhost"
if [[ ! $bin =~ 'rep' ]]; then
if [[ ! ($bin =~ 'rep' || $bin =~ 'brain') ]]; then
params="$params -N $players"
fi
else
@@ -33,7 +33,6 @@ run_player() {
fi
rem=$(($players - 2))
for i in $(seq 0 $rem); do
echo "trying with player $i"
>&2 echo Running $prefix $SPDZROOT/$bin $i $params
log=$SPDZROOT/logs/$i
$prefix $SPDZROOT/$bin $i $params 2>&1 |

12
Scripts/semi.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
bits=${2:-128}
g=${3:-0}
mem=${4:-empty}
. $HERE/run-common.sh
run_player semi-party.x ${1:-test_all} -lgp ${bits} -lg2 ${g} -m ${mem} || exit 1

8
Scripts/semi2k.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
. $HERE/run-common.sh
run_player semi2k-party.x $* || exit 1

10
Scripts/shamir-bmr.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
HERE=$(cd `dirname $0`; pwd)
SPDZROOT=$HERE/..
export PLAYERS=${PLAYERS:-3}
. $HERE/run-common.sh
run_player shamir-bmr-party.x $* || exit 1

28
Scripts/test_tutorial.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
for i in 0 1; do
seq 3 > Player-Data/Input-P$i-0
done
function test
{
Scripts/$1.sh tutorial | grep 'expected -0.2, got -0.2' || exit 1
}
./compile.py tutorial
for i in rep-field mal-rep-field shamir mal-shamir semi mascot; do
test $i
done
./compile.py -R 64 tutorial
for i in ring brain semi2k spdz2k; do
test $i
done
./compile.py -B 16 tutorial
for i in replicated yao rep-bmr mal-rep-bmr shamir-bmr mal-shamir-bmr; do
test $i
done

View File

@@ -23,8 +23,6 @@ fi
if test "$flags"; then
if $flags | grep -q avx2; then
cpu=avx2
elif $flags | grep -q aes; then
cpu=aes
else
cpu=amd64
fi

View File

@@ -6,7 +6,7 @@ for i in 0 1; do
IFS=""
log="yao-$*-$i"
IFS=" "
$prefix ./yao-player.x -p $i $* | tee -a logs/$log & true
$prefix ./yao-player.x -p $i $* 2>&1 | tee -a logs/$log & true
done
wait || exit 1