29 Commits

Author SHA1 Message Date
Daniel Lubarov
7185c2d7d2
Fix & cleanup partial products (#355)
My previous change introduced a bug -- when `num_routed_wires` was a multiple of 8, the partial products "consumed" all `num_routed_wires` terms, whereas we actually want to leave 8 terms for the final product.

This also changes `check_partial_products` to include the final product constraint, and merges `vanishing_v_shift_terms` into `vanishing_partial_products_terms`. I think this is natural since `Z(x)`, partial products, and `Z(g x)` are all part of the product accumulator chain.
2021-11-14 11:58:44 -08:00
wborgeaud
21d3b127e3 Cargo fmt 2021-11-12 09:15:37 +01:00
Daniel Lubarov
9139d1350a
Minor refactor of partial product code (#351) 2021-11-11 07:16:16 -08:00
wborgeaud
3084367133 Start accumulator at Z(x) 2021-11-10 18:36:35 +01:00
wborgeaud
32f09ac2df Remove quotients and work directly with numerators and denominators in partial products check 2021-11-10 18:13:27 +01:00
wborgeaud
ff943138f3
Apply suggestions from code review
Co-authored-by: Daniel Lubarov <daniel@lubarov.com>
2021-11-10 09:38:47 +01:00
wborgeaud
3717ff701e Minor 2021-11-09 17:33:14 +01:00
wborgeaud
abc706ee26 Fix partial product test 2021-11-09 17:18:15 +01:00
wborgeaud
7cf965ded5 All tests pass 2021-11-09 15:18:43 +01:00
wborgeaud
9617c22173 Increase degree 2021-11-09 14:24:04 +01:00
wborgeaud
bd1672cbf2 Working 2021-11-09 13:56:19 +01:00
wborgeaud
4e361726d0 Use partial product chain 2021-11-08 15:50:33 +01:00
Daniel Lubarov
3bc34c59d8
Refactor GMiMC code (#224)
* Refactor GMiMC code

Adds a sub-trait of `Field` called `GMiMCInterface`, which is similar to `PoseidonInterface`.

This lets us have different fields with different GMiMC constants in a type-safe way.

* Remove `Interface`

* Const generic for width
2021-09-07 18:28:28 -07:00
Daniel Lubarov
236a143abf
Move some Field members to a Field64 subtrait (#213)
* Move some Field members to a Field64 subtrait

I.e. move anything specific to 64-bit fields.

Also, relatedly,
- Tweak a bunch of prover code to require `Field64`, since 64-bit stuff is used in a couple places, like the FRI proof-of-work
- Remove `bits()`, which was unused and assumed a 64-bit field
- Rename a couple methods to reflect that they're u64 variants

There are no functional changes.

* Field64 -> PrimeField

* Remove `exp_u32`, `kth_root_u32`

* PrimeField: PrimeField

* Move `to_canonical_biguint` as well

* Add back from_noncanonical_u128
2021-09-05 10:27:11 -07:00
Jakub Nabaglo
21b263ee3e
Shave off 2% by optimizing check_partial_products (#205)
* Shave off 2% by optimizing check_partial_products

Removes a bunch of allocations/deallocations

* Minor style (Daniel PR comment)
2021-08-28 14:59:56 -07:00
Daniel Lubarov
018fb005f8
Move stuff around (#135)
No functional changes here. The biggest change was moving certain files into new directories like `plonk` and `iop` (for things like `Challenger` that could be used in STARKs or other IOPs). I also split a few files, renames, etc, but again nothing functional, so I don't think a careful review is necessary (just a sanity check).
2021-07-29 22:00:29 -07:00
wborgeaud
ad24f5d4d1 Almost working recursive verifier 2021-07-12 14:25:28 +02:00
wborgeaud
274ec48f5e Update comments 2021-07-06 11:19:58 +02:00
wborgeaud
4a27a67bab Constraint degree should be at least 3 2021-07-06 11:10:08 +02:00
wborgeaud
151d1ad07b Remove addendum 2021-07-06 11:00:05 +02:00
wborgeaud
50cafca705 Partial products of quotient 2021-07-06 10:51:32 +02:00
wborgeaud
1915ef9b27 Minor improvements 2021-07-02 10:58:59 +02:00
wborgeaud
d456efbc3f Minor addition to partial product test 2021-07-02 10:20:44 +02:00
wborgeaud
20e6d6540f Add comments 2021-07-01 17:28:30 +02:00
wborgeaud
1858a869a7 Optimize products of 1 element 2021-07-01 15:57:55 +02:00
wborgeaud
59410447bf Add lengths to CommonData 2021-07-01 15:41:01 +02:00
wborgeaud
c83382aaaa Working partial products 2021-07-01 15:20:16 +02:00
wborgeaud
f7c4a463fc Progress 2021-06-30 18:54:28 +02:00
wborgeaud
b8e764bb90 Allow for degree^2 < num_routed_wires 2021-06-30 16:48:41 +02:00