378 Commits

Author SHA1 Message Date
wborgeaud
e26eb5f4ab Merge branch 'main' into arity4
# Conflicts:
#	src/gates/mod.rs
2021-11-22 22:32:37 +01:00
wborgeaud
15b41ea8fb PR feedback 2021-11-22 22:13:24 +01:00
wborgeaud
172fdd3d89 Comments 2021-11-22 21:20:44 +01:00
wborgeaud
b7cb7e234f Minor 2021-11-22 17:06:40 +01:00
wborgeaud
6aaea002ed Choose between high- and low-degree interpolation gate depending on the arity 2021-11-22 16:10:14 +01:00
wborgeaud
aec88a8528 First try 2021-11-19 18:11:14 +01:00
wborgeaud
22f4c18083 Comments 2021-11-19 11:48:42 +01:00
wborgeaud
4f11713c49 Remove useless test 2021-11-19 11:29:51 +01:00
wborgeaud
90a6ffd775 Use fold1 in mul_many 2021-11-19 11:24:43 +01:00
wborgeaud
939acfed96 Fix mul_many 2021-11-19 11:14:03 +01:00
wborgeaud
0de408c40f MulExtensionGate 2021-11-19 09:31:06 +01:00
Daniel Lubarov
9b55ff9e81
edition = 2021 (#370)
* edition = 2021

Doesn't affect anything for us as far as I've noticed.

* imports
2021-11-17 14:43:54 -08:00
Daniel Lubarov
eb27a2d2b2 warnings 2021-11-16 22:52:01 -08:00
Daniel Lubarov
eb5a60bef1
Allow one BaseSumGate to handle 64 bits (#365) 2021-11-16 09:29:14 -08:00
Daniel Lubarov
1e66cb9aee
Route in constants from a ConstantGate (#367)
Rather than creating arithmetic gates with potentially unique constants.

Should be strictly cheaper, though it only seems to save one gate in practice.
2021-11-16 09:28:58 -08:00
Hamish Ivey-Law
909a5c2392
Fix all lint warnings (#353)
* Suppress warnings about use of unstable compiler features.

* Remove unused functions.

* Refactor and remove PolynomialCoeffs::new_padded(); fix degree_padded.

Note that this fixes a minor mistake in the FFT testing code, where
`degree_padded` value was log2 of what it should have been, preventing
a testing loop from executing.

* Remove divide_by_z_h() and related test functions.

* Only compile check_{consistency,test_vectors} when testing.

* Move verify() to test module.

* Remove unused functions.

NB: Changed the config in the gadgets/arithmetic_extension.rs::tests
module which may change the test's meaning?

* Remove unused import.

* Mark GMiMC option as allowed 'dead code'.

* Fix missing feature.

* Remove unused functions.

* cargo fmt

* Mark variable as unused.

* Revert "Remove unused functions."

This reverts commit 99d2357f1c967fd9fd6cac63e1216d929888be72.

* Make config functions public.

* Mark 'reduce_nonnative()' as dead code for now.

* Revert "Move verify() to test module." Refactor to `verify_compressed`.

This reverts commit b426e810d033c642f54e25ebc4a8114491df5076.

* cargo fmt

* Reinstate `verify()` fn on `CompressedProofWithPublicInputs`.
2021-11-16 21:18:27 +11:00
Daniel Lubarov
8ea6c4d392
Different implementation of RandomAccessGate (#360)
The previous code used an equality test for each index. This variant uses a "MUX tree" instead. If we imagine the items as being the leaves of a binary tree, we can compute the `i`th item by splitting `i` into bits, then performing a "select" operation for each node. The bit used in each select is based on the height of the associated node.

This uses fewer wires and is cheaper to evaluate, saving 31 wires in the recursion circuit.

A potential disadvantage is that this uses higher-degree constraints (degree 4 with our params), but I don't think this is much of a concern for us since we use a degree-9 constraint system.
2021-11-15 10:15:55 -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
Nicholas Ward
4a5123de81 reduced test sizes 2021-11-12 12:12:58 -08:00
Daniel Lubarov
857b74bac5
Bring back the base field arithmetic gate (#343)
* Bring back the base field arithmetic gate

* fix
2021-11-12 09:48:27 -08:00
Nicholas Ward
f2ec2cadf4 new fmt 2021-11-10 12:14:23 -08:00
Nicholas Ward
dd945ef5b7 addressed comments 2021-11-10 11:19:06 -08:00
Nicholas Ward
9043a47e1b more fixes 2021-11-10 11:15:00 -08:00
Nicholas Ward
ea4f950d6e fixes and fmt 2021-11-10 10:54:35 -08:00
Nicholas Ward
270521a17d addressed comments 2021-11-10 09:58:16 -08:00
Nicholas Ward
7336aa0917 fmt 2021-11-10 09:58:16 -08:00
Nicholas Ward
3f619c704c made test_list_le random 2021-11-10 09:58:16 -08:00
Nicholas Ward
6164796898 rename 2021-11-10 09:58:16 -08:00
Nicholas Ward
db31b9f662 sub_nonnative fix 2021-11-10 09:58:16 -08:00
Nicholas Ward
656f052b79 addressed nits 2021-11-10 09:58:16 -08:00
Nicholas Ward
cf3b6df0e4 addressed nits 2021-11-10 09:58:16 -08:00
Nicholas Ward
c861c10a5b nonnative neg 2021-11-10 09:58:16 -08:00
Nicholas Ward
e838096940 use map; and TODOs 2021-11-10 09:58:16 -08:00
Nicholas Ward
1d4bb3950d FFTarget uses BigUintTarget 2021-11-10 09:58:16 -08:00
Nicholas Ward
6ab01e51f3 u32 arithmetic check for special cases 2021-11-10 09:58:16 -08:00
Nicholas Ward
237a1fad1d addressed comments 2021-11-10 09:58:16 -08:00
Nicholas Ward
bd0164c7ef fmt 2021-11-10 09:58:16 -08:00
Nicholas Ward
a3d957fa42 addressed comment: more tests for multiple_comparison 2021-11-10 09:58:16 -08:00
Nicholas Ward
5dd4ed3e1c addressed comments 2021-11-10 09:58:16 -08:00
Nicholas Ward
2d9f8d9719 fix 2021-11-10 09:58:16 -08:00
Nicholas Ward
c664eba3e6 sub test 2021-11-10 09:58:16 -08:00
Nicholas Ward
72134a3eb0 mul test 2021-11-10 09:58:16 -08:00
Nicholas Ward
8f8d03951b uncomment 2021-11-10 09:58:16 -08:00
Nicholas Ward
4c5f2383fe fixes to tests 2021-11-10 09:58:16 -08:00
Nicholas Ward
bbcda969e5 nonnative tests 2021-11-10 09:58:16 -08:00
Nicholas Ward
ee5619b847 fmt 2021-11-10 09:58:16 -08:00
Nicholas Ward
f7ce33b7ae using refs in right places; and lots of fixes 2021-11-10 09:58:16 -08:00
Nicholas Ward
bfe201d951 fmt 2021-11-10 09:58:16 -08:00
Nicholas Ward
87d8129034 reduce 2021-11-10 09:58:16 -08:00
Nicholas Ward
6232aa68fb fix 2021-11-10 09:58:16 -08:00