Overview of the Galois Fields toolbox: finite fields GF(p) and GF(p^n)
The galois_fields toolbox works with finite (Galois) fields GF(p) and GF(p^n), and with polynomials over GF(p). It provides:
creation of fields from primitive polynomials: gf_create_field;
arithmetic between field elements: gf_add, gf_subtract, gf_multiply, gf_divide, gf_power;
arithmetic on polynomials over GF(p): gf_poly_add, gf_poly_subtract, gf_poly_multiply, gf_poly_divide, gf_poly_power;
primitive and minimal polynomials: gf_default_primitive_polynomial, gf_is_primitive_polynomial, gf_primitive_polynomials, gf_minimal_polynomial;
primitive elements: gf_primitive_elements;
operation tables of prime fields: gf_addition_table, gf_subtraction_table, gf_multiplication_table, gf_division_table;
conversions between polynomial and exponential notation: gf_to_exponential, gf_to_polynomial, gf_elements.
Fields of order p^n are built from a primitive polynomial f of degree n over GF(p). If α is a root of f, every non-zero element of the field is a power α^k, 0 ≤ k ≤ p^n - 2, and also a polynomial in α of degree < n with coefficients in GF(p).
Polynomials over GF(p) are row vectors of integer coefficients in 0 .. p-1, constant term first: [1 1 0 0 1] is 1 + x + x⁴. Functions that return polynomials trim them to their degree, and return the zero polynomial as 0.
A field is the list returned by gf_create_field: list(p, n, f, elements), where f is the primitive polynomial (n + 1 coefficients) and elements the table of all the elements of the field.
Elements of GF(p) are integers 0 .. p-1. Elements of GF(p^n), n > 1, are rows of n coefficients (polynomials in α, constant term first). Functions on elements accept several elements at once: a matrix for n = 1, one element per row for n > 1.
In the element table of GF(p^n), n > 1, row 1 is the zero element and row k + 2 is α^k (exponential order). For n = 1 the table is 0:p-1.
The field order p^n can be at most 2^20 (1 048 576) and the degree n at most 20. Element tables have p^n rows, so large fields use memory accordingly.
Run exec builder.sce in the toolbox folder once (a C compiler is required), then exec loader.sce in each session where the toolbox is needed. The help pages are built only when Scilab runs with its Java interface (not with scilab-cli).
| Version | Description |
| 2.0.0 | Refactoring of the function/toolbox. |