439 Commits

Author SHA1 Message Date
Daniel Lubarov
05f4d2be4e Remove conversion 2022-11-20 09:43:16 -08:00
Daniel Lubarov
b0be6d7e8a Serialization refactor
Followup to #806.

A few goals here
- Zero dependencies on std. (Previously deserialization depended on std for `Cursor`.)
- Provide a single (memory buffering) impl of `Write` to make sure there's no confusion. (Previously `Buffer` and `Vec<u8>` both implemented it.)
- Move closer to the `std::io` APIs. Hopefully they will be available without std at some point (there have been some discussions...).

More specifically, this
- Changes `Buffer` to not use std's `Cursor`.
- Removes `impl Write` for `Buffer`, since it's implemented for `Vec<u8>`.
- Adds a concrete I/O error type to mimic `std::io`'s.
- Combines `Position` and `Size` into `Remaining`.
2022-11-20 09:37:18 -08:00
Daniel Lubarov
9a43084f94 Merge branch 'feat/no-std-support' of https://github.com/openzklib/plonky2 into openzklib-feat/no-std-support 2022-11-17 12:17:22 -08:00
Daniel Lubarov
1732399f05 Remove comment 2022-11-17 12:08:33 -08:00
Daniel Lubarov
e22da77b34 Include the FRI prover's PoW witness in the transcript
We don't think this is required for soundness, but just to remove any doubt.

Old protocol:
```
...
P sends final_poly
V samples random r
P sends pow_witness (not in transcript)
V computes pow_response = H(r, pow_witness)
V asserts pow_response has N leading 0s
...
```

