4241 Commits

Author SHA1 Message Date
wborgeaud
e7c37dfa00 Merge pull request #31 from mir-protocol/fix-subtraction
Fixes a bug in the field subtraction
2021-05-04 17:59:23 +02:00
wborgeaud
20dae028d8 fix subtraction 2021-05-04 17:57:59 +02:00
wborgeaud
eb3011b02a More work on polynomial commitments 2021-05-04 17:48:26 +02:00
wborgeaud
bb8a68e198 Progress on polynomial commitment 2021-05-03 15:17:05 +02:00
wborgeaud
0fa0942981 FRI on coset 2021-04-30 15:07:54 +02:00
Daniel Lubarov
116f92eade Merge pull request #28 from mir-protocol/mds
Add methods for MDS matrices
2021-04-29 07:03:57 -07:00
wborgeaud
c464c038af Merge pull request #27 from mir-protocol/fri-reduction-arity-contd
More work on FRI reduction arity
2021-04-29 08:23:40 +02:00
wborgeaud
fd3e8bcd4c Minor fixes 2021-04-29 08:18:31 +02:00
Daniel Lubarov
6db30c6db3 Precomputed MDS matrix for CrandallField 2021-04-28 14:42:21 -07:00
Daniel Lubarov
5913fd71b9 Add methods for MDS matrices
The defaults are quite slow, but we will override them with fast, precomputed, field-specific matrices; see #4.
2021-04-28 13:59:58 -07:00
Daniel Lubarov
83354972aa cargo fmt 2021-04-28 13:57:22 -07:00
wborgeaud
8590407764 Fixes based on PR comments 2021-04-28 22:55:16 +02:00
Daniel Lubarov
aabfbe82cd Fix GMiMCEvalGate 2021-04-28 13:50:40 -07:00
wborgeaud
f624415a3c Clippy 2021-04-28 18:43:09 +02:00
wborgeaud
79a8ccd9a0 Working bit-reversed version 2021-04-28 18:38:05 +02:00
Daniel Lubarov
815a294305 Merge pull request #25 from mir-protocol/fix_challenger
Fix Challenger's duplicate challenge bug
2021-04-28 09:12:28 -07:00
Daniel Lubarov
ae771bb8bc Merge pull request #26 from mir-protocol/recursive_gmimc
Recursive evaluation of GMiMCGate
2021-04-28 09:05:41 -07:00
Daniel Lubarov
d3ac365667 Recursive evaluation of GMiMCGate
If we did it all with `ArithmeticGate`s, the main loop (with ~101 iterations of cubing and a couple adds) would be fairly expensive, so this uses a (much smaller) custom gate called `GMiMCEvalGate` which does all the computations for one iteration of that loop.
2021-04-27 13:16:24 -07:00
Daniel Lubarov
0252d5c762 Fix Challenger's duplicate challenge bug
`absorb_buffered_inputs` is called even if the input buffer is empty. In that case it should no-op, but it was instead replenishing the output buffer because of this line:

    self.output_buffer = self.sponge_state[0..SPONGE_RATE].to_vec();

