Skip to content

Commit e17bf08

Browse files
release: v0.9.0 (#95)
* update pd circuit * add http circuit * fix: `PlaintextAuthentication` tests * fix: `HTTPVerification` test -- no body * fix: `HTTPVerification` -- with body * Update package.json * fix: `PlaintextAuthentication` -- multi component * fix: uncomment tests * fix: uncomment pt auth tests * json circuit with tests * add 2 full tests * complete tests * req+res proving starts * update HTTP.step_in[6] to be body_ciphertext_digest_pow_var * add final test * finish tests * fix tests * initial setup * refactor * cleanup + initial public io * WIP: json parser * save state * more progress * Update parser.rs * Update parser.rs * Update parser.rs * Update parser.rs * refactor + From trait * reworking * refactored * one working test * more tests and fixes * stronger test * checked things by hand like a pro * feat: http parser * update circuits inputs * fix: add more fields to `RawJsonMachine` * fix: parsing number status * fix: use field elements * fix: parsing number clear * revert: extraction.test.ts * WIP: fix HTTP parser * fix: consistent header counting * fix: CRLF in body * move to single lib * add `inner_main_digest` to http parser * fix(http): remove last machine state * fix rust tests * wip: update * add serialization methods * fix parser bug, and remove unused code * simplify authentication circuit step_out * add flatten to httpmachine * remove logs * fix max rom length size * fix more logs * remove toods, clippy, and simplify http byteorpad * remove `ByteOrPad::as_bytes` * increase max rom length to 20 * add circuit diagram * add final value verification --------- Co-authored-by: Colin Roberts <colin@autoparallel.xyz>
1 parent bc071c1 commit e17bf08

42 files changed

Lines changed: 3281 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/target
1+
**/target
22

33
node_modules/*
44

.rustfmt.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Rustfmt configuration
2+
# Opinionated whitespace and tabs. The most important of these are imports and width settings.
3+
# Others may want to borrow or change these to their own liking.
4+
# https://rust-lang.github.io/rustfmt
5+
6+
# version-related
7+
unstable_features=true
8+
use_try_shorthand=true # replace any `try!` (2015 Rust) with `?`
9+
10+
# misc formatting
11+
condense_wildcard_suffixes =true # replace: (a,b,_,_)=(1, 2, 3, 4); -> (a,b,..)=(1, 2, 3, 4);
12+
format_code_in_doc_comments =true # format code blocks in doc comments
13+
format_macro_matchers =true # $a: ident -> $a:ident
14+
format_strings =true # break and insert newlines for long string literals
15+
match_block_trailing_comma =true # include comma in match blocks after '}'
16+
normalize_comments =true # convert /*..*/ to //.. where possible
17+
reorder_impl_items =true # move `type` and `const` declarations to top of impl block
18+
struct_field_align_threshold=20 # align struct arguments' types vertically
19+
use_field_init_shorthand =true # struct initialization short {x: x} -> {x}
20+
21+
# reduce whitespace
22+
blank_lines_upper_bound=1 # default: 1. Sometimes useful to change to 0 to condense a file.
23+
brace_style ="PreferSameLine" # prefer starting `{` without inserting extra \n
24+
fn_single_line =true # if it's a short 1-liner, let it be a short 1-liner
25+
match_arm_blocks =false # remove unnecessary {} in match arms
26+
newline_style ="Unix" # not auto, we won the culture war. \n over \r\n
27+
overflow_delimited_expr=true # prefer ]); to ]\n);
28+
where_single_line =true # put where on a single line if possible
29+
30+
# imports preferences
31+
group_imports ="StdExternalCrate" # create import groupings for std, external libs, and internal deps
32+
imports_granularity="Crate" # aggressively group imports
33+
34+
# width settings: everything to 100
35+
comment_width =100 # default: 80
36+
inline_attribute_width=60 # inlines #[cfg(test)]\nmod test -> #[cfg(test)] mod test
37+
max_width =100 # default: 100
38+
use_small_heuristics ="Max" # don't ever newline short of `max_width`.
39+
wrap_comments =true # wrap comments at `comment_width`
40+
# format_strings = true # wrap strings at `max_length`
41+
42+
# tabs and spaces
43+
hard_tabs =false # (def: false) use spaces over tabs
44+
tab_spaces=2 # 2 > 4, it's just math.
45+
46+
ignore=["tls"]

Cargo.lock

Lines changed: 62 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
11
[package]
2-
name = "create-pp"
2+
name = "web-proof-circuits"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "create_pp"
8+
path = "src/main.rs"
9+
10+
[lib]
11+
name = "web_proof_circuits_witness_generator"
12+
path = "lib/src/lib.rs"
13+
614
[dependencies]
715
proofs = { git = "https://github.com/pluto/web-prover", rev = "d8c81d5" }
816
anyhow = "1.0"
17+
18+
serde = "1.0"
19+
serde_json = "1.0"
20+
21+
client-side-prover = { git = "https://github.com/pluto/client-side-prover", rev = "8e7eb839e901dcee416179116bb0f9c4f7ae683c" }
22+
23+
ff = { version = "0.13", default-features = false, features = ["derive"] }
24+
25+
thiserror = "2.0"
26+
27+
light-poseidon = { git = "https://github.com/pluto/light-poseidon" }
28+
29+
ark-bn254 = "=0.4.0"
30+
halo2curves = "0.6.1"
31+
32+
sppark = "=0.1.10" # lock this or cry
33+
num-bigint = "0.4"
34+
35+
[dev-dependencies]
36+
rstest = "0.24"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ build:
3131
params:
3232
@for target_dir in $(TARGET_DIRS); do \
3333
size=$$(basename "$$target_dir" | sed 's/target_//' | sed 's/b//'); \
34-
echo "Generating parameters for $${size}b with ROM length 5..."; \
35-
cargo +nightly run --release -- "$$target_dir/artifacts" "$${size}b" "5" || exit 1; \
34+
echo "Generating parameters for $${size}b with ROM length 20..."; \
35+
cargo +nightly run --release -- "$$target_dir/artifacts" "$${size}b" "20" || exit 1; \
3636
done
3737

3838
.PHONY: check

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
`web-prover-circuits` is a project focused on implementing parsers and extractors/selective-disclosure for various data formats inside zero-knowledge circuits.
1717
Specifically, these are designed to be used in an NIVC folding scheme.
1818
Currently, our program layout looks like this:
19-
![v0.7.5](docs/images/v0.7.5.png)
19+
![v0.9.0](docs/images/v0.9.0.png)
2020

2121
## Repository Structure
2222

builds/target_1024b/http_verification_1024b.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ pragma circom 2.1.9;
22

33
include "../../circuits/http/verification.circom";
44

5-
component main { public [step_in] } = HTTPVerification(1024, 25);
5+
component main { public [step_in] } = HTTPVerification(1024, 25, 11);

builds/target_1024b/json_extraction_1024b.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ pragma circom 2.1.9;
22

33
include "../../circuits/json/extraction.circom";
44

5-
component main { public [step_in] } = JSONExtraction(1024, 10);
5+
component main { public [step_in] } = JSONExtraction(1024, 10, 11);

builds/target_1024b/plaintext_authentication_1024b.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ pragma circom 2.1.9;
22

33
include "../../circuits/chacha20/authentication.circom";
44

5-
component main { public [step_in] } = PlaintextAuthentication(1024);
5+
component main { public [step_in] } = PlaintextAuthentication(1024, 11);

builds/target_512b/http_verification_512b.circom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ pragma circom 2.1.9;
22

33
include "../../circuits/http/verification.circom";
44

5-
component main { public [step_in] } = HTTPVerification(512, 10);
5+
component main { public [step_in] } = HTTPVerification(512, 10, 11);

0 commit comments

Comments
 (0)