Skip to main content

Module maximum_length_polynomials

Module maximum_length_polynomials 

Source
Expand description

Maximum length (primitive) polynomials over GF(2).

Polynomials are bit masks: bit k is the coefficient of x^k, so x^3 + x + 1 is 0b1011. An LFSR with a primitive characteristic polynomial of degree n produces a maximum-length sequence of period 2^n - 1.

See the book entry LFSRs and Gold codes.

Constants§

MAX_CHECKED_DEGREE
Largest degree supported by is_primitive_polynomial (limited by trial-division factoring of 2^n - 1).
MAX_TABLE_DEGREE
Largest degree in the table returned by maximum_length_polynomials.

Functions§

all_maximum_length_polynomials
Enumerates every primitive polynomial of the given degree (2..=24).
is_primitive_polynomial
Tests whether poly (degree between 2 and MAX_CHECKED_DEGREE, with nonzero constant term) is primitive over GF(2), i.e. the multiplicative order of x modulo poly is 2^n - 1.
maximum_length_polynomial
Returns a minimal-weight primitive polynomial of the given degree (2..=32): a trinomial where one exists, otherwise a pentanomial or heptanomial, taking the numerically smallest.
maximum_length_polynomials
Returns one primitive polynomial for each degree 2..=32; element i has degree i + 2. Each has minimal weight (number of nonzero terms).