diff --git a/.github/build_containers.sh b/.github/build_containers.sh new file mode 100755 index 0000000..e250820 --- /dev/null +++ b/.github/build_containers.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -ex + +CONTAINERS=$@ + +if [ -z "$CONTAINERS" ]; then + echo "Nothing to do!" + exit 0 +fi + +for dirname in $CONTAINERS; do + echo "building container from directory $dirname" + cd "$dirname" + docker build . --tag "$dirname" + cd .. +done + +echo "successfully built $CONTAINERS" diff --git a/.github/workflows/test-aby.yml b/.github/workflows/test-aby.yml new file mode 100644 index 0000000..c825aef --- /dev/null +++ b/.github/workflows/test-aby.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for ABY + +on: + push: + branches: [ master ] + paths: + - aby/* + pull_request: + branches: [ master ] + paths: + - aby/* + +jobs: + build: + name: Build container for ABY + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: aby + tags: aby + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-cbmc-gc.yml b/.github/workflows/test-cbmc-gc.yml new file mode 100644 index 0000000..f7df05b --- /dev/null +++ b/.github/workflows/test-cbmc-gc.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for CBMC-GC + +on: + push: + branches: [ master ] + paths: + - cbmc-gc/* + pull_request: + branches: [ master ] + paths: + - cbmc-gc/* + +jobs: + build: + name: Build container for cbmc-gc + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: cbmc-gc + tags: cbmc-gc + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-emp.yml b/.github/workflows/test-emp.yml new file mode 100644 index 0000000..ee7e641 --- /dev/null +++ b/.github/workflows/test-emp.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for EMP + +on: + push: + branches: [ master ] + paths: + - emp/* + pull_request: + branches: [ master ] + paths: + - emp/* + +jobs: + build: + name: Build container for EMP + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: emp + tags: emp + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-jiff.yml b/.github/workflows/test-jiff.yml new file mode 100644 index 0000000..03d6680 --- /dev/null +++ b/.github/workflows/test-jiff.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for Jiff + +on: + push: + branches: [ master ] + paths: + - jiff/* + pull_request: + branches: [ master ] + paths: + - jiff/* + +jobs: + build: + name: Build container for Jiff + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: jiff + tags: jiff + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-mp-spdz.yml b/.github/workflows/test-mp-spdz.yml new file mode 100644 index 0000000..d636cdd --- /dev/null +++ b/.github/workflows/test-mp-spdz.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for MP-SPDZ + +on: + push: + branches: [ master ] + paths: + - mp-spdz/* + pull_request: + branches: [ master ] + paths: + - mp-spdz/* + +jobs: + build: + name: Build container for MP-SPDZ + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: mp-spdz + tags: mp-spdz + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-mpyc.yml b/.github/workflows/test-mpyc.yml new file mode 100644 index 0000000..8ace49f --- /dev/null +++ b/.github/workflows/test-mpyc.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for MPyC + +on: + push: + branches: [ master ] + paths: + - mpyc/* + pull_request: + branches: [ master ] + paths: + - mpyc/* + +jobs: + build: + name: Build container for MPyC + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: mpyc + tags: mpyc + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-obliv-c.yml b/.github/workflows/test-obliv-c.yml new file mode 100644 index 0000000..e062fff --- /dev/null +++ b/.github/workflows/test-obliv-c.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for Obliv-C + +on: + push: + branches: [ master ] + paths: + - obliv-c/* + pull_request: + branches: [ master ] + paths: + - obliv-c/* + +jobs: + build: + name: Build container for obliv-c + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: obliv-c + tags: obliv-c + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-oblivm.yml b/.github/workflows/test-oblivm.yml new file mode 100644 index 0000000..7cd9aa8 --- /dev/null +++ b/.github/workflows/test-oblivm.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for ObliVM + +on: + push: + branches: [ master ] + paths: + - oblivm/* + pull_request: + branches: [ master ] + paths: + - oblivm/* + +jobs: + build: + name: Build container for oblivm + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: oblivm + tags: oblivm + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-picco.yml b/.github/workflows/test-picco.yml new file mode 100644 index 0000000..6898945 --- /dev/null +++ b/.github/workflows/test-picco.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for Picco + +on: + push: + branches: [ master ] + paths: + - picco/* + pull_request: + branches: [ master ] + paths: + - picco/* + +jobs: + build: + name: Build container for Picco + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: picco + tags: picco + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-scalemamba.yml b/.github/workflows/test-scalemamba.yml new file mode 100644 index 0000000..b9e6f54 --- /dev/null +++ b/.github/workflows/test-scalemamba.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for SCALE-Mamba + +on: + push: + branches: [ master ] + paths: + - scalemamba/* + pull_request: + branches: [ master ] + paths: + - scalemamba/* + +jobs: + build: + name: Build container for SCALE-Mamba + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: scalemamba + tags: scalemamba + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/.github/workflows/test-spdz.yml b/.github/workflows/test-spdz.yml new file mode 100644 index 0000000..7e43df4 --- /dev/null +++ b/.github/workflows/test-spdz.yml @@ -0,0 +1,28 @@ +name: Build and test the Docker container for SPDZ-2 + +on: + push: + branches: [ master ] + paths: + - spdz/* + pull_request: + branches: [ master ] + paths: + - spdz/* + +jobs: + build: + name: Build container for SPDZ-2 + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + context: spdz + tags: spdz + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + push: false diff --git a/aby/install.sh b/aby/install.sh index 0e11b03..e9147d3 100644 --- a/aby/install.sh +++ b/aby/install.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # get ABY git clone --recursive https://github.com/encryptogroup/ABY.git cd ABY @@ -17,5 +19,5 @@ cp ~/source/geninput.py src/examples/ # build ABY mkdir build && cd build cmake -DABY_BUILD_EXE=On .. -make +make -j diff --git a/cbmc-gc/install.sh b/cbmc-gc/install.sh index 513ece4..487f363 100644 --- a/cbmc-gc/install.sh +++ b/cbmc-gc/install.sh @@ -9,9 +9,7 @@ git checkout -b MPCSOK e57333b19484 # make and install cmbc-gc executables make minisat2-download -make +make -j2 cp bin/cbmc* /usr/bin/ cp bin/circuit* /usr/bin/ - - diff --git a/emp/install.sh b/emp/install.sh index af94106..505c196 100644 --- a/emp/install.sh +++ b/emp/install.sh @@ -1,8 +1,8 @@ #!/bin/bash +set -e + wget https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.py # We don't set "-install" because our docker image already comes with the necessary dependencies. # See: https://github.com/emp-toolkit/emp-readme/blob/master/scripts/install.py#L12 python3 install.py -install --tool --ot --sh2pc --ag2pc - - diff --git a/jiff/README.md b/jiff/README.md index b1afd85..e419466 100644 --- a/jiff/README.md +++ b/jiff/README.md @@ -4,14 +4,13 @@ ## Docker setup -Create a Docker image. This will take a few minutes. You only have to do this -once. +Create a Docker image. This will take a few minutes. You only have to do this once. ``` -$ docker build -t jiff . +docker build -t jiff . ``` Spin up a Docker container from the image. ``` -$ docker run -it --rm jiff +docker run -it --rm jiff ``` Please note that any changes you make in the container are not persistent. @@ -38,15 +37,15 @@ Run the Docker container. We implemented three examples, `mult3`, `innerprod`, a To run tests, execute ``` -$ cd ~/jiff -$ npm run-script test-demo -- demos/ +cd ~/jiff +npm run-script test-demo -- demos/ ``` Note that the `xtabs` test is relatively slow to execute. To run interactively in the browser, first run the server node ``` -$ cd ~/jiff -$ node demos//server.js +cd ~/jiff +node demos//server.js ``` This starts a server on the Docker localhost. To find the correct IP address, find the docker container name and inspect it to find the correct IP. Run this on your host machine (not in your Docker container): diff --git a/mp-spdz/install.sh b/mp-spdz/install.sh index 8830f32..f48dfd9 100755 --- a/mp-spdz/install.sh +++ b/mp-spdz/install.sh @@ -12,7 +12,7 @@ if [ $fromsource = "yes" ]; then git checkout v$MP_SPDZ_VERSION make setup - make all + make all -j else curl -L https://github.com/data61/MP-SPDZ/releases/download/v$MP_SPDZ_VERSION/mp-spdz-$MP_SPDZ_VERSION.tar.xz | tar xJv mv mp-spdz-$MP_SPDZ_VERSION MP-SPDZ diff --git a/mpyc/requirements.txt b/mpyc/requirements.txt index 52b8877..fb011a8 100644 --- a/mpyc/requirements.txt +++ b/mpyc/requirements.txt @@ -1,3 +1,3 @@ mpyc==0.9 gmpy2 -numpy \ No newline at end of file +numpy diff --git a/obliv-c/install.sh b/obliv-c/install.sh index 2a40b30..c2b73ae 100644 --- a/obliv-c/install.sh +++ b/obliv-c/install.sh @@ -1,4 +1,5 @@ #!/bin/sh + set -ex git clone https://github.com/samee/obliv-c diff --git a/oblivm/install.sh b/oblivm/install.sh index 46b4b2c..ee1d305 100644 --- a/oblivm/install.sh +++ b/oblivm/install.sh @@ -10,3 +10,4 @@ git checkout -b MPCSOK 50ed0fbb556a157c0c85440dabf141a3cf7384c5 patch -p1 < ../real.patch ./compile.sh + diff --git a/picco/install_examples.sh b/picco/install_examples.sh index 3ee293a..3ffbbb1 100644 --- a/picco/install_examples.sh +++ b/picco/install_examples.sh @@ -10,5 +10,5 @@ for DIR in mult3 innerprod xtabs; do ln -s /root/keys secure_server/keys ln -s /root/picco/compute/smc-compute smc-compute picco $DIR.c smc_config $DIR utility_config - make + make -j done diff --git a/scalemamba/install.sh b/scalemamba/install.sh index 634a398..0db16f2 100644 --- a/scalemamba/install.sh +++ b/scalemamba/install.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -ex @@ -7,7 +9,7 @@ git clone https://github.com/KULeuven-COSIC/SCALE-MAMBA.git cd SCALE-MAMBA git checkout -b v1.14 c111516e3ebc1efd12a2bd47dd2122b160e13d1e cp /root/source/CONFIG.mine . -make progs +make progs -j # set up certificate authority touch ~/.rnd # see: https://github.com/openssl/openssl/issues/7754 diff --git a/spdz/install.sh b/spdz/install.sh index ab741e4..e74cee5 100644 --- a/spdz/install.sh +++ b/spdz/install.sh @@ -6,13 +6,11 @@ set -ex git clone https://github.com/bristolcrypto/SPDZ-2 cd SPDZ-2 git checkout v0.0.3 -echo USE_NTL = 1 >> CONFIG.mine -echo MOD = -DMAX_MOD_SZ=6 >> CONFIG.mine -echo ARCH = -march=native >> CONFIG.mine +{ echo USE_NTL = 1; echo MOD = -DMAX_MOD_SZ=6; echo ARCH = -march=native; } >> CONFIG.mine sed -i s/-Werror//g CONFIG # needed because recent versions of gcc cannot compile SPDZ w/o warnings. sed -i s/python/python2/g compile.py # The command is now called "python2" instead of "python". -make -j8 +make -j mkdir Player-Data