Skip to content

Commit

Permalink
Support recursive circuit format, single witness loading; support con…
Browse files Browse the repository at this point in the history
…st in verification (#11)

* recursive circuit loading; witness loading; support const in verification

* fix clippy

* fix random circuit coef; proving cli

* after-merge fix: update config; add default bin

* update CI data preparation

* doc update
  • Loading branch information
sixbigsquare committed Jun 13, 2024
1 parent 9f0fbdc commit 1049ba5
Show file tree
Hide file tree
Showing 8 changed files with 475 additions and 7 deletions.
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

0 comments on commit 1049ba5

Please sign in to comment.