29 Commits

Author SHA1 Message Date
Daniel Lubarov
bcf524bed0
Have add_gate take a generic type instead of GateRef (#125)
* Have add_gate take a generic type instead of GateRef

There are a couple advantages
- Users writing their own gates won't need to know about the `GateRef` wrapper; it's more of an internal thing now.
- Easier access to gate methods requiring `self` -- for example, `split_le_base` can just call `gate_type.limbs()` now.

* Update comment

* Always insert
2021-07-22 23:48:03 -07:00
wborgeaud
ca3a2fcfc8 Clippy 2021-07-22 16:09:54 +02:00
wborgeaud
22fcc3bc06 Pass bits around 2021-07-22 15:10:55 +02:00
wborgeaud
467485c3f0 Remove accumulator wires in GMiMCGate 2021-07-22 14:33:02 +02:00
Daniel Lubarov
8438d23937
Tree of scopes (#106)
* Tree of scopes

This is an extension of the context concept.

Earlier I was planning to store a simple stack of contexts, but I ended up storing the whole history, in a tree structure. This gives us more control over the output, i.e. we can print the gate count of a parent scope before those of its child scopes, which seems more user-friendly.

Sample gate count output:

    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] 27829 gates to root
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 2373 gates to evaluate the vanishing polynomial at our challenge point, zeta.
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 1284 gates to evaluate gate constraints
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | 25312 gates to verify FRI proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | 650 gates to verify 0'th FRI query
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 96 gates to check FRI initial proof
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 65 gates to compute x from its index
    [2021-07-19T18:09:24Z INFO  plonky2::circuit_builder] | | | 233 gates to combine initial oracles
    ...

Sample copy constraint failure:

    Error: Copy constraint 'root > verify FRI proof > verify 0'th FRI query > check FRI initial proof > verify 0'th initial Merkle proof > check Merkle root: 0-th hash element' between wire 12 of gate #2550 [...] and wire 0 of gate #0 [...] is not satisfied. Got values of 6861386743364621393 and 0 respectively.

* No min

* info -> debug

* Move to its own file
2021-07-19 12:22:18 -07:00
Daniel Lubarov
0a5d46bfa9
Have prove return Result (#100)
* Have `prove` return `Result`

To address that TODO.

* PR feedback
2021-07-18 23:14:48 -07:00
wborgeaud
b7d51db979 Fix merge problems 2021-07-19 07:11:40 +02:00
wborgeaud
461f24a57e Merge branch 'main' into more_recursive_verifier
# Conflicts:
#	src/polynomial/commitment.rs
#	src/proof.rs
2021-07-19 07:08:06 +02:00
Daniel Lubarov
77ce69dc15
Proof serialization (#93)
Using `serde_cbor` for now. It's probably far from optimal, as we have many `Vec`s which I assume it will prefix with their lengths, but it's a nice and easy method for now.
2021-07-15 07:35:12 -07:00
wborgeaud
fe05da6720 Clipp 2021-07-15 10:39:57 +02:00
wborgeaud
2e12ee8e82 Minor 2021-07-15 10:13:13 +02:00
wborgeaud
7dec6efc6c Rewrite Markable to avoid Arcs 2021-07-15 09:52:42 +02:00
wborgeaud
92c4bba2a3 Fix bug in GMiMC 2021-07-14 21:16:04 +02:00
wborgeaud
7793b5a956 Identify problem in GMiMc 2021-07-14 20:54:30 +02:00
wborgeaud
5c2c01b1ab Circuit compiles 2021-07-13 15:20:14 +02:00
wborgeaud
c99d7f48fd Add Merkle tree test 2021-07-13 09:44:35 +02:00
wborgeaud
b50a9809db Start recursive verifier test 2021-07-08 17:16:26 +02:00
wborgeaud
f5dfe95b2e Added recursive powers 2021-06-04 17:36:48 +02:00
Daniel Lubarov
cb7f8c8b8c
Draw challenge points from the extension field (#51)
* Draw challenge points from the extension field

* Now building

* Misc

* Default eval_unfiltered_base

* fmt

* A few field settings

* Add to Sage

* Display tweak

* eval_filtered_base

* Quartic in bench

* Missing methods

* Fix tests

* PR feedback
2021-05-30 13:25:53 -07:00
wborgeaud
1f3f7d5b70 FRI reorg 2021-05-05 18:23:59 +02:00
wborgeaud
fd3e8bcd4c Minor fixes 2021-04-29 08:18:31 +02:00
wborgeaud
f624415a3c Clippy 2021-04-28 18:43:09 +02:00
wborgeaud
67aa704f6a Working reduction arity 2021-04-26 18:24:57 +02:00
wborgeaud
3dcdc8835c Working Merkle subtree proofs 2021-04-23 11:05:31 +02:00
wborgeaud
13519e66ab Merkle subtree proofs - WIP 2021-04-22 22:33:29 +02:00
wborgeaud
a1023e0ca6 Added PoW 2021-04-22 15:50:08 +02:00
wborgeaud
4d31f5e37b Fixes from PR comments 2021-04-22 09:27:59 +02:00
wborgeaud
6b407e45ef Progress on FRI 2021-04-21 22:31:45 +02:00
wborgeaud
7ff4150679 Merge with merkle_proofs_2 2021-04-12 10:38:07 +02:00