1218 Commits

Author SHA1 Message Date
Jakub Nabaglo
8a5419d461
Static asserts in x86 Poseidon (#325)
* Static asserts in x86 Poseidon

* Minor style
2021-10-30 13:10:59 -07:00
Jakub Nabaglo
f286925eaa
Add .DS_Store to .gitignore (#324) 2021-10-27 10:44:36 -07:00
Jakub Nabaglo
7d39074e61
Minor optimizations to addition (#323) 2021-10-26 18:05:52 -07:00
Jakub Nabaglo
bf421314f9
Batched eval_vanishing_poly_base (#317)
* Batched eval_vanishing_poly_base

* Reduce the number of allocations

* Lints

* Delete unused things

* Minor: fix a debug_assert

* Daniel PR comments

* Lints

* Daniel PR comments
2021-10-25 13:23:05 -07:00
Daniel Lubarov
f616d6436d
Print overall gate counts (#322) 2021-10-25 09:12:42 -07:00
Jakub Nabaglo
7a8e12b8f4
Profile-guided optimization script (#321) 2021-10-23 11:55:49 -07:00
Daniel Lubarov
806641d13f
Small optimizations (#319)
* Small optimizations

* Small optimizations

* feedback

* inline

* feedback

* fix unused import
2021-10-22 19:11:05 -07:00
Jakub Nabaglo
db23416b04
Goldilocks: better constant propagation through add_with_wraparound (#320) 2021-10-22 15:02:22 -07:00
Hamish Ivey-Law
c406f464b8
Faster squaring in extension fields (#318)
* Faster squaring for extension fields; use in cube().

* Add squaring to arithmetic benchmark.

* Rename variable to remove warning; adjust comment.

* Inline always (improves latency measurements a lot).
2021-10-22 16:05:00 +11:00
Jakub Nabaglo
001c979599
AVX2: Fold the constant layer into MDS matrix multiplication (#302)
* Fuse constant layer with MDS matrix multiplication

* Warnings and lints

* Minor documentation
2021-10-21 16:51:06 -07:00
Daniel Lubarov
7d45c80c03
Have eval_unfiltered_base call the normal Poseidon methods (#316)
* Have eval_unfiltered_base call the normal Poseidon methods

* fmt
2021-10-21 14:28:07 -07:00
Daniel Lubarov
b0b2a10da0
Only log timing for the final proof in recursion tests (#315)
* Only log timing for the final proof in recursion tests

Just to reduce noise; the performance of the final proof is most meaningful

* fmt
2021-10-21 14:22:22 -07:00
wborgeaud
6463e4f4e7
Merge pull request #314 from mir-protocol/remove_basesum_gates
Ensure only one `BaseSumGate` is instantiated
2021-10-21 16:51:26 +02: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
bf6d0266d5
Merge pull request #313 from mir-protocol/arithmetic_params_order
Change parameters order in `CircuitBuilder::arithmetic`
2021-10-21 09:41:53 +02:00
wborgeaud
1d2ae77eea Change parameters order in CircuitBuilder::arithmetic 2021-10-21 08:56:30 +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
Daniel Lubarov
0b75b24c09
Have split_low_high use range_check (#311) 2021-10-20 23:43:35 -07:00
Daniel Lubarov
cd13a3be65 Update bimap 2021-10-19 19:35:10 -07:00
Daniel Lubarov
64cd2e5686
2 challenges, 28 routed wires (#310)
* 2 challenges, 28 routed wires

2 challenges gives certain checks approximately (field_bits - degree_bits) * 2 bits of security, so we maintain our target of 100 bits for circuits with 2^14 gates or fewer.

28 routed wires is the min for `InterpolationGate`. A lower number helps reduce proof sizes. We can go back to a high number if there's any strong reason to reduce our gate count (e.g. if we were trying to hit 2^12).

* Check FRI conjectured security

* Fix
2021-10-19 12:38:20 -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
0af4b1f02a
Merge pull request #308 from mir-protocol/borrow_new_from_config
Minor: Take `CircuitConfig` by reference to avoid a few clones
2021-10-18 21:49:24 +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
Jakub Nabaglo
1a43d130d9
Relegate poseidon_naive to testing only. (#303) 2021-10-14 18:35:57 -07:00
Jakub Nabaglo
3790b55c4b
Delete obsolete optimizations (Crandall Poseidon on AVX2 and NEON) (#305) 2021-10-14 08:59:47 -07:00
Jakub Nabaglo
ff3f0891bc
Minor: unused import warning (#304) 2021-10-13 16:20:17 -07:00
Jakub Nabaglo
0f7be8b221
Fix compilation error on Aarch64 (#301) 2021-10-13 10:33:36 -07:00
Jakub Nabaglo
609028c899
Poseidon-12 in hand-rolled ASM (#276)
* Goldilocks Poseidon-12 in asm

* Lints

* Hamish comments

* Reorganize arch-specific files
2021-10-13 09:47:50 -07:00
wborgeaud
0f90e4fbf2
Merge pull request #300 from mir-protocol/clean_get_challenges
Clean `get_challenges`
2021-10-13 18:37:29 +02:00
Jakub Nabaglo
5d099c5d45
x86 ASM tricks for scalar Goldilocks multiplication (#299)
* ASM tricks for scalar Goldilocks multiplication

* Minor style

* Provide generic versions of `add/sub_with_wraparound`

* Minor bugfix
2021-10-13 09:16:45 -07:00
wborgeaud
710959f077 Comments 2021-10-13 15:45:43 +02:00
wborgeaud
7f6d90ee42 Clean get_challenges 2021-10-13 15:39:12 +02:00
wborgeaud
164aa0947e Use cap_height: 0 in size-optimized proof 2021-10-12 21:36:20 +02:00
wborgeaud
d43850e580
Merge pull request #298 from mir-protocol/remove_inferred_elmt
Remove inferred element in compressed proof
2021-10-12 20:22:05 +02:00
wborgeaud
839110b794 coset_index in other places 2021-10-12 20:21:29 +02:00
wborgeaud
1ced853f33 Add coset_index var 2021-10-12 08:40:56 +02:00
wborgeaud
cdb2892969 Move inferred elements to a new struct 2021-10-12 08:38:43 +02:00
Hamish Ivey-Law
ad30f4aca6
WIP: Remove old benchmarks (#297)
* Remove old benchmarkmarking binaries now that we use Criterion.

* Benchmark CrandallField alongside Goldilocks.
2021-10-12 09:46:38 +11:00
wborgeaud
62f3b558ad Typos 2021-10-11 18:45:55 +02:00
wborgeaud
288a8e1155 Minor comments 2021-10-11 18:44:17 +02:00