The fxt demos: binary polynomials and finite fields

Directory gf2n: Binary polynomials, finite fields GF(2^n) and shift registers.
Find a list of all files in this directory here. An index of all topics is here

You may want to look at the outputs first.

all-irredpoly-out.txt is the output of all-irredpoly-demo.cc.
Generate all irreducible binary polynomials of given degree (from Lyndon words). Indicate which are primitive (P) and normal (N).
The demo uses the functions from all-irredpoly.h (fxt/src/bpol/all-irredpoly.h) bit-necklace.h (fxt/src/bits/bit-necklace.h) necklace2bitpol.h (fxt/src/bpol/necklace2bitpol.h) bitpol-normal.cc (fxt/src/bpol/bitpol-normal.cc)

all-normalpoly-out.txt is the output of all-normalpoly-demo.cc.
Find all normal binary polynomials of degree n. Print all corresponding multiplier matrices. Cf. OEIS sequences A027362, A107222, and A272033.
The demo uses the functions from all-irredpoly.h (fxt/src/bpol/all-irredpoly.h) bit-necklace.h (fxt/src/bits/bit-necklace.h) necklace2bitpol.h (fxt/src/bpol/necklace2bitpol.h) normalbasis.h (fxt/src/bpol/normalbasis.h) bitpol-normal.cc (fxt/src/bpol/bitpol-normal.cc) bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h)

all-primpoly-srs-out.txt is the output of all-primpoly-srs-demo.cc.
Shift register sequences (SRS) for all primitive binary polynomials of given degree. The sequences are maximum period sequences (m-sequences).
The demo uses the functions from all-irredpoly.h (fxt/src/bpol/all-irredpoly.h) lfsr.h (fxt/src/bpol/lfsr.h)

bitmat-circulant-out.txt is the output of bitmat-circulant-demo.cc.
Invertible circulant matrices over GF(2). Cf. OEIS sequences A027362 and A003473.
The demo uses the functions from bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h) bitmat-inline.h (fxt/src/bmat/bitmat-inline.h) bit-necklace.h (fxt/src/bits/bit-necklace.h) bitpol-gcd.h (fxt/src/bpol/bitpol-gcd.h) bitpolmod-arith.h (fxt/src/bpol/bitpolmod-arith.h)

bitmat-kronecker-out.txt is the output of bitmat-kronecker-demo.cc.
Irreducible polynomials and Kronecker products of their companion matrices.
The demo uses the functions from bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h) bitmat-inline.h (fxt/src/bmat/bitmat-inline.h) bitpol-irred.h (fxt/src/bpol/bitpol-irred.h) bitpol-primitive.h (fxt/src/bpol/bitpol-primitive.h) bitpol-order.h (fxt/src/bpol/bitpol-order.h) all-irredpoly.h (fxt/src/bpol/all-irredpoly.h) factor.h (fxt/src/mod/factor.h) mersenne.h (fxt/src/mod/mersenne.h)

bitpol-inverse-out.txt is the output of bitpol-inverse-demo.cc.
Modular inversion of binary polynomials via extended gcd (EGCD).
The demo uses the functions from bitpol-gcd.h (fxt/src/bpol/bitpol-gcd.h) bitpol-arith.h (fxt/src/bpol/bitpol-arith.h) bitpolmod-arith.h (fxt/src/bpol/bitpolmod-arith.h)

bitpol-search-irred-out.txt is the output of bitpol-search-irred-demo.cc.
Find binary irreducible polynomials via exhaustive search.
The demo uses the functions from bitpol-irred.h (fxt/src/bpol/bitpol-irred.h) bitpol-irred-rabin.cc (fxt/src/bpol/bitpol-irred-rabin.cc) bitpol-irred-ben-or.cc (fxt/src/bpol/bitpol-irred-ben-or.cc) bitpol-spi.cc (fxt/src/bpol/bitpol-spi.cc)

bitpol-srp-out.txt is the output of bitpol-srp-demo.cc.
Generate all irreducible self-reciprocal binary polynomials of given degree. Cf. OEIS sequences A000048, A175390, and A069925.
The demo uses the functions from bitpol-srp.h (fxt/src/bpol/bitpol-srp.h) all-irredpoly.h (fxt/src/bpol/all-irredpoly.h)

