wborgeaud
bdbc8b6931
Merge branch 'main' into generic_configuration
...
# Conflicts:
# src/field/extension_field/mod.rs
# src/fri/recursive_verifier.rs
# src/gadgets/arithmetic.rs
# src/gadgets/arithmetic_extension.rs
# src/gadgets/hash.rs
# src/gadgets/interpolation.rs
# src/gadgets/random_access.rs
# src/gadgets/sorting.rs
# src/gates/arithmetic_u32.rs
# src/gates/gate_tree.rs
# src/gates/interpolation.rs
# src/gates/poseidon.rs
# src/gates/poseidon_mds.rs
# src/gates/random_access.rs
# src/hash/hashing.rs
# src/hash/merkle_proofs.rs
# src/hash/poseidon.rs
# src/iop/challenger.rs
# src/iop/generator.rs
# src/iop/witness.rs
# src/plonk/circuit_data.rs
# src/plonk/proof.rs
# src/plonk/prover.rs
# src/plonk/recursive_verifier.rs
# src/util/partial_products.rs
# src/util/reducing.rs
2021-12-16 14:54:38 +01:00
wborgeaud
6a50c0fc4e
Clippy
2021-12-07 08:56:27 +01:00
wborgeaud
c2ca106a29
Rewrite add_many
2021-12-02 16:56:58 +01:00
wborgeaud
817fe1e3a3
Remove obsolete todos
2021-12-02 16:53:25 +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
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
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
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
wborgeaud
c406432814
Merge branch 'main' into generic_configuration
...
# Conflicts:
# src/gadgets/arithmetic.rs
# src/gadgets/interpolation.rs
# src/gates/interpolation.rs
2021-11-08 10:35:29 +01:00
Daniel Lubarov
e9ae9a045f
import
2021-11-05 21:36:33 -07:00
Daniel Lubarov
75fe5686a2
Better fixed-base exponentiation and exp_power_of_2 ( #340 )
...
Saves 84 gates with `num_routed_wires: 48`.
2021-11-05 09:10:46 -07:00
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
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
wborgeaud
9503bb22f4
Take config by reference to avoid clone
2021-10-18 11:11:48 +02: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
Nicholas Ward
b0a855a9c3
progress on permutation
2021-09-03 18:07:20 -07:00
wborgeaud
69a945547a
route, assert_equal -> connect
2021-08-24 08:25:11 +02:00
Daniel Lubarov
69193a8dc2
Remove *_three methods ( #182 )
...
* Remove *_three methods
Since there's no longer a performance reason for them, and I think the *_many methods are about as short etc.
* PR feedback
2021-08-17 00:38:41 -07:00
wborgeaud
b366482866
The mother of all arithmetic optimizations
2021-08-16 10:18:10 +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
090cf79787
Replace some old division code ( #171 )
...
- Delete unsafe methods
- Have related methods call the new div_add_extension method to simplify
2021-08-10 11:48:53 -07:00
wborgeaud
417e6055ae
Optimize coset in compute_evaluation
2021-08-09 13:21:42 +02:00
Daniel Lubarov
7b20f342df
More eval_unfiltered_recursively tweaks ( #156 )
2021-08-05 08:03:49 -07:00
Daniel Lubarov
079baff718
Optimize some exp methods to use ExponentiationGate ( #151 )
2021-08-04 09:55:29 -07:00
wborgeaud
fc9d64defe
Small nits for the exponentiation gate
2021-08-02 13:12:50 +02:00
Daniel Lubarov
50b07f2ceb
Special cases for extension field arithmetic ( #138 )
...
We previously checked for special cases, like arithmetic on constant Targets, in `arithmetic`. We can handle those cases without actually adding an `ArithmeticGate`.
Now that `arithmetic` just calls `arithmetic_extension`, it makes more sense to check for special cases in the latter method, so it applies to both base and extension field arithmetic.
Reduces gate count from 16149 to 15689.
2021-07-30 09:03:11 -07: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
8440a4cbdf
fix
2021-07-29 15:15:40 -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
Nicholas Ward
56b62f1964
new exp gate takes in CircuitConfig and determines num_bits
2021-07-29 10:26:46 -07:00
Nicholas Ward
fa06cc5509
fix
2021-07-28 17:37:26 -07:00
Nicholas Ward
17217f1143
addressed nit
2021-07-28 17:34:41 -07:00
Nicholas Ward
2fd9ce2114
fixes to exp functions
2021-07-28 13:38:41 -07:00
Nicholas Ward
247fa39386
exponentiation gadget
2021-07-28 10:56:12 -07:00
wborgeaud
f325586beb
Replace exp_from_complement_bits with simpler method
2021-07-23 14:58:41 +02:00
wborgeaud
6f8053cc37
Forgot to exponentiate from bits in computation of subgroup_x. Saves 80 gates.
2021-07-23 08:53:00 +02:00
wborgeaud
a70e97befc
Fix merge issues
2021-07-23 08:21:55 +02:00
wborgeaud
9a1c289f8e
Merge branch 'main' into remove_acc_in_gmimc
...
# Conflicts:
# src/gadgets/arithmetic.rs
2021-07-23 08:16:23 +02:00
wborgeaud
47b9936487
PR feedback
2021-07-23 08:15:13 +02:00
wborgeaud
0541956942
Remove useless clone
2021-07-22 16:22:23 +02:00
wborgeaud
1d92191227
Make exp_complement_bits take an iterator to avoid cloning.
2021-07-22 16:18:13 +02:00
wborgeaud
b65e792ff3
- Remove useless rotation gadgets
...
- rotate.rs -> select.rs
- Added `select()` and `select_ext`
- Optimize to use just one gate
2021-07-22 11:58:29 +02:00