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 of2^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 andMAX_CHECKED_DEGREE, with nonzero constant term) is primitive over GF(2), i.e. the multiplicative order ofxmodulopolyis2^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; elementihas degreei + 2. Each has minimal weight (number of nonzero terms).