galois.Poly(coeffs: ArrayLike, field: type[Array] | None = None, order: 'desc' | 'asc' = 'desc')

Creates a polynomial \(f(x)\) over \(\mathrm{GF}(p^m)\).

The polynomial \(f(x) = a_d x^d + a_{d-1} x^{d-1} + \dots + a_1 x + a_0\) with degree \(d\) has coefficients \(\{a_{d}, a_{d-1}, \dots, a_1, a_0\}\) in \(\mathrm{GF}(p^m)\).

coeffs: ArrayLike

The polynomial coefficients \(\{a_d, a_{d-1}, \dots, a_1, a_0\}\).

field: type[Array] | None = None

The Galois field \(\mathrm{GF}(p^m)\) the polynomial is over.

  • None (default): If the coefficients are an Array, they won’t be modified. If the coefficients are not explicitly in a Galois field, they are assumed to be from \(\mathrm{GF}(2)\) and are converted using galois.GF2(coeffs).

  • Array subclass: The coefficients are explicitly converted to this Galois field using field(coeffs).

order: 'desc' | 'asc' = 'desc'

The interpretation of the coefficient degrees.

  • "desc" (default): The first element of coeffs is the highest degree coefficient, i.e. \(\{a_d, a_{d-1}, \dots, a_1, a_0\}\).

  • "asc": The first element of coeffs is the lowest degree coefficient, i.e. \(\{a_0, a_1, \dots, a_{d-1}, a_d\}\).