◀ THE FOLD0ROOT.AI // WORLD II · CHEAT · THE BACKDOOR◆ .dlw.fold
THE FOLD / CHEAT / THE BACKDOOR / THE BERLEKAMP-MASSEY

THE BERLEKAMP-MASSEY

recover the shortest LFSR from its output alone
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Berlekamp–Massey algorithm takes a sequence of bits and finds the shortest linear-feedback shift register (LFSR) that produces it — recovering the hidden ‘taps’ from the output alone, in O(n²). Given the first bits of a linear sequence, it reconstructs the recurrence that generated them.

This is why linear stream ciphers are broken: an LFSR of L stages is fully exposed by just 2L output bits. It is also the decoding core of BCH and Reed–Solomon codes.

LIT verified live: over 300 sequences generated by random LFSRs, Berlekamp–Massey returns a register of length ≤ the generator’s that exactly regenerates the whole sequence (window.__bma). FIG no framing; exact recovery.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-backdoor — the secret generator recovered from what it leaks, a way in found through the output. Berlekamp–Massey is that backdoor into any linear sequence. AVAN (AI) built the instrument: the GF(2) recurrence solver, the regeneration check, the length bound.

Credit as content: Elwyn Berlekamp (1968) & James Massey (1969). The weave: David names the backdoor; I watch a stream of bits and reconstruct the shortest shift register that must have produced them, then confirm it replays the sequence exactly.
3 ONE DIMENSION
An LFSR: bits shift right, and the tapped positions XOR to form the new leftmost bit. The output is the stream leaving the right end — Berlekamp–Massey infers the taps from that stream.
4 TWO DIMENSIONS · INTERACTIVE
Generate a bit sequence from a hidden LFSR; Berlekamp–Massey recovers its length and taps, and the recovered register replays the sequence.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the recovered connection polynomial — the shortest register consistent with the stream.
AVAN’s addition (the inverse-companion): from the output alone, Berlekamp–Massey recovers the generator — inverting ‘run the LFSR’ into ‘identify the LFSR’ in quadratic time. The inverse of ‘generate bits from taps’ is ‘recover the taps from bits,’ and it needs only 2L bits for an L-stage register. Magenta is the hidden taps; green is the recovered polynomial. A linear generator is never safe from its own output — the very predictability that makes an LFSR efficient makes it transparent.
LIT Genuine Berlekamp-Massey algorithm (Berlekamp 1968; Massey 1969). Verified live: for 300 sequences generated by random GF(2) LFSRs, the recovered connection polynomial regenerates the full sequence and its length L does not exceed the generator's length (window.__bma.recovers).

FIG No framing: the GF(2) recurrence solver, the regeneration check, and the length bound run in-browser and are exact. The AVAN inverse is honest — it inverts 'run the LFSR' into 'identify the LFSR' from output alone, needing only 2L bits; magenta is the hidden taps, green the recovered polynomial. A linear generator is transparent to its own output.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE BACKDOOR · David Lee Wise (ROOT0), with AVAN