75 Commits

Author SHA1 Message Date
Daniel Lubarov
7334341cfa Attempt at simplification 2021-06-01 23:27:09 -07:00
Daniel Lubarov
cb7f8c8b8c
Draw challenge points from the extension field (#51)
* Draw challenge points from the extension field

* Now building

* Misc

* Default eval_unfiltered_base

* fmt

* A few field settings

* Add to Sage

* Display tweak

* eval_filtered_base

* Quartic in bench

* Missing methods

* Fix tests

* PR feedback
2021-05-30 13:25:53 -07:00
Daniel Lubarov
9cf586274e Fix typos 2021-05-25 15:06:05 -07:00
Daniel Lubarov
d9e828811f Typo 2021-05-24 15:10:45 -07:00
Daniel Lubarov
e98593aa7e Little circuit optimization 2021-05-24 15:09:43 -07:00
wborgeaud
a11d2ed36b Fixes based on PR comments 2021-05-24 22:04:06 +02:00
wborgeaud
c9309eb27b Minor 2021-05-24 17:40:26 +02:00
wborgeaud
4f6e9fb2e0 Recursive evaluation for interpolation gate. 2021-05-24 17:31:55 +02:00
wborgeaud
b64a5fab46 Addition and multiplication for ExtensionTarget 2021-05-24 16:36:21 +02:00
wborgeaud
655bcd8eac Minor 2021-05-24 15:31:52 +02:00
wborgeaud
66d6f3c338 Remove useless Qua(d)r(a)ticFieldExtension traits 2021-05-24 14:12:08 +02:00
wborgeaud
b438760f72 Use bits_u64 2021-05-19 20:22:20 +02:00
wborgeaud
78f71672a3 Change Field::exp to using a u64 power. 2021-05-19 12:17:43 +02:00
wborgeaud
e806d86f86 Remove custom primitive_root_of_unity in extension fields by modifying the generators. 2021-05-19 09:35:39 +02:00
wborgeaud
1cbd12edbd Fixes based on PR comments 2021-05-18 22:22:15 +02:00
wborgeaud
8737c8d5b9 revert extension field order 2021-05-18 16:37:21 +02:00
wborgeaud
4f6f2192ab Minor fixes 2021-05-18 16:23:44 +02:00
wborgeaud
96a880193c Clippy 2021-05-18 16:09:22 +02:00
wborgeaud
37f6ee53cc Merge branch 'main' into fri-extension-field 2021-05-18 15:28:42 +02:00
wborgeaud
a2cf2c03b6 Working FRI with field extensions 2021-05-18 15:22:06 +02:00
BGluth
949fb879cc Switched over from OsRng --> thread_rng
- At least on my Linux machine, a signiciant amount of time (> 50%) was spent inside
  OsRng.
- Likely due to blocking behaviour of the rng devices on Linux.
- thread_rng should not block, but at the same time should provide good
  enough rng.
2021-05-14 20:15:03 -06:00
wborgeaud
1e45b0b1c0 Move Frobenius to default trait implementation. 2021-05-11 20:58:04 +02:00
wborgeaud
f1d812812e Added field order test 2021-05-11 15:26:20 +02:00
wborgeaud
04664a54ee Binary extension fields 2021-05-11 14:21:21 +02:00
wborgeaud
5e86e7dc06 Rand + fix mul + tests 2021-05-11 14:06:35 +02:00
wborgeaud
e670ec3ff0 Multiplication + Frobenius + Inverse 2021-05-11 11:46:01 +02:00
wborgeaud
5abcd85f84 Started extension field implementation 2021-05-10 18:45:48 +02:00
wborgeaud
477fe1ea4a Minor fixes 2021-05-06 15:14:43 +02:00
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
Daniel Lubarov
116f92eade Merge pull request #28 from mir-protocol/mds
Add methods for MDS matrices
2021-04-29 07:03:57 -07: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
wborgeaud
79a8ccd9a0 Working bit-reversed version 2021-04-28 18:38:05 +02:00
wborgeaud
d5da6308b5 Merge pull request #24 from mir-protocol/fri-reduction-arity
Fri reduction arity
2021-04-27 12:34:20 +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
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
67aa704f6a Working reduction arity 2021-04-26 18:24:57 +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
872673702e Tweaks to CrandallField 2021-04-25 17:14:26 -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
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
c684193033 Rename a couple vars 2021-04-23 09:24:01 -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