48 Commits

Author SHA1 Message Date
Daniel Lubarov
eb27a2d2b2 warnings 2021-11-16 22:52:01 -08:00
Daniel Lubarov
efab3177ce
Have le_sum use arithmetic ops if it's cheaper (#362)
* Have le_sum use arithmetic ops if it's cheaper

* fmt
2021-11-15 09:55:06 -08:00
Daniel Lubarov
fdce382af3
Standard configs (#337)
`large_config` was similar to `standard_recursion_config`; let's standardize on the latter.
2021-11-03 14:30:32 -07:00
Jakub Nabaglo
bc57a561e6 Delete CrandallField 2021-11-02 12:29:26 -07:00
wborgeaud
1f1827dae7 Clippy 2021-10-21 14:36:36 +02:00
wborgeaud
318185d1c0 Use only one BaseSumGate 2021-10-21 12:56:02 +02:00
wborgeaud
5f3a5e6bad Add num_bits==1,2 cases in le_sum 2021-09-21 18:27:49 +02:00
wborgeaud
4305a95cdb Small fixes to the le_sum and reduce gadgets 2021-09-21 12:52:28 +02: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
Nicholas Ward
c07f99ac81 merge 2021-09-06 21:38:52 -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
Daniel Lubarov
f89f49249a wip 2021-09-04 16:27:40 -07:00
wborgeaud
69a945547a route, assert_equal -> connect 2021-08-24 08:25:11 +02:00
wborgeaud
cd1bd9e77b
Merge pull request #195 from mir-protocol/partition_witness
Remove `CopyGenerator`s and add new `PartitionWitness`
2021-08-24 08:16:35 +02:00
wborgeaud
a90ea6ec79 PartialWitness back to HashMap 2021-08-20 11:56:57 +02:00
wborgeaud
e81001b9ba Clippy 2021-08-20 11:13:40 +02:00
wborgeaud
c6cf5cf130 Move PartitionWitness 2021-08-20 09:55:49 +02:00
Daniel Lubarov
90c7a72ceb
Remove some unused warnings (#192)
- Made some methods public, if they seemed like they'd be useful crates that depend on plonky2, and seemed like good/stable APIs
- Deleted a few things I didn't think seemed very useful
- Left a few for now that I was on the fence about
2021-08-19 08:23:45 -07:00
wborgeaud
74c2be5090 First pass 2021-08-19 14:54:11 +02:00
Daniel Lubarov
f3bfd66657
Add a BoolTarget (#179)
It's just a wrapper around `Target`, which signifies that the wrapped `Target` has already been range checked. Should make it easier to audit code that expects bools.
2021-08-14 08:53:39 -07:00
Daniel Lubarov
b89f4d656d
Update various dependencies (#163) 2021-08-09 10:11:42 -07:00
wborgeaud
dd076e5c73 Auto resize partial witness 2021-08-09 09:58:09 +02:00
wborgeaud
db236e4824 Fix tests 2021-08-06 15:14:38 +02:00
wborgeaud
7d11d0f8a1 Change PartialWitness to use Vecs 2021-08-06 14:58:39 +02:00
wborgeaud
5418026082 Remove reversed sum from BaseSumGate 2021-08-05 13:47:33 +02:00
Daniel Lubarov
d6211b8ab8
Reuse a buffer of generated values (#142)
* Reuse a buffer of generated values

To avoid allocating `GeneratedValues` all the time. Saves ~60ms or so.

* PR feedback
2021-08-02 10:55:10 -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
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
e87aa2c90b Renaming 2021-07-22 16:25:47 +02:00
wborgeaud
c729a3c235 Remove all non-bits indices in the FRI verifier 2021-07-22 16:07:07 +02: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
805ebb1b0d Working verifier 2021-07-08 15:13:29 +02:00
wborgeaud
930e117185 Minor 2021-06-17 11:35:10 +02:00
wborgeaud
5bebc746f6 PR feedback 2021-06-17 11:31:14 +02:00
wborgeaud
eaba5238a6 Change PoW to checking leading zeros 2021-06-17 09:49:41 +02:00
wborgeaud
5edaab59e6 Renaming + Clippy 2021-06-16 11:37:07 +02:00
wborgeaud
ab7e2381a2 Remove rev in computation of the reversed sum in BaseSplitGenerator. 2021-06-16 08:15:44 +02:00
wborgeaud
89b25c528c PR feedback fixes 2021-06-15 19:13:15 +02:00
wborgeaud
88c58c3227 Fix imports 2021-06-14 10:37:02 +02:00
wborgeaud
19b47b5251 Clippy 2021-06-14 10:33:38 +02:00
wborgeaud
4106a47ded Test rotate gadget 2021-06-11 09:59:55 +02:00
wborgeaud
1eb372326a Add CircuitConfig::large_config() for tests. 2021-06-11 09:44:19 +02:00
wborgeaud
81ce0eb710 Fix bugs 2021-06-10 16:48:05 +02:00
wborgeaud
f7e92af963 Comment out errors 2021-06-09 17:55:49 +02:00
wborgeaud
89761ef22a Added in-circuit reverse_bits and exp. 2021-06-09 17:39:45 +02:00
wborgeaud
9adf5bb43f Use ExtensionAlgebra + new CircuitBuilder::mul_extension 2021-06-09 10:51:50 +02:00
wborgeaud
1169870163 Added test 2021-06-04 17:07:14 +02:00
wborgeaud
51c06d74ee Recursive PoW 2021-06-04 16:02:48 +02:00