New protocol:
```
...
P sends final_poly
P sends pow_witness
V samples random pow_response
V asserts pow_response has N leading 0s
...
```
2022-11-17 12:08:11 -08:00
Brandon H. Gomes
65d106bc31
chore: remove derivative dependency as non-crucial
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 16:26:43 -05:00
Brandon H. Gomes
2520bd62c6
chore: match hashbrown ahash dependency
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 16:14:07 -05:00
Brandon H. Gomes
812a5d468a
chore: merge branch main
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 01:54:30 -05:00
Brandon H. Gomes
289498e854
fix: address review comments
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-15 01:52:27 -05:00
Brandon H. Gomes
14c2a6dd1f
Fork Update (#3)
* Use static `KERNEL` in tests

* Print opcode count

* Update criterion

* Combine all syscalls into one flag (#802)

* Combine all syscalls into one flag

* Minor: typo

* Daniel PR comments

* Check that `le_sum` won't overflow

* security notes

* Test reverse_index_bits

Thanks to Least Authority for this

* clippy

* EVM shift left/right operations (#801)

* First parts of shift implementation.

* Disable range check errors.

* Tidy up ASM.

* Update comments; fix some .sum() expressions.

* First full draft of shift left/right.

* Missed a +1.

* Clippy.

* Address Jacqui's comments.

* Add comment.

* Fix missing filter.

* Address second round of comments from Jacqui.

* Remove signed operation placeholders from arithmetic table. (#812)

Co-authored-by: wborgeaud <williamborgeaud@gmail.com>
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
Co-authored-by: Jacqueline Nabaglo <jakub@mirprotocol.org>
Co-authored-by: Hamish Ivey-Law <426294+unzvfu@users.noreply.github.com>
2022-11-15 01:51:29 -05:00
Daniel Lubarov
7eb0c74166 Randomize unused wires of PublicInputGate 2022-11-14 14:53:06 -08:00
Daniel Lubarov
cab6c18ed6 Check that le_sum won't overflow 2022-11-08 11:55:02 -08:00
Daniel Lubarov
3dcc0c257e Update criterion 2022-11-07 11:28:24 -08:00
Brandon H. Gomes
9431fd7448
chore: add missing documentation in serialization trait
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-05 10:59:46 -07:00
Brandon H. Gomes
7e432bd6cc
feat: add serialization documentation
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-04 16:47:02 -07:00
Brandon H. Gomes
fc3f63398d
wip: start moving starky to no-std
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 12:17:03 -07:00
Brandon H. Gomes
38e467f1c0
chore: fix serde-cbor and run cargo-sort
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 11:41:12 -07:00
Brandon H. Gomes
703d2c3c95
wip: start plonky2_u32 and plonky2_ecdsa no-std impl
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 10:58:55 -07:00
Brandon H. Gomes
e2cdd5a954
feat: upgrade Sampling APIs
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-03 08:26:03 -07:00
Brandon H. Gomes
4aaf57e9a9
feat: separate reading and writing to get infallible writers
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 21:07:51 -07:00
Brandon H. Gomes
7a81c5d46a
feat: move to alloc for Vec/String/Box
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 19:59:12 -07:00
Brandon H. Gomes
6fd0da216a
fix: remove unstable features from plonky2
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 17:50:31 -07:00
Brandon H. Gomes
11600b93c0
fix: do a first round of a core replacement
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2022-11-02 16:54:41 -07:00
wborgeaud
c47f767fc5 PR feedback 2022-10-27 15:45:14 +02:00
wborgeaud
8a60fe19ea Cyclic recursion gadget doesn't move circuit builder 2022-10-26 15:04:47 +02:00
wborgeaud
73e9e6119b CyclicPublicInputs is just VerifierOnlyCircuitData 2022-10-26 11:02:45 +02:00
wborgeaud
341e1ebeec Working 2022-10-26 10:58:38 +02:00
wborgeaud
7afbddb0b6 Add goal_common_data to CircuitBuilder 2022-10-25 22:57:36 +02:00
wborgeaud
e8fd8bd1d8 Add type hints 2022-10-25 22:51:24 +02:00
wborgeaud
a0eca98c81 Merge branch 'main' into cyclic_recursion
# Conflicts:
#	plonky2/src/plonk/circuit_data.rs
2022-10-25 22:45:47 +02:00
wborgeaud
b97ec3bda1 New clippy lint 2022-10-25 10:50:40 +02:00
wborgeaud
0e58efdcc1 Remove Config from CommonCircuitData 2022-10-25 10:08:21 +02:00
wborgeaud
f28ff42fe3 PR feedback 2022-10-24 13:35:16 +02:00
wborgeaud
c3e9827b5e Minor 2022-10-17 14:59:51 +02:00
wborgeaud
09cee22d1f Better test 2022-10-17 14:56:16 +02:00
wborgeaud
366567935c Fix conflict 2022-10-17 10:34:08 +02:00
wborgeaud
aea721e70d Merge branch 'main' into cyclic_recursion
# Conflicts:
#	plonky2/src/recursion/conditional_recursive_verifier.rs
2022-10-17 10:25:55 +02:00
wborgeaud
fb94ace3db Fix conflict 2022-10-17 10:02:36 +02:00
wborgeaud
1ae922dd4d Merge branch 'main' into generate_dummy_proof 2022-10-17 10:01:32 +02:00
wborgeaud
972d83687e PR feedback 2022-10-17 09:54:00 +02:00
wborgeaud
35b173ed34 Comments 2022-10-14 16:26:05 +02:00
wborgeaud
51cea8d98b base_case is decreasing 2022-10-14 15:34:08 +02:00
wborgeaud
fce7a4797a Working 2022-10-14 14:59:59 +02:00
wborgeaud
861b66a34a Test passes for base proof 2022-10-14 10:32:40 +02:00
wborgeaud
69bdbf6bf6 Redundant degree_bits 2022-10-13 18:19:05 +02:00
wborgeaud
f194553345 Test not working 2022-10-13 18:13:57 +02:00
wborgeaud
29e0aef376 New recursion folder 2022-10-13 14:39:08 +02:00
wborgeaud
66a0e77251 Working in test 2022-10-13 14:28:08 +02:00
wborgeaud
f497fc652c Merge branch 'generate_dummy_proof' into cyclic_recursion
# Conflicts:
#	plonky2/src/fri/mod.rs
#	plonky2/src/plonk/circuit_data.rs
2022-10-12 17:45:07 +02:00
wborgeaud
325bab113a test 2022-10-12 17:43:50 +02:00