-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Cerebro Documentation #1
base: master
Are you sure you want to change the base?
Changes from all commits
473cd28
ea68df1
b0566a0
36044e3
f3d5537
c4022a6
b2e6fce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,6 @@ Prerequisite Libraries: | |
* Crypto ++ (tested with version 7.0) | ||
|
||
|
||
|
||
Setup Steps for SCALE-MAMBA | ||
***************************** | ||
* After installing the libraries, go to CONFIG.mine and change the entry corresponding with ``ROOT`` to point to the current path of where the SCALE-MAMBA directory is. Also, change the entry corresponding with ``OSSL`` to have it point to the installed OpenSSL directory. | ||
* Run ``make progs`` and SCALE-MAMBA should compile. | ||
* Create a config file with all the servers participating in the multiparty computation. Line i should have the IP address of the i'th server. | ||
* Go to mc2/Config and run the script gen_cert.py and pass in the previously made config file along with the number of parties participating. | ||
* Additionally, run ``python mc2/Config/make_config.py`` which sets up the Network configuration for SCALE-MAMBA to use. | ||
* Then in mc2/SCALE-MAMBA, run the command: ``echo '2 1 p' > ./Setup.x`` where p is the length of the prime in terms of number of bits used in the secure computation. | ||
|
||
|
||
EMP-AGMPC | ||
################ | ||
Prerequisite Libraries: | ||
|
@@ -47,24 +36,63 @@ Prerequisite Libraries: | |
* cd into emp-tool and run ``cmake . && make && sudo make install``. | ||
* emp-ot: Installation instructions are here: https://github.com/emp-toolkit/emp-ot | ||
* After installing emp-toolkit, just cd into emp-ot and run ``cmake . && make && sudo make install``. | ||
|
||
Setup Steps for EMP-AGMPC | ||
*************************** | ||
* The make_config.py script should have set up all the network parameters inside emp-agmpc/emp-agmpc/cmpc_config.h, but if not, you'll have to manually input the IP's of each server. | ||
* IP[i] will hold the IP address of the ith server. | ||
* Note that everything here is 1-indexed so the first server goes into IP[1]. | ||
* Run ``cmake . && make`` | ||
|
||
|
||
Alternatives | ||
*************************** | ||
* Alternatively, you can pull the docker image from here: ``docker pull rdeng2614/cerebro:initial_image`` which has all the dependencies installed. Then, you can clone the cerebro repository and directly start setting up from there. | ||
Alternatively, we provide a Dockerfile that installs Cerebro as well as its dependencies. | ||
|
||
|
||
Docker Setup | ||
************** | ||
* In the Cerebro repository, under ``Docker/`` are two files: `Dockerfile` and `requirements.txt` | ||
* Place the two files in the same directory. | ||
* In that directory, run ``docker build -t name_of_image``. | ||
|
||
Testing | ||
*************************** | ||
* Included with Cerebro are a set of tests for both SCALE-MAMBA and emp-agmpc. | ||
After creating the image, run it. You should be in ``/root``, the directory Cerebro was installed in. | ||
|
||
Complete the setup steps for your desired backend. | ||
|
||
Setup Steps for SCALE-MAMBA | ||
***************************** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For these setup instructions, it would be good to put the instructions in code blocks, instead of in text. This way, a user can just copy and paste the commands into shell and run them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want text/explanations at all? I can remove the text section if you don't want it. I will add a section that has purely shell commands which will set everything up if copy pasted into the shell. Some commands might be a bit cryptic though. |
||
* Go to ``cerebro/crypto_backend/SCALE-MAMBA``. | ||
* Copy ``CONFIG`` into ``CONFIG.mine`` (i.e ``cp CONFIG CONFIG.mine``). | ||
* Go to ``CONFIG.mine`` and change the entry corresponding with ``ROOT`` to point to the current path of where the SCALE-MAMBA directory is (most likely ``/root/cerebro/crypto_backend/SCALE-MAMBA``). Also, change the entry corresponding with ``OSSL`` to have it point to the installed OpenSSL directory (most likely ``/usr/lib/ssl``) | ||
* Run ``make progs`` and SCALE-MAMBA should compile. | ||
* Go to ``cerebro``. Then do ``python Config/gen_cert.py n`` where ``n`` is the number of parties you want to compute with. For the tests (described below) to work, we require ``n`` to be ``2``. | ||
* This will generate certificates for the root and the ``n`` parties. The first certificate is the the root's certificate. The following certificates are for the parties. For simplicity, make sure to set the ``Common Name`` of the root as ``RootCA``. Set the ``Common Name`` of the ``i``th party to ``Player(i-1)`` (e.g. ``Player0`` for the first party). | ||
* Go to ``cerebro/crypto_backend/SCALE-MAMBA`` and run ``./Setup.x``. | ||
* First, let's setup ``Certs`` (i.e enter ``1``). | ||
* For the root, enter the name you gave your root (e.g. ``RootCA``). For the number of players, enter ``n`` (e.g. ``2``). Then, for each player, input an IP address (for testing, input ``127.0.0.1``). For the name of certificate, use the common name you gave your parties appended with ``.crt`` (e.g. ``Player0.crt`` and ``Player1.crt``). This should produce ``NetworkData.txt`` under ``Data``. | ||
* Next, run ``./Setup.x``, and setup secret sharing. Choose full threshold. Let it find the prime for LSSS. For the modulus, for simplicity, enter 128. You can choose a different number if you want. The number you can choose is limited by ``MAX_MOD`` in ``CONFIG.mine``; you can't use more than 2 to the ``MAX_MOD`` bits. You can configure ``MAX_MOD`` if you want. | ||
* Finally, run ``./Setup.x``, and setup the convversion circuit. | ||
|
||
Testing for SCALE-MAMBA | ||
************************* | ||
* To run the tests with SCALE-MAMBA, run ``cd mc2/crypto_backend/SCALE-MAMBA`` and then run ``python test_scripts/test_scale_mamba.py``. | ||
* Troubleshooting | ||
* Try editing ``test_scripts/test_scale_mamba.py`` such that in ``run_online`` when running ``./Player.x 0 ...`` and ``./Player.x 1 ..``, you add a flag ``-max 5000,5000,5000``. This limits the numbers of triples that can be generated to 5000. | ||
* Edit ``Data/NetworkData.txt`` such that the last two lines (which should be zeros) are ones. This uses a fake online phase so it sacrifices security for speed. However, for testing purposes, this is okay. | ||
|
||
Resources | ||
********** | ||
* SCALE-MAMBA repository | ||
|
||
|
||
EMP-AGMPC | ||
################ | ||
|
||
Setup Steps for EMP-AGMPC | ||
*************************** | ||
* Navigate to ``cerebro/crypto_backend/emp-toolkit/emp-agmpc/emp-agmpc``. Edit the file ``cmpc_config.h``. You can set ``NUM_PARTY_FOR_RUNNING`` to configure the number of parties in your computation. Then, edit ``IP`` such that the ``i``th index holds the IP address of the ``i``th party. For example, ``IP[1]`` holds the IP address for party 1, ``IP[2]`` holds the IP address for party 2, etc. Also, make sure that the 0th index and the last index of ``IP`` contains ``""``. So if ``NUM_PARTY_FOR_RUNNING`` is 3, for example, ``IP[0]`` and ``IP[4]`` hold ``""``. | ||
* For the tests, we require ``NUM_PARTY_FOR_RUNNING`` to be 2 and every party's IP address to be ``127.0.0.1``. | ||
* Run ``cmake . && make`` | ||
|
||
Testing for EMP-AGMPC | ||
*********************** | ||
* To run the tests with emp-agmpc, run ``cd mc2/crypto_backend/emp-toolkit/emp-agmpc`` and then run ``python test_scripts/test_gc.py``. | ||
|
||
Resources | ||
*********** | ||
* emp-agmpc repository | ||
* emp-tool repository | ||
* emp-ot repository | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably be kept as well.