bitpolfactor-out.txt is the output of bitpolfactor-demo.cc.
Factorization of binary polynomials.
The demo uses the functions from bitpol-factor.h (fxt/src/bpol/bitpol-factor.h) bitpol-squarefree.h (fxt/src/bpol/bitpol-squarefree.h) bitpol-degree.h (fxt/src/bpol/bitpol-degree.h) bitpol-print.h (fxt/src/bpol/bitpol-print.h)

bitpolmodmult-out.txt is the output of bitpolmodmult-demo.cc.
Modular multiplication of binary polynomials.
The demo uses the functions from bitpolmod-arith.h (fxt/src/bpol/bitpolmod-arith.h) poly-tab.h (fxt/src/bpol/poly-tab.h)

bitpolmult-out.txt is the output of bitpolmult-demo.cc.
Multiplication of binary polynomials.

clhca-out.txt is the output of clhca-demo.cc.
Cyclic (additive) Linear Hybrid Cellular Automata (CLHCA).
The demo uses the functions from clhca.h (fxt/src/bpol/clhca.h)

fcsr-out.txt is the output of fcsr-demo.cc.
Feedback Carry Shift Register.
The demo uses the functions from fcsr.h (fxt/src/bpol/fcsr.h)

gf2n-out.txt is the output of gf2n-demo.cc.
Arithmetics over GF(2**n).
The demo uses the functions from gf2n.h (fxt/src/bpol/gf2n.h) gf2n.cc (fxt/src/bpol/gf2n.cc)

gf2n-matrix-out.txt is the output of gf2n-matrix-demo.cc.
Matrix representation of GF(2**n).
The demo uses the functions from bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h) bitmat-inline.h (fxt/src/bmat/bitmat-inline.h) poly-tab.h (fxt/src/bpol/poly-tab.h)

gf2n-minpoly-out.txt is the output of gf2n-minpoly-demo.cc.
Minimal polynomials in GF(2**n).
The demo uses the functions from gf2n.h (fxt/src/bpol/gf2n.h) gf2n-minpoly.cc (fxt/src/bpol/gf2n-minpoly.cc)

gf2n-normal-out.txt is the output of gf2n-normal-demo.cc.
Arithmetics over GF(2**n): conversion to normal basis representation.
The demo uses the functions from gf2n.h (fxt/src/bpol/gf2n.h) gf2n.cc (fxt/src/bpol/gf2n.cc)

gf2n-solvequadratic-out.txt is the output of gf2n-solvequadratic-demo.cc.
Solving the reduced quadratic equation z^2+z==C over GF(2**n).
The demo uses the functions from gf2n.h (fxt/src/bpol/gf2n.h)

gf2n-trace0-generators-out.txt is the output of gf2n-trace0-generators-demo.cc.
Count primitive elements with trace==0 in GF(2**n) (OEIS sequences A192211 and A152049).
The demo uses the functions from gf2n.h (fxt/src/bpol/gf2n.h) gf2n.cc (fxt/src/bpol/gf2n.cc) bitpolmod-arith.h (fxt/src/bpol/bitpolmod-arith.h)

lfsr-out.txt is the output of lfsr-demo.cc.
Linear feedback shift register.
The demo uses the functions from lfsr.h (fxt/src/bpol/lfsr.h) poly-tab.h (fxt/src/bpol/poly-tab.h)

lfsr-fibonacci-out.txt is the output of lfsr-fibonacci-demo.cc.
Linear feedback shift register: Fibonacci setup with right and left shift, polynomial c and reversed polynomial r.

lfsr-galois-out.txt is the output of lfsr-galois-demo.cc.
Linear feedback shift register: Galois setup with right and left shift, polynomial c and reversed polynomial r.

lfsr-revbin-out.txt is the output of lfsr-revbin-demo.cc.
Generate all revbin pairs via a linear feedback shift register.

lfsr-trace0-generators-out.txt is the output of lfsr-trace0-generators-demo.cc.
Count primitive elements with trace==0 in GF(2^n). Cf. OEIS sequences A192211 and A152049. Fast method using class mersenne_coprime.
The demo uses the functions from mersenne-coprime.h (fxt/src/bpol/mersenne-coprime.h)

