Daniel Lubarov
07d03465b1
Verify that non-canonical splits are OK ( #357 )
...
The effect on soundness error is negligible for our current field, but this introduces an assertion that could fail if we changed to a field with more elements in the "ambiguous" range.
2021-11-15 10:03:13 -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
7185c2d7d2
Fix & cleanup partial products ( #355 )
...
My previous change introduced a bug -- when `num_routed_wires` was a multiple of 8, the partial products "consumed" all `num_routed_wires` terms, whereas we actually want to leave 8 terms for the final product.
This also changes `check_partial_products` to include the final product constraint, and merges `vanishing_v_shift_terms` into `vanishing_partial_products_terms`. I think this is natural since `Z(x)`, partial products, and `Z(g x)` are all part of the product accumulator chain.
2021-11-14 11:58:44 -08:00
Daniel Lubarov
fe1e67165a
256 bit salts ( #352 )
...
I believe I was mistaken earlier, and hash-based commitments actually call for `r = 2*security_bits` bits of randomness.
I.e. I believe breaking a particular commitment requires `O(2^r)` work (more if the committed value adds entropy, but assume it doesn't), but breaking one of `n` commitments requires less work.
It seems like this should be a well-known thing, but I can't find much in the literature. The IOP paper does mention using `2*security_bits` of randomness though.
2021-11-14 11:58:14 -08:00
Daniel Lubarov
26a222bbdf
Fewer wires in PoseidonGate ( #356 )
...
Closes #345 .
2021-11-14 11:57:36 -08:00
Nicholas Ward
ad42104e65
Merge pull request #354 from mir-protocol/smaller_tests
...
Reduced test sizes
2021-11-12 12:32:37 -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
wborgeaud
a48eb2f81d
Merge pull request #346 from mir-protocol/partial_product_chain
...
Use chain structure to compute partial products
2021-11-12 09:39:17 +01:00
wborgeaud
21d3b127e3
Cargo fmt
2021-11-12 09:15:37 +01:00
Daniel Lubarov
9139d1350a
Minor refactor of partial product code ( #351 )
2021-11-11 07:16:16 -08:00
Nicholas Ward
137c6d341c
Merge pull request #281 from mir-protocol/nonnative
...
Non-native field arithmetic
2021-11-10 12:46:13 -08:00
Nicholas Ward
f2ec2cadf4
new fmt
2021-11-10 12:14:23 -08:00
Nicholas Ward
bd427cd629
fixed failing tests
2021-11-10 12:10:32 -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
6705d81fbd
nit
2021-11-10 09:58:16 -08:00
Nicholas Ward
5dd4ed3e1c
addressed comments
2021-11-10 09:58:16 -08:00
Nicholas Ward
244543578b
fixes to subtraction tests, and documentation
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
Nicholas Ward
f639dd3359
fixes to nonnative
2021-11-10 09:58:15 -08:00
Nicholas Ward
f41c8ee16f
fmt
2021-11-10 09:58:15 -08:00
Nicholas Ward
7e81f297f2
another fix
2021-11-10 09:58:15 -08:00
Nicholas Ward
90178b2b0a
many fixes
2021-11-10 09:58:15 -08:00
Nicholas Ward
9e49c3f2b4
fix to test
2021-11-10 09:58:15 -08:00