Dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. FROM ubuntu:16.04
  2. RUN apt update && apt install -y wget git build-essential cmake \
  3. libgmp-dev libprocps4-dev libssl-dev pkg-config sudo \
  4. libboost-all-dev perl
  5. WORKDIR /root
  6. # This is the version of go we used, so we pin it for replicability.
  7. # It's likely newer versions will also work, however.
  8. RUN wget https://golang.org/dl/go1.13.5.linux-amd64.tar.gz
  9. RUN tar -C /usr/local -xzvvf go1.13.5.linux-amd64.tar.gz
  10. RUN cd /usr/local/bin && ln -s ../go/bin/* .
  11. RUN useradd -ms /bin/bash zxad
  12. RUN adduser zxad sudo
  13. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
  14. USER zxad
  15. WORKDIR /home/zxad
  16. # Our version of kyber patched to support hash-to-G2, while our pull
  17. # requests are pending:
  18. # https://github.com/dedis/kyber/pull/424 (merged)
  19. # https://github.com/dedis/kyber/pull/428 (not yet)
  20. RUN git clone git://git-crysp.uwaterloo.ca/zxad/kyber
  21. RUN cd kyber/pairing/bn256 && go test -v ./...
  22. RUN git clone git://git-crysp.uwaterloo.ca/zxad/code
  23. RUN cd code && go get -d ./...
  24. # Replace the downloaded kyber with our version above
  25. RUN cd go/src/go.dedis.ch && rm -rf kyber && ln -s ../../../kyber .
  26. RUN cd code/src && \
  27. for i in */benchmark; do ( cd $i; go build ); done
  28. RUN git clone git://git-crysp.uwaterloo.ca/zxad/snarkcode
  29. RUN cd snarkcode && git submodule update --init --recursive && \
  30. cd libsnark && mkdir build && cd build && cmake -DCURVE=BN128 .. && \
  31. make -j8 && cd ../.. && make -j8 zxad