Commit 2dbf569c authored by Jack Doerner's avatar Jack Doerner

updated README

parent 7f284524
# MPECDSA
This repository contains a implementations of the 2-of-n threshold ECDSA protocol described in
[_Secure Two-party Threshold ECDSA from ECDSA assumptions_](https://eprint.iacr.org/2018/499) and the t-of-n threshold ECDSA protocol described in _Threshold ECDSA from ECDSA Assumptions_, both papers by Jack Doerner, Yashvanth Kondi, Eysa Lee, and abhi shelat.
[_Secure Two-party Threshold ECDSA from ECDSA assumptions_](https://eprint.iacr.org/2018/499) and the t-of-n threshold ECDSA protocol described in [_Threshold ECDSA from ECDSA Assumptions_](https://eprint.iacr.org/2019/523), both papers by Jack Doerner, Yashvanth Kondi, Eysa Lee, and abhi shelat.
## How to compile on Linux
......@@ -15,7 +15,7 @@ $ git clone --recurse-submodules https://gitlab.com/neucrypt/mpecdsa.git
```
Alternatively, submodules may be initialized after cloning via
```
git submodule init; git submodule update
$ git submodule init; git submodule update
```
To compile, run
```
......@@ -25,47 +25,40 @@ Finally, the included test cases can be run via
```
$ cargo test
```
### How to compile on MacOS
Our protocol requires the [```openmp```](https://www.openmp.org/) compiler feature, which is provided by ```gcc```, but not by ```clang```. The easiest way to compile on MacOS is to install ```gcc``` via either [MacPorts](https://www.macports.org/) or [Brew](https://brew.sh/) and then to make the following changes:
1. Replace ```gcc``` with the full path to your new gcc binary in line 13 of ```build.rs```. For example,
```
Command::new("/usr/local/bin/gcc-7").args(&["src/sha256_octa.c", "-c", "-mavx2", "-O3", "-fPIC", "-fopenmp", "-Wa,-q", "-o"])
```
### How to compile on MacOS
2. Prepend ```CC=<gcc path>``` to your cargo commands. For example,
Some parts of this project are written in C and require the [```openmp```](https://www.openmp.org/) compiler feature, which is provided by ```gcc```, but not by ```clang```. The easiest way to compile on MacOS is to install ```gcc``` via either [MacPorts](https://www.macports.org/) or [Brew](https://brew.sh/) and then prepend ```CC=<gcc path>``` to your cargo commands. For example,
```
$ CC=/usr/local/bin/gcc-7 cargo build --release
```
```
$ CC=/usr/local/bin/gcc-7 cargo build --release
```
### How to cross-compile for Linux on Macos
### How to cross-compile for Linux on MacOs
This allows you to produce a statically-linked executable for Linux from MacOS.
```
brew install FiloSottile/musl-cross/musl-cross
brew install isl
install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/cc1
ab2017:mpecdsa_private abhi$ install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/cc1plus
ab2017:mpecdsa_private abhi$ install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/lto1
$ brew install FiloSottile/musl-cross/musl-cross
$ brew install isl
$ install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/cc1
$ install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/cc1plus
$ install_name_tool -change '@@[email protected]@/opt/isl/lib/libisl.15.dylib' /usr/local/opt/isl/lib/libisl.dylib /usr/local/opt/musl-cross/libexec/libexec/gcc/x86_64-linux-musl/6.3.0/lto1
```
Finally, you can run
```
CC=/usr/local/bin/x86_64-linux-musl-gcc CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/usr/local/bin/x86_64-linux-musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
$ CC=/usr/local/bin/x86_64-linux-musl-gcc CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=/usr/local/bin/x86_64-linux-musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
```
## Benchmarking
This repository includes three benchmark applications, which were used to generate the experimental results reported in the paper. They are:
This repository includes three benchmark applications, which were used to generate the experimental results reported in the papers. They are:
+ ```bench_sign``` - benchmarks the 2-of-2 signing protocol, or the 2-of-2 setup protol if the ```--bench_setup``` flag is used. This program plays the role of Alice, unless it is given the ```--bob``` flag.
+ ```bench_thres_sign``` - benchmarks the 2-of-n signing protocol. This program plays the role of Alice, unless it is given the ```--bob``` flag.
+ ```bench_thres_setup``` - benchmarks the 2-of-n setup protocol. Note that the number of parties must be specified via the ```-N``` flag, and the (zero indexed) party number must be specified via the ```-P``` flag.
+ ```bench_thres_setup``` - benchmarks the 2-of-n setup protocol. Note that the number of parties must be specified via the ```-N``` flag, and the (zero indexed) party number that this program plays must be specified via the ```-P``` flag.
All of these programs represent one party, and expect to connect to other parties via the network. All of them also accept the ```--help``` flag, which lists their arguments. As an example, to benchmark 2-of-2 signing, one must first start the server on one machine:
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment