wborgeaud
150d764440
Simplification
2022-02-22 17:00:08 +01:00
wborgeaud
4ea418a486
Clippy
2022-02-22 16:35:20 +01:00
wborgeaud
064b3c07a8
Forgot to set permutation cap
2022-02-22 16:18:41 +01:00
wborgeaud
6cd2fc62b5
Should work (does not)
2022-02-22 11:44:24 +01:00
wborgeaud
ed4aef0fa0
Fill permutation todos
2022-02-22 10:46:51 +01:00
wborgeaud
56e269e27a
Working (not recursively)
2022-02-22 10:37:08 +01:00
Jakub Nabaglo
c7af639579
Restore vectorization to full Poseidon rounds on Aarch64 ( #498 )
...
* Restore vectorization to full Poseidon layers on Aarch64
* Typos
2022-02-21 17:45:01 -08:00
wborgeaud
85c1e1d5e0
Should work (does not)
2022-02-21 18:00:03 +01:00
wborgeaud
5c1173379e
Compiles
2022-02-21 16:05:24 +01:00
wborgeaud
79ba85eb08
Compiles
2022-02-21 10:52:04 +01:00
wborgeaud
f4a29a0249
Merge branch 'main' into stark_permutation_checks
2022-02-21 10:19:12 +01:00
wborgeaud
d52fabaf26
First pass
2022-02-21 10:18:05 +01:00
Daniel Lubarov
6072fab077
Implement a mul-add circuit in the ALU ( #495 )
...
* Implement a mul-add circuit in the ALU
The inputs are assumed to be `u32`s, while the output is encoded as four `u16 limbs`. Each output limb is range-checked.
So, our basic mul-add constraint looks like
out_0 + 2^16 out_1 + 2^32 out_2 + 2^48 out_3 = in_1 * in_2 + in_3
The right hand side will never overflow, since `u32::MAX * u32::MAX + u32::MAX < |F|`. However, the left hand side could overflow, even though we know each limb is less than `2^16`.
For example, an operation like `0 * 0 + 0` could have two possible outputs, 0 and `|F|`, both of which would satisfy the constraint above. To prevent these non-canonical outputs, we need a comparison to enforce that `out < |F|`.
Thankfully, `F::MAX` has all zeros in its low 32 bits, so `x <= F::MAX` is equivalent to `x_lo == 0 || x_hi != u32::MAX`. `x_hi != u32::MAX` can be checked by showing that `u32::MAX - x_hi` has an inverse. If `x_hi != u32::MAX`, the prover provides this (purported) inverse in an advice column.
See @bobbinth's [post](https://hackmd.io/NC-yRmmtRQSvToTHb96e8Q#Checking-element-validity ) for details. That post calls the purported inverse column `m`; I named it `canonical_inv` in this code.
* fix
* PR feedback
* naming
2022-02-21 00:39:04 -08:00
Daniel Lubarov
bc3685587c
Rename constraint methods ( #497 )
...
Most of our constraints apply to all rows, and it seems safest to make that the "default".
2022-02-20 16:48:31 -08:00
Daniel Lubarov
bedd2aa711
Rename arithmetic unit to ALU ( #496 )
2022-02-19 17:32:11 -08:00
wborgeaud
9516e14c3e
Merge pull request #491 from mir-protocol/fix_reduction_strategy
...
Fix reduction strategy
2022-02-18 17:07:03 +01:00
Jakub Nabaglo
a736aa8e70
Update MDS matrix and round consts in Poseidon; disable vectorization ( #493 )
2022-02-17 22:01:07 -08:00
wborgeaud
67cb5dfd58
PR feedback
2022-02-17 08:26:23 +01:00
Daniel Lubarov
431faccbdb
Change compute_permutation_z_polys to batch permutation checks ( #492 )
...
* Change `compute_permutation_z_polys` to batch permutation checks
* feedback
2022-02-16 23:37:20 -07:00
Nicholas Ward
20fc5e2da5
merge fixes
2022-02-16 11:36:51 -08:00
Nicholas Ward
74cf5da8e0
clippy
2022-02-16 11:31:45 -08:00
Nicholas Ward
25555c15e0
fixed native GLV; fixed precompute window; other fixes
2022-02-16 11:31:43 -08:00
Nicholas Ward
8ad193db17
use windowed mul in GLV
2022-02-16 11:31:29 -08:00
Nicholas Ward
1e3743f46c
fmt
2022-02-16 11:31:29 -08:00
Nicholas Ward
0140f7a3cf
fixes
2022-02-16 11:31:29 -08:00
Nicholas Ward
e88564ce5e
correct point subtraction
2022-02-16 11:31:29 -08:00
Nicholas Ward
f77192ef66
fmt
2022-02-16 11:31:29 -08:00
Nicholas Ward
f6f7e55191
windowed mul fixes......
2022-02-16 11:31:26 -08:00
Nicholas Ward
a89b306cf8
fmt
2022-02-16 11:30:39 -08:00
Nicholas Ward
12d5239be6
fix
2022-02-16 11:30:39 -08:00
Nicholas Ward
f67e12ee64
fmt
2022-02-16 11:30:39 -08:00
Nicholas Ward
ad1aa4ae10
fixed is_equal
2022-02-16 11:30:39 -08:00
Nicholas Ward
3787f3be22
conditional add
2022-02-16 11:30:39 -08:00
Nicholas Ward
84edb55b63
fmt
2022-02-16 11:30:39 -08:00
Nicholas Ward
134a04220d
is_equal function
2022-02-16 11:30:39 -08:00
Nicholas Ward
978e2ee974
conditional add (doesn't work yet)
2022-02-16 11:30:39 -08:00
Nicholas Ward
8bab62b83d
fix
2022-02-16 11:30:39 -08:00
Nicholas Ward
23cfe91079
fix
2022-02-16 11:30:39 -08:00
Nicholas Ward
64a09616e2
fmt
2022-02-16 11:30:39 -08:00
Nicholas Ward
294a738dc9
moved to new file, and curve random access test
2022-02-16 11:30:39 -08:00
Nicholas Ward
5603816f3b
fix
2022-02-16 11:30:39 -08:00
Nicholas Ward
58492a0ace
fmt
2022-02-16 11:30:39 -08:00
Nicholas Ward
67b7193e82
test for split nonnative, and fixes
2022-02-16 11:30:39 -08:00
Nicholas Ward
53a2a92258
windowed multiplication in circuit
2022-02-16 11:30:32 -08:00
Nicholas Ward
dc44baa592
simpler test
2022-02-16 11:29:13 -08:00
Nicholas Ward
140f0590bc
fmt
2022-02-16 11:29:13 -08:00
Nicholas Ward
5aaa5710a8
test for GLV gadget
2022-02-16 11:29:13 -08:00
Nicholas Ward
5917a09cee
split out glv_mul function
2022-02-16 11:29:13 -08:00
Nicholas Ward
e92d4c25be
fixed clippy
2022-02-16 11:29:13 -08:00
Nicholas Ward
c3126796c0
GLV in circuit
2022-02-16 11:29:13 -08:00