The linear complexity of a semi-infinite sequence s=(s t )t≥0 of elements of the finite field F q , Λ{s}, is the smallest integer Λ such that s can be generated by a linear feedback shift register (LFSR) of length Λ over F q , and is ∞ if no such LFSR exists. By way of convention, the linear complexity of the all-zero sequence is equal to 0. The linear complexity of a linear recurring sequence corresponds to the degree of its minimal polynomial.
The linear complexity \( \Lambda({\bf s^n}) \) of a finite sequence \( {\bf s^n} = s_0 s_1\ldots s_{n-1} \) of n elements of F q is the length of the shortest LFSR which produces \( {\bf s^n} \) as its first n output terms for some initial state. The linear complexity of any finite sequence can be determined by the Berlekamp–Massey algorithm. An important result due to Massey [1] is that, for any finite sequence \( {\bf s^n} \) of length n, the LFSR of length \( \Lambda({\bf s^n}) \) which generates s n is unique if and only if \( n \geq 2...