lhca-out.txt is the output of lhca-demo.cc.
Linear Hybrid Cellular Automata (LHCA).
The demo uses the functions from lhca.h (fxt/src/bpol/lhca.h)

lhca2poly-out.txt is the output of lhca2poly-demo.cc.
Convert minimum-weight LHCA rules to binary polynomials.
The demo uses the functions from lhca.h (fxt/src/bpol/lhca.h) bitpol-irred.h (fxt/src/bpol/bitpol-irred.h)

lowbit-lhca-out.txt is the output of lowbit-lhca-demo.cc.
Generate low-bit LHCA rules (LHCA:= Linear Hybrid Cellular Automaton).
The demo uses the functions from lhca.h (fxt/src/bpol/lhca.h) bitpol-irred.h (fxt/src/bpol/bitpol-irred.h) bitpol-primitive.h (fxt/src/bpol/bitpol-primitive.h) gf2n.h (fxt/src/bpol/gf2n.h)

minweight-lowbit-lhca-out.txt is the output of minweight-lowbit-lhca-demo.cc.
Generate minimal-weight low-bit LHCA rules (LHCA:= Linear Hybrid Cellular Automaton).
The demo uses the functions from lhca.h (fxt/src/bpol/lhca.h) bitcombcolex.h (fxt/src/bits/bitcombcolex.h) bitpol-irred.h (fxt/src/bpol/bitpol-irred.h) bitpol-primitive.h (fxt/src/bpol/bitpol-primitive.h) gf2n.h (fxt/src/bpol/gf2n.h)

necklace2irred-out.txt is the output of necklace2irred-demo.cc.
Convert necklaces to binary polynomials, especially irreducible and primitive ones.
The demo uses the functions from necklace2bitpol.h (fxt/src/bpol/necklace2bitpol.h) bitcyclic-minmax.h (fxt/src/bits/bitcyclic-minmax.h) bitcyclic-period.h (fxt/src/bits/bitcyclic-period.h)

normalbasis-out.txt is the output of normalbasis-demo.cc.
Multiplication with a normal basis for GF(2**n).
The demo uses the functions from normalbasis.h (fxt/src/bpol/normalbasis.h) normal-solvequadratic.h (fxt/src/bpol/normal-solvequadratic.h) bitpol-normal.cc (fxt/src/bpol/bitpol-normal.cc) normal-mult.cc (fxt/src/bpol/normal-mult.cc) normal-primpoly.cc (fxt/src/bpol/normal-primpoly.cc) normal-irredpoly.cc (fxt/src/bpol/normal-irredpoly.cc) bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h)

normalpoly-dual-out.txt is the output of normalpoly-dual-demo.cc.
Find all normal binary polynomials of degree n and their duals.
The demo uses the functions from normalpoly-dual.h (fxt/src/bpol/normalpoly-dual.h)

poly2lhca-out.txt is the output of poly2lhca-demo.cc.
Computation of the LHCA rule corresponding to an irreducible binary polynomial.
The demo uses the functions from bitpol2lhca.cc (fxt/src/bpol/bitpol2lhca.cc) bitpolmod-solvequadratic.h (fxt/src/bpol/bitpolmod-solvequadratic.h) lhca.h (fxt/src/bpol/lhca.h)

primefact-out.txt is the output of primefact-demo.cc.
Finding odd primes that are composite as polynomials over GF(2).
The demo uses the functions from bitpol-irred.h (fxt/src/bpol/bitpol-irred.h) bitarray.h (fxt/src/ds/bitarray.h) primes.h (fxt/src/mod/primes.h) bithigh.h (fxt/src/bits/bithigh.h)

qmatrix-out.txt is the output of qmatrix-demo.cc.
Q-matrix and nullspace of (Q-id).
The demo uses the functions from bitpol-factor.h (fxt/src/bpol/bitpol-factor.h) berlekamp.cc (fxt/src/bpol/berlekamp.cc) bitmat-funcs.h (fxt/src/bmat/bitmat-funcs.h) bitmat-inline.h (fxt/src/bmat/bitmat-inline.h)