Skip to content
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

Support recursive circuit format, single witness loading; support const in verification #11

Merged
merged 7 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
- run: wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitMul.txt
- run: wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitAdd.txt
- run: wget -P data https://storage.googleapis.com/keccak8/circuit8.txt
- run: wget -P data/compiler_out https://storage.googleapis.com/keccak8/circuit.txt
- run: wget -P data/compiler_out https://storage.googleapis.com/keccak8/witness.txt
- run: cargo test -p arith --release
- run: cargo test --no-default-features --release
- run: cargo test --all-features --release
Expand All @@ -67,6 +69,8 @@ jobs:
- run: wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitMul.txt
- run: wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitAdd.txt
- run: wget -P data https://storage.googleapis.com/keccak8/circuit8.txt
- run: wget -P data/compiler_out https://storage.googleapis.com/keccak8/circuit.txt
- run: wget -P data/compiler_out https://storage.googleapis.com/keccak8/witness.txt
- run: RUSTFLAGS="-C target-feature=+avx2" cargo test -p arith --release
- run: RUSTFLAGS="-C target-feature=+avx2" cargo test --no-default-features --release
- run: RUSTFLAGS="-C target-feature=+avx2" cargo test --all-features --release
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ Cargo.lock
# Project data
/data/Extracted*
/data/circuit8.txt
/data/compiler_out
notes.md

# Programming env
.vscode/
perf.data
perf.data.old
flamegraph.svg
output.txt
output.txt
.DS_Store
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "expander-rs"
version = "0.1.0"
edition = "2021"
default-run = "expander-rs" # default

[dependencies]
arith = { path = "arith" }
Expand All @@ -16,4 +17,8 @@ halo2curves = { git = "https://github.com/zhenfeizhang/halo2curves", default-fea
[workspace]
members = [
"arith"
]
]

[[bin]]
name = "expander-exec"
path = "src/exec.rs"
20 changes: 19 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ Before executing setup, please make sure you read through the system requirement
wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitMul.txt
wget -P data https://storage.googleapis.com/keccak8/ExtractedCircuitAdd.txt
wget -P data https://storage.googleapis.com/keccak8/circuit8.txt
wget -P data/compiler_out https://storage.googleapis.com/keccak8/circuit.txt
wget -P data/compiler_out https://storage.googleapis.com/keccak8/witness.txt
```


## Benchmarks

**Make sure you include `RUSTFLAGS="-C target-cpu=native" to allow platform specific accelerations.`**
**Make sure you include `RUSTFLAGS="-C target-cpu=native"` to allow platform specific accelerations.**

Command template:

Expand All @@ -48,6 +50,22 @@ To check the correctness, run the follow standard Rust test command:
RUSTFLAGS="-C target-cpu=native" cargo test --release -- --nocapture
```

## CLI

Usage:

```sh
RUSTFLAGS="-C target-cpu=native" cargo run --bin expander-exec --release -- prove <input:circuit_file> <input:witness_file> <output:proof>
RUSTFLAGS="-C target-cpu=native" cargo run --bin expander-exec --release -- verify <input:circuit_file> <input:witness_file> <input:proof>
```

Example:

```sh
RUSTFLAGS="-C target-cpu=native" cargo run --bin expander-exec --release -- prove ./data/compiler_out/circuit.txt ./data/compiler_out/witness.txt ./data/compiler_out/out.bin
RUSTFLAGS="-C target-cpu=native" cargo run --bin expander-exec --release -- verify ./data/compiler_out/circuit.txt ./data/compiler_out/witness.txt ./data/compiler_out/out.bin
```

## How to contribute?

Thank you for your interest in contributing to our project! We seek contributors with a robust background in cryptography and programming, aiming to improve and expand the capabilities of our proof generation system.
Expand Down
Loading
Loading