20 Commits

Author SHA1 Message Date
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
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
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
Daniel Lubarov
a5206f97a2 Better generator_order per William's comment 2021-04-22 23:59:37 -07:00
Daniel Lubarov
84a71c9ca5 A few more tests, ported (with some adaptations) from plonky1 2021-04-22 21:51:40 -07:00
wborgeaud
6b407e45ef Progress on FRI 2021-04-21 22:31:45 +02:00
Daniel Lubarov
74ce37250e Avoid separate exp calls 2021-04-05 11:39:16 -07:00
Daniel Lubarov
37761a32e8 Simplify as per William's comment 2021-04-04 15:26:38 -07:00
Daniel Lubarov
cb1c69e50f Validate that the cosets for Plonk's permutation argument are disjoint
When we had a large field, we could just pick random shifts, and get disjoint cosets with high probability. With a 64-bit field, I think the probability of a collision is non-negligible (something like 1 in a million), so we should probably verify that the cosets are disjoint.

If there are any concerns with this method (or if it's just confusing), I think it would also be reasonable to use the brute force approach of explicitly computing the cosets and checking that they're disjoint. I coded that as well, and it took like 80ms, so not really a big deal since it's a one-time preprocessing cost.

Also fixes some overflow bugs in the inversion code.
2021-04-04 14:34:33 -07:00
Daniel Lubarov
facbe117fb Move some stuff into Field 2021-04-02 19:04:26 -07:00
Daniel Lubarov
c25c689ef0 More tests, ported from plonky1 2021-04-02 17:49:57 -07:00
Daniel Lubarov
aea4eeaaae Minor 2021-04-02 14:00:26 -07:00
Daniel Lubarov
347206d161 Add Z terms in vanishing poly 2021-03-30 23:12:47 -07:00
Daniel Lubarov
6c8dfb97ac Refactor polynomial code 2021-03-30 13:30:31 -07:00
Daniel Lubarov
58425eb548 Misc 2021-02-27 21:42:12 -08:00
Daniel Lubarov
9fdff8ea08 Gate infra 2021-02-26 13:18:41 -08:00
Daniel Lubarov
3ba9ef8ab7 Const generics in GMiMC 2021-02-24 12:25:13 -08:00
Daniel Lubarov
1480876c9a Add some FRI params & clean up FFT a bit 2021-02-17 22:19:18 -08:00
Daniel Lubarov
13cc76316c Initial commit 2021-02-17 14:36:32 -08:00