Skip to content

Commit

Permalink
"Merge" Speed Reverie (#55)
Browse files Browse the repository at this point in the history
* Copy speed-reverie on top of base reverie

* Update Cargo.toml

* Recreate license, update readme

* Remove companion from nightly.yml

* Wakey wakey, Github Actions

* Include config.toml

Wasn't copied before

* Disable Mac tests for now

I'm sorry, the macos environment doesn't support the hardware instructions we use and I don't want to fix it myself. We can implement a fallback later.

* Remove all the needless range loops

Ugh, clippy why

* Allow needless collect for now
  • Loading branch information
Eric Hennenfent authored Jul 15, 2021
1 parent 22977c5 commit 0410837
Show file tree
Hide file tree
Showing 102 changed files with 5,068 additions and 129,705 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-feature=+aes,+ssse3,+sse2,+avx2"]
7 changes: 1 addition & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
Expand All @@ -35,8 +35,3 @@ jobs:

- name: Test
run: cargo test

- name: Build Companion
run: |
cd companion
cargo build
52 changes: 23 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ description = "An efficient implementation of the NIZKPoK outlined in KKW 2018"
license = "AGPL-3.0"
homepage = "https://github.com/trailofbits/reverie"
repository = "https://github.com/trailofbits/reverie"
version = "0.2.1-rc.4"
version = "0.3.0"
authors = [
"Mathias Hall-Andersen <[email protected]>",
"William Woodruff <[email protected]>"
"William Woodruff <[email protected]>",
"Eric Hennenfent <[email protected]>"
]
edition = "2018"
readme = "README.md"
keywords = ["crypto", "cryptography", "zero-knowledge"]
categories = ["cryptography"]

[lib]
name = "reverie"
build = "build.rs"

[package.metadata.release]
no-dev-version = true
Expand All @@ -25,30 +24,25 @@ disable-publish = true # handled by GitHub Actions
maintenance = { status = "actively-developed" }

[dependencies]
async-channel = "1.5"
async-scoped = "0.6"
aesni = "0.10"
async-std = "1.7"
async-stream = "0.3"
bincode = "1.3"
blake3 = "0.3"
crossbeam = "0.8"
fnv = "1.0"
hex = "0.4"
itertools = "0.10"
rand = "0.7"
rand_chacha = "0.3"
rand_core = "0.5"
rayon = "1.3"
serde = {version = "1.0", features = ["derive"]}
serde-big-array = "0.3.2"
static_assertions = "1.1"
sysinfo = "0.17.0"
typenum = "1.12"
bincode = "1.3.3"
blake3 = "0.3.7"
chacha = "0.3"
clap = "2.33.1"
num-traits = "0.2"
rand = "0.8"
rayon = "1.5"
serde = {version = "1.0.125", features = ["derive"]}
built = {version = "0.4.4", features = ["git2", "chrono", "semver"] }

[dev-dependencies]
aes = "0.6.0"
cipher = "0.2"
[build-dependencies]
built = "0.4.4"

[lib]
name = "reverie"
path = "src/lib.rs"

[features]
trace = []
debug_eval = []
[[bin]]
name = "speed-reverie"
path = "src/main.rs"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -658,4 +658,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
# Reverie

An efficient implementation of the NIZKPoK outlined in KKW 2018

![Nightly Rust CI Status](https://github.com/trailofbits/zk-proof/workflows/nightly/badge.svg)

Reverie is an implementation (prover and verifier) of the MPC-in-the-head NIZKPoK outlined in
[Improved Non-Interactive Zero Knowledge with Applications to Post-Quantum Signatures](https://eprint.iacr.org/2018/475).
Reverie seeks to offer concrete prover efficiency (linear proving time with small constants) for
complex predicates. The implementation seeks to offer 128-bits of (classical) security and support
arbitrary rings, most efficiently
Z<sub>2</sub>, Z<sub>8</sub>, Z<sub>16</sub>, Z<sub>32</sub> and Z<sub>64</sub>.
Z<sub>2</sub> and Z<sub>64</sub>.

Reverie provides both a library (with a simplified and a streaming interface),
in addition to a "companion" program for proving/verifying statements specified in Bristol format
in addition to a CLI program for proving/verifying statements specified in Bristol format
to enable easy experimentation.

## Building

## Running
Reverie requires a relatively recent `nightly` Rust.

```bash
$ cargo build
```
Using `SSE+AESNI`

time RUSTFLAGS="-C target-cpu=native -C target-feature=+aes,+ssse3,+sse2" cargo run --release

Or even better with `AVX2+AESNI`

time RUSTFLAGS="-C target-cpu=native -C target-feature=+aes,+ssse3,+sse2,+avx2" cargo run --release

## Improvements in 0.3+

- Pack 8 instances of 8 players over GF(2) into a single 64-bit integer (see [gist](https://gist.github.com/rot256/174fd53c0aac8cf04ef9810e8a10b0c0) for details).
- Switch to AES with AESNI
- Just-in-time preprocessing to condense proving into a single pass
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
built::write_built_file().expect("Failed to acquire build-time information")
}
1 change: 0 additions & 1 deletion clippy.toml

This file was deleted.

1 change: 0 additions & 1 deletion companion/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions companion/Cargo.toml

This file was deleted.

48 changes: 0 additions & 48 deletions companion/README.md

This file was deleted.

Loading

0 comments on commit 0410837

Please sign in to comment.