OK, I think I have a reasonably efficient table driven implementation of the 100baseTX scrambler LFSR, capable of predicting future scrambler states with offsets of up to 2^30-1 in constant time.

I still don't grok the math. I ended up doing this by essentially bruteforcing the algebraic solution, creating a class representing a 11th-order polynomial with boolean coefficients symbolically and evaluating the LFSR in a loop 1, 2, 4, 8, 16, etc. times.

The table generator logic would keep track of which starting bits had been xor'd into which state bits, move state bits as the LFSR advanced, cancel out double XORs, etc.

In the end I got a 30 x 11 lookup table that I can just iterate over and xor.

github.com/ngscopeclient/scope

The journey was definitely not the cleanest mathematically, but I've tested pretty thoroughly and it gives identical results to iterating the LFSR.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://ioc.exchange/users/azonenberg/statuses/115847972792031938 on your instance and quote it. (Note that quoting is not supported in Mastodon.)