392 Commits

Author SHA1 Message Date
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
Daniel Lubarov
22ce2da9e1
Add add_const, mul_const, mul_const_add methods (#312)
* Add mul_const, mul_const_add methods

To replace some arithmetic calls; I think it's easier to read.

* One more

* Couple more

* tweak

* tweak
2021-10-20 23:43:52 -07:00
wborgeaud
019ccf537b
Merge pull request #309 from mir-protocol/use_quadratic_extension
Generalize `RandomAccessGate` to allow using quadratic field extensions
2021-10-18 22:00:04 +02:00
wborgeaud
e24285c3b0 Separate random access generators 2021-10-18 21:48:40 +02:00
wborgeaud
5f4a244240 PR feedback 2021-10-18 21:38:57 +02:00
wborgeaud
c7674b24ba Unused imports 2021-10-18 17:27:22 +02:00
wborgeaud
dda14011c5 Forgot a random access check 2021-10-18 17:23:39 +02:00
wborgeaud
5b81006e9a Fill random access gates to make sure all generators are run 2021-10-18 17:11:59 +02:00
wborgeaud
3f0b5ab9d3 Keep track of the last used RAM gate 2021-10-18 16:48:21 +02:00
wborgeaud
a35cd98b03 New random access gadget 2021-10-18 15:45:52 +02:00
wborgeaud
104fd08e72 Working RAM gate 2021-10-18 15:19:09 +02:00
wborgeaud
9503bb22f4 Take config by reference to avoid clone 2021-10-18 11:11:48 +02:00
wborgeaud
00ce9d9f25 Add num_copies to RAM gate 2021-10-18 11:07:18 +02:00
Daniel Lubarov
5098c2a386
Have ArithmeticExtensionGate adapt based on available wires (#287) 2021-10-05 23:28:29 -07:00
Daniel Lubarov
b922def48e
Better errors for insufficient (routed) wires for FRI (#288)
For examlpe, if I change a test to use `ConstantArityBits(4, 5)`, I get

    To efficiently perform FRI checks with an arity of 16, at least 152 wires are needed. Consider reducing arity.
2021-10-05 23:28:04 -07:00
wborgeaud
242ee26b6f Generalize to fields with less than 64 bits 2021-10-05 17:50:38 +02:00
wborgeaud
6d601c6113 Overflow fixes 2021-10-05 14:27:30 +02:00
Daniel Lubarov
9d8b32c355 fmt 2021-10-03 22:59:10 -07:00
Daniel Lubarov
734a5cef27 Snake case warning 2021-10-03 22:25:07 -07:00
Daniel Lubarov
dadc1b2add cargo fix 2021-10-03 22:22:10 -07:00
Nicholas Ward
04aaa172b2
Merge pull request #275 from mir-protocol/arithmetic_u32
U32ArithmeticGate
2021-09-30 14:44:24 -07:00
Nicholas Ward
094f29a1a7 set 0 limb targets 2021-09-30 14:37:23 -07:00
Nicholas Ward
1af224d895 Horner's method 2021-09-30 10:17:51 -07:00
Nicholas Ward
ffd069c6ce fmt 2021-09-30 10:13:33 -07:00
Nicholas Ward
6e21528ad0 constraints test, and fixes 2021-09-30 10:13:28 -07:00
Nicholas Ward
3d207464f5 combine halves separately 2021-09-29 20:04:42 -07:00
Nicholas Ward
862eee8e70 fix 2021-09-29 16:33:34 -07:00
Nicholas Ward
455bc4d553 only 3 copies :( 2021-09-29 15:35:36 -07:00
Nicholas Ward
0811279fb7 range check outputs, and addressed comments 2021-09-29 14:45:14 -07:00
Daniel Lubarov
3f22663296
Split up PartitionWitness data (#273)
* Split up `PartitionWitness` data

This addresses two minor inefficiencies:
- Some preprocessed forest data was being cloned during proving.
- Some of the `ForestNode` data (like node sizes) is only needed in preprocessing, not proving. It was taking up cache space during proving because it was interleaved with data that is used during proving (parents, values).

Now `Forest` contains the disjoint-set forest. `PartitionWitness` is now mainly a Vec of target values; it also holds a reference to the (preprocessed) representative map.

On my laptop, this speeds up witness generation ~12%, resulting in an overall ~0.5% speedup.

* Feedback

* No size data (#278)

* No size data

* feedback
2021-09-28 22:31:20 -07:00
Nicholas Ward
932cc812ab U32ArithmeticGate 2021-09-28 17:03:35 -07:00
Daniel Lubarov
bd38ada0d1 Change case to get rid of warning 2021-09-27 22:39:42 -07:00
wborgeaud
1a508d0c19
Merge pull request #270 from mir-protocol/poseidon_8
Use `SPONGE_WIDTH` instead of hardcoded values in various places
2021-09-27 12:55:46 +02:00
wborgeaud
df9a211475 PR comments 2021-09-27 12:29:27 +02:00
wborgeaud
1a55538e23 8->SPONGE_WIDTH in most places 2021-09-24 15:50:48 +02:00
wborgeaud
42a7ff9cc2 Working 2021-09-24 13:06:07 +02:00
Nicholas Ward
23b1161d27
Merge pull request #249 from mir-protocol/sorting_gadget
Memory sorting gadget
2021-09-23 09:28:47 -07:00
Nicholas Ward
2ec3b29741 addressed comments 2021-09-22 11:49:28 -07:00
Nicholas Ward
644d87e495 fixes galore 2021-09-21 18:01:21 -07:00
Jakub Nabaglo
2f8286ff98
Fix a few warnings (#259) 2021-09-21 13:12:46 -07:00
wborgeaud
0be8650bca PR feedback 2021-09-18 09:23:39 +02:00
wborgeaud
b8f6b3a778 Merge branch 'main' into poseidon_gate 2021-09-18 08:55:54 +02:00
Nicholas Ward
2c1c116ead fixes (addressed comments) 2021-09-17 13:09:24 -07:00
wborgeaud
14bbf5ae11 Fix AVX2 conflict 2021-09-17 17:50:43 +02:00
wborgeaud
675f32835b Minor 2021-09-17 13:50:42 +02:00
wborgeaud
f83c587cc5 Comments 2021-09-17 13:47:08 +02:00
Nicholas Ward
8681cdec54 intermediate wires 2021-09-16 11:16:32 -07:00
wborgeaud
5d7f4de2a6 Working recursively 2021-09-16 19:17:37 +02:00
wborgeaud
c508fe4362 Minor 2021-09-16 18:16:19 +02:00