41 Commits

Author SHA1 Message Date
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
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
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
wborgeaud
69a945547a route, assert_equal -> connect 2021-08-24 08:25:11 +02:00
wborgeaud
a90ea6ec79 PartialWitness back to HashMap 2021-08-20 11:56:57 +02: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
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
e382decc9f Import fixes 2021-07-29 11:45:58 -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
Nicholas Ward
4dc6a603a1
Merge pull request #90 from mir-protocol/insertion_gate
Insertion gate
2021-07-19 07:59:55 -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
Nicholas Ward
6b214410f2 fixes 2021-07-15 13:57:50 -07:00
Daniel Lubarov
83a1430038
Fix some warnings (#94) 2021-07-15 07:34:46 -07:00
Nicholas Ward
d3127c73d3 insertion gadget (test fails) 2021-07-14 23:54:22 -07:00
Nicholas Ward
82d08ff27c Merge branch 'main' into insertion_gate 2021-07-14 17:31:27 -07:00
wborgeaud
c24fe65f44
Merge pull request #86 from mir-protocol/fix_z_check
Fix high degree `z` check by using partial products
2021-07-14 08:40:01 +02:00
Nicholas Ward
0a32e0fdeb cargo fmt 2021-07-13 16:54:04 -07:00
Nicholas Ward
2df81e15c8 switched to William's way, and len assert in test 2021-07-12 12:16:13 -07:00
Nicholas Ward
439303458d fix 2021-07-12 11:56:53 -07:00
wborgeaud
805ebb1b0d Working verifier 2021-07-08 15:13:29 +02:00
Nicholas Ward
3d53201538 save a gate with arithmetic 2021-07-01 17:43:22 -07:00
Nicholas Ward
39b22a6cab addressed nits 2021-07-01 12:00:56 -07:00
Nicholas Ward
efe39f2d63 fixed naming (zero --> nonzero), and other fixes 2021-07-01 11:21:33 -07:00
Nicholas Ward
d84b9ec8cb is_zero function 2021-07-01 10:47:13 -07:00
Nicholas Ward
515373653d fix 2021-07-01 10:38:11 -07:00
Nicholas Ward
f4ca0df85d comments and renaming 2021-07-01 10:35:41 -07:00
Nicholas Ward
8de59c2a84 cargo fmt 2021-06-30 21:59:18 -07:00
Nicholas Ward
3959cec180 mutable borrow fix 2021-06-30 21:59:10 -07:00
Nicholas Ward
cad7dc6904 some progress 2021-06-30 21:31:17 -07:00
Nicholas Ward
6cc06b408f small change 2021-06-30 16:34:19 -07:00
Nicholas Ward
0c9d675ecc fixes 2021-06-30 16:34:17 -07:00
Nicholas Ward
af9a2c055c some fixes 2021-06-30 16:33:50 -07:00
Nicholas Ward
6c598ddcfd very initial attempt 2021-06-30 16:33:50 -07:00
wborgeaud
5edaab59e6 Renaming + Clippy 2021-06-16 11:37:07 +02:00
wborgeaud
e647e17720 Simplify insert and rotate gadgets, and check that we don't overrotate. 2021-06-16 11:17:45 +02:00
wborgeaud
8d999ab299 Rewrite insert gadget. 2021-06-16 10:43:18 +02:00
wborgeaud
cfa5807556 Add insert gadget to insert inferred leaf in FRI query rounds 2021-06-14 15:15:22 +02:00