From bff403be3cfb62722a345546110871d9930d0353 Mon Sep 17 00:00:00 2001 From: Juri Dispan Date: Fri, 26 May 2023 10:20:25 +0200 Subject: [PATCH 1/2] Transfer progress from updating frigate from my personal repo to this repo (#67) * switch to python3 * Use updated bison and flex versions * Downgrade back to Ubuntu 18.04 --- frigate/Dockerfile | 15 ++++++++++++--- frigate/README.md | 12 ++++++------ frigate/install.sh | 21 ++++++++++----------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/frigate/Dockerfile b/frigate/Dockerfile index 03018ed..0602eab 100644 --- a/frigate/Dockerfile +++ b/frigate/Dockerfile @@ -1,3 +1,7 @@ +# Unfortunately, no version of Ubuntu > 18.04 is supported. This is because we use +# Semi-Honest-BMR for executing the generated circuit, which does not compile on Ubuntu > 18.04. +# See: https://github.com/cryptobiu/Semi-Honest-BMR/issues/2 + FROM ubuntu:18.04 WORKDIR /root RUN apt-get update && apt-get install -y \ @@ -5,13 +9,18 @@ RUN apt-get update && apt-get install -y \ git \ flex \ make \ - python \ + python3 \ vim \ + flex \ + bison \ + libbison-dev \ wget -ADD source/ /root/source + ADD README.md . +COPY source/frigate.vim /root/source/frigate.vim ADD install.sh . - RUN ["bash", "install.sh"] + +ADD source/ /root/frigaterelease/src/tests CMD ["/bin/bash"] diff --git a/frigate/README.md b/frigate/README.md index ce589e1..ab14314 100644 --- a/frigate/README.md +++ b/frigate/README.md @@ -1,12 +1,12 @@ # Frigate -[Frigate](https://bitbucket.org/bmood/frigaterelease). is a circuit compiler that consumes a novel C-like language and produces a custom Boolean circuit representation for any number of inputs. The fraework emphasizes its use of good software engineering techniques, including a test suite and a focus on modularity and extensibility. The circuit format minimizes file size and the framewor includes an interpreter to efficiently interface between garbled circuits and other applications. +[Frigate](https://bitbucket.org/bmood/frigaterelease) is a circuit compiler that consumes a novel C-like language and produces a custom Boolean circuit representation for any number of inputs. The framework emphasizes its use of good software engineering techniques, including a test suite and a focus on modularity and extensibility. The circuit format minimizes file size and the framework includes an interpreter to efficiently interface between garbled circuits and other applications. -Frigate's type system is simple, with three native types: signed and unsigned integers of arbitrary size and structs. Frigate supports arrays within structs only.aThe compiler provides useful errors and there is documentation of interpreter options and a language desription. +Frigate's type system is simple, with three native types: signed and unsigned integers of arbitrary size and structs. Frigate supports arrays only within structs. The compiler provides useful errors and there is documentation of interpreter options and a language desription. Frigate was developed by Benjamin Mood, Debayan Gupta, Henry Carter, Kevin R. B. Butler, and Patrick Traynor. -Our recommendation: Frigate provides an expressive C-like language for fast circuit generation and is a good way to estimate circuit size for a given computaion. However, we note that linking Frigate to an implementaiton wil require additional work by the user. +Our recommendation: Frigate provides an expressive C-like language for fast circuit generation and is a good way to estimate circuit size for a given computaion. However, we note that linking Frigate to an implementation will require additional work by the user. ## Docker setup Create a Docker image. This will take a moment. You only have to do this once. @@ -21,12 +21,12 @@ $ docker run -it --rm frigate ## Architecture Frigate is a circuit compiler. Compiling the code provides an executable that -converts `.wir` files to circuits, in a special compressed frigate format. There +converts `.wir` files to circuits in a special compressed frigate format. There is also an option to produce output in other formats (e.g. gate by gate). Since Frigate does not have a way to evaluate these circuits we have also -included in the docker the BMR implementation developed by Bar-Ilan Cryptography -Research Group which can be used to securely evaluate circuits. +included the BMR implementation developed by Bar-Ilan Cryptography +Research Group in the Docker container, which can be used to securely evaluate circuits. The implementation is available [on Github](https://github.com/cryptobiu/Semi-Honest-BMR). It is based on the paper "[Optimizing Semi-Homest Secure Multiparty Computation for the Internet](https://eprint.iacr.org/2016/1066.pdf)" by Aner Ben-Afraim, Yehuda Lindell and Eran Omri. diff --git a/frigate/install.sh b/frigate/install.sh index 1777254..b997cd8 100644 --- a/frigate/install.sh +++ b/frigate/install.sh @@ -1,13 +1,15 @@ +set -ex -# install bison dependencies -wget http://ftp.br.debian.org/debian/pool/main/b/bison/libbison-dev_3.6.3+dfsg-1_amd64.deb -dpkg -i libbison-dev_3.6.3+dfsg-1_amd64.deb - -wget http://ftp.br.debian.org/debian/pool/main/b/bison/bison_3.6.3+dfsg-1_amd64.deb -dpkg -i bison_3.6.3+dfsg-1_amd64.deb -rm libbison-dev_3.6.3+dfsg-1_amd64.deb -rm bison_3.6.3+dfsg-1_amd64.deb +# install bison dependencies +#wget http://ftp.br.debian.org/debian/pool/main/b/bison/libbison-dev_3.6.3+dfsg-1_amd64.deb +#dpkg -i libbison-dev_3.6.3+dfsg-1_amd64.deb +# +#wget http://ftp.br.debian.org/debian/pool/main/b/bison/bison_3.6.3+dfsg-1_amd64.deb +#dpkg -i bison_3.6.3+dfsg-1_amd64.deb +# +#rm libbison-dev_3.6.3+dfsg-1_amd64.deb +#rm bison_3.6.3+dfsg-1_amd64.deb # install frigate git clone https://bitbucket.org/bmood/frigaterelease.git @@ -16,9 +18,6 @@ cd frigaterelease/src make cp frigate /bin/ -# copy our examples -cp -r ~/source/* tests - # add a vim syntax file :) cd mkdir -p .vim/syntax From 84c41ff8adc94cb39a150fee6180c6909c993b41 Mon Sep 17 00:00:00 2001 From: Juri Dispan Date: Wed, 11 Oct 2023 19:47:40 +0200 Subject: [PATCH 2/2] try to build frigate --- frigate/Dockerfile | 3 --- frigate/install.sh | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frigate/Dockerfile b/frigate/Dockerfile index 0602eab..89af1ac 100644 --- a/frigate/Dockerfile +++ b/frigate/Dockerfile @@ -11,9 +11,6 @@ RUN apt-get update && apt-get install -y \ make \ python3 \ vim \ - flex \ - bison \ - libbison-dev \ wget ADD README.md . diff --git a/frigate/install.sh b/frigate/install.sh index b997cd8..fc4d64c 100644 --- a/frigate/install.sh +++ b/frigate/install.sh @@ -11,6 +11,11 @@ set -ex #rm libbison-dev_3.6.3+dfsg-1_amd64.deb #rm bison_3.6.3+dfsg-1_amd64.deb +wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb +wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb +dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb +dpkg -i bison_2.7.1.dfsg-1_amd64.deb + # install frigate git clone https://bitbucket.org/bmood/frigaterelease.git cd frigaterelease/src