Easiest fix is to skip that code if the input buffer is empty.
2021-04-27 09:10:01 -07:00
wborgeaud
d5da6308b5 Merge pull request #24 from mir-protocol/fri-reduction-arity
Fri reduction arity
2021-04-27 12:34:20 +02:00
wborgeaud
deb981e97b More fixes 2021-04-27 09:21:04 +02:00
wborgeaud
187b122c62 Fixes based on Daniel's PR comments. 2021-04-27 08:44:34 +02:00
Daniel Lubarov
cf98d7bccb Merge pull request #22 from mir-protocol/field_tweaks
Tweaks to CrandallField
2021-04-26 11:42:12 -07:00
Daniel Lubarov
460ca64b63 Merge pull request #21 from mir-protocol/perm_arg
Port over some code for the permutation argument
2021-04-26 11:41:56 -07:00
wborgeaud
a8c23a357e Merge branch 'main' into fri-reduction-arity 2021-04-26 19:20:10 +02:00
wborgeaud
f40aba3205 Cleaning and commens 2021-04-26 19:19:27 +02:00
wborgeaud
1786f5e07d Merge pull request #23 from mir-protocol/montgomery-barycentric
Montgomery inversion in computation of barycentric weights
2021-04-26 18:51:28 +02:00
wborgeaud
67aa704f6a Working reduction arity 2021-04-26 18:24:57 +02:00
wborgeaud
406df34990 Merge from main 2021-04-26 11:00:59 +02:00
wborgeaud
2dfdc39680 More progress on arity 2021-04-26 10:58:27 +02:00
wborgeaud
49c116d7f6 Montgomery inversion in computation of barycentric weights + clean eval_naive method. 2021-04-26 09:13:28 +02:00
Daniel Lubarov
110a7bc6d9 Fill in a few missing field methods 2021-04-25 18:09:43 -07:00
Daniel Lubarov
ffaa9587fe cargo fmt 2021-04-25 17:16:18 -07:00
Daniel Lubarov
872673702e Tweaks to CrandallField 2021-04-25 17:14:26 -07:00
Daniel Lubarov
53252af4ba Forgot to add new file 2021-04-25 17:05:27 -07:00
Daniel Lubarov
aaa0e4aa4a Port over some code for the permutation argument
This is mostly copy/pasted from plonky1, although there are some differences. E.g. in plonky2 virtual targets are not routable, so they're no longer added as partitions.
2021-04-25 17:02:02 -07:00
Daniel Lubarov
5cf8c50abf Merge pull request #15 from mir-protocol/lagrange_interp
Interpolants of arbitrary (point, value) lists
2021-04-24 20:14:09 -07:00
Daniel Lubarov
06bb902f23 Barycentric formula 2021-04-24 20:11:00 -07:00
Daniel Lubarov
035d15bc3d Interpolants of arbitrary (point, value) lists
Closes #10. This combines Lagrange interpolation with FFTs as mentioned there.

I was previously thinking that all our polynomial encodings might as well just use power-of-two length vectors, so they'll be "FFT-ready", with no need to trim/pad. This sort of breaks that assumption though, as e.g. I think we'll want to compute interpolants with three coefficients in the batch opening argument.

I think we can still skip trimming/padding in most cases, since it the majority of our polynomials will have power-of-two-minus-1 degrees with high probability. But we'll now have one or two uses where that's not the case.
2021-04-24 19:20:18 -07:00
Daniel Lubarov
6c85771ecb Merge pull request #19 from mir-protocol/prover_use_trees
Have the prover use the new MerkleTree API
2021-04-24 11:20:44 -07:00
Daniel Lubarov
a50ba9f590 More unnecessary clones 2021-04-24 11:20:28 -07:00
Daniel Lubarov
6d164adc6a Have the prover use the new MerkleTree API
Before it was storing leaf data and Merkle roots, but nothing in between, since it wasn't yet interacting with intermediate layers (but it will once we hook up the FRI code).
2021-04-24 11:15:11 -07:00
Daniel Lubarov
518470a2d7 Merge pull request #20 from mir-protocol/beta_gamma
Properly use the three betas and gammas
2021-04-24 10:54:32 -07:00
Daniel Lubarov
7ffb9cf9b2 Merge pull request #17 from mir-protocol/rescue_bench
Make Rescue a bit faster
2021-04-24 10:53:52 -07:00
Daniel Lubarov
d18210d6f1 Merge pull request #16 from mir-protocol/clippy
Address some clippy warnings
2021-04-24 10:42:01 -07:00
Daniel Lubarov
03113e85ba Merge pull request #18 from mir-protocol/no_next_access
Remove access to "next" wire & constant values
2021-04-24 10:38:37 -07:00
Daniel Lubarov
4f9aa8879b Properly use the three betas and gammas
... for the three different `Z`s we use. Before I was just using the first value as a temporary thing.
2021-04-23 14:25:24 -07:00
Daniel Lubarov
b18f152c43 Remove access to "next" wire & constant values
As discussed, it seems like the batch opening argument will be a significant cost, and we can reduce that cost by not including shifted openings (except for `Z`s which need them).
2021-04-23 13:54:35 -07:00
Daniel Lubarov
80775eadb1 Make Rescue a bit faster
... by switching to Rescue Prime (which has a smaller security margin), and precomputing an addition chain for the exponent used in the cubic root calculation. Also adds a benchmark.
2021-04-23 13:25:29 -07:00
Daniel Lubarov
af4c8734ce Address some clippy warnings 2021-04-23 12:35:19 -07:00