58 Commits

Author SHA1 Message Date
wborgeaud
c78d7611ed Unused imports 2021-11-05 16:47:29 +01:00
wborgeaud
7482e7b613 Remove RichField 2021-11-05 15:43:58 +01:00
wborgeaud
fb18232efd Generic config 2021-11-05 10:56:23 +01: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
9503bb22f4 Take config by reference to avoid clone 2021-10-18 11:11:48 +02:00
Daniel Lubarov
91f7b4e300
Replace CrandallQuarticField with a more generic QuarticExtension (#232)
* Replace `CrandallQuarticField` with a more generic `QuarticExtension`

And likewise for `CrandallQuadraticField`.

There are a few parameters which we can't automatically derive (in const Rust), so I specified them in a `AutoExtendable` trait.

This would make it fairly easy to add extension fields for `GoldilocksField` and any future fields.

* Attempt to derive 2-adicity, see Hamish's feedback

* Simplify TWO_ADICITY based on chat with Hamish

* PR feedback

* Merge AutoExtendable into Extendable (#235)
2021-09-13 11:45:17 -07: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
Nicholas Ward
b0a855a9c3 progress on permutation 2021-09-03 18:07:20 -07:00
wborgeaud
e81001b9ba Clippy 2021-08-20 11:13:40 +02:00
wborgeaud
c6cf5cf130 Move PartitionWitness 2021-08-20 09:55:49 +02: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
9c42fef997
Little refactor (#178) 2021-08-14 08:47:03 -07:00
Daniel Lubarov
b20d6dc191
Minor optimizations (#174) 2021-08-12 13:32:49 -07:00
Daniel Lubarov
7b20f342df
More eval_unfiltered_recursively tweaks (#156) 2021-08-05 08:03:49 -07: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
wborgeaud
730962ceac
Merge pull request #145 from mir-protocol/test_eval_fns
Test `eval_unfiltered_*` functions
2021-08-02 19:50:27 +02:00
wborgeaud
2bbcf17699 Test eval_unfiltered_* functions 2021-08-02 14:17:42 +02:00
wborgeaud
fc9d64defe Small nits for the exponentiation gate 2021-08-02 13:12:50 +02: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
Nicholas Ward
9eda81c293 minor changes 2021-07-29 15:31:04 -07:00
Nicholas Ward
cfda56e3d3 Merge branch 'main' into exp_gate_config 2021-07-29 14:19:24 -07:00
Nicholas Ward
a111fc3164 fixes 2021-07-29 14:18:18 -07:00
Nicholas Ward
95503ff7fa Merge branch 'main' into exp_gate_config 2021-07-29 14:10:35 -07:00
Nicholas Ward
e46bd08f00 exponention gate takes only bits 2021-07-29 12:59:11 -07:00
Daniel Lubarov
e382decc9f Import fixes 2021-07-29 11:45:58 -07:00
Nicholas Ward
56b62f1964 new exp gate takes in CircuitConfig and determines num_bits 2021-07-29 10:26:46 -07:00
Nicholas Ward
2fd9ce2114 fixes to exp functions 2021-07-28 13:38:41 -07:00
Nicholas Ward
6749a94c52 fix 2021-07-28 10:17:32 -07:00
Nicholas Ward
607d0a89cb fixed max_power_bits 2021-07-28 10:09:35 -07:00
Nicholas Ward
68672c0038 addressed comments 2021-07-28 09:20:20 -07:00
Nicholas Ward
a38a5e227d select_ext takes bit as extension; used in recursive eval 2021-07-27 22:51:40 -07:00
Nicholas Ward
33ba269ccb fixes 2021-07-27 15:58:19 -07:00
Nicholas Ward
3944c5e68e added eval_unfiltered_recursively 2021-07-27 13:29:57 -07:00
Nicholas Ward
044eb597c2 added eval_unfiltered_base 2021-07-27 13:18:42 -07:00
Nicholas Ward
21ec75335a fix: power bits in test now LE 2021-07-27 13:09:28 -07:00
Nicholas Ward
b5418bffb3 added output wire 2021-07-27 13:09:15 -07:00
Daniel Lubarov
54626be7ce comment 2021-07-27 12:48:52 -07:00
Daniel Lubarov
1e9845afcf nits 2021-07-27 12:47:15 -07:00
Nicholas Ward
b66ad6c96a added debug assert 2021-07-27 12:34:47 -07:00
Nicholas Ward
7e5e4fc682 updated num_constraints 2021-07-27 12:18:09 -07:00
Nicholas Ward
59bfc52f9c removed extraneous constraint 2021-07-27 11:55:25 -07:00
Nicholas Ward
695e5bc98c fix? 2021-07-27 11:04:16 -07:00
Nicholas Ward
0b8f5860f5 removed if statement 2021-07-27 10:46:10 -07:00
Nicholas Ward
af62688bd7 fixes 2021-07-27 10:19:46 -07:00
Nicholas Ward
d7a9274fef updated for add_gate changes 2021-07-23 20:06:00 -07:00