347 karma · joined April 3, 2019
Even assuming O(n^2) multiplication and O(n) prime divisors, checking a single candidate shouldn't take more than O(n^4). I'm sure that in reality you can do much better, probably significantly under O(n^3), e.g. because there are fewer prime factors, using a faster multiplication algorithm, and by reusing intermediate results during the exponentiations.
Factoring 2^n-1 can be done once for a given n in O(2^(n/4)), so it is not the bottleneck.
There are also probably quite a lot of checks that can quickly rule out lots of values without having to give them to the heavy machinery. In the end I expect the total running time to be O(2^n * n^2) or so.
Also, isn't generating/enumerating maximal length LFSR solved? AFAIK the maximal length is known to always be 2^n-1 for n bits.
It should be relatively straightforward to check if a given polynomial has the maximum cycle length. All you need to do is make sure that it repeats after 2^n-1 steps but not after any of its divisors. Evaluation can be done using something similar to double-and-add, so assuming 2^n-1 is factored the check should run in poly(n) time.
A (not entirely trivial to compute) formula for the number of max-length terms is also known: https://oeis.org/A011260
- https://www.youtube.com/djhjwhfkffs
Edit: For the reference, I believe that the default should be at least as locked down as my thing (all third-party cookies blocked and so on).
Error fetching https://speed.cloudflare.com/__down?measId=4466372954803167&...: TypeError: i is undefined
Then it pauses itself. When I resume it, it runs for a few seconds (printing more errors) and pauses again.
I am using Firefox 76.0.1 on Fedora 32 x86_64. None of the adblocker addons I'm using are blocking anything.
I've also made builds for Fedora rawhide available at https://copr.fedorainfracloud.org/coprs/hvenev/wgconfd/. The binary packages also seem to work on Fedora 31.
Debian packaging is in progress at https://git.venev.name/hristo/debian/rust-wgconfd/