This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
In mathematics, a polynomial basis is a basis of a polynomial ring, viewed as a vector space over the field of coefficients, or as a free module over the ring of coefficients. The most common polynomial basis is the monomial basis consisting of all monomials. Other useful polynomial bases are the Bernstein basis and the various sequences of orthogonal polynomials.
The set of elements of GF(pm) can then be represented as:
using Zech's logarithms.
Addition using the polynomial basis is as simple as addition modulo p. For example, in GF(3m):
In GF(2m), addition is especially easy, since addition and subtraction modulo 2 are the same thing (so like terms "cancel out"), and furthermore this operation can be done in hardware using the basic XOR logic gate.
Multiplication of two elements in the polynomial basis can be accomplished in the normal way of multiplication, but there are a number of ways to speed up multiplication, especially in hardware. Using the straightforward method to multiply two elements in GF(pm) requires up to m2 multiplications in GF(p) and up to m2 − m additions in GF(p).
Some of the methods for reducing these values include:
- Lookup tables — a prestored table of results; mainly used for small fields, otherwise the table is too large to implement
- The Karatsuba algorithm — repeatedly breaking the multiplication into pieces, decreasing the total number of multiplications but increasing the number of additions. As seen above, addition is very simple, but the overhead in breaking down and recombining the parts make it prohibitive for hardware, although it is often used in software. It can even be used for general multiplication, and is done in many computer algebra systems.
- Linear feedback shift register-based multiplication
- Subfield computations — breaking the multiplication in GF(pm) to multiplications in GF(px) and GF(py), where x × y = m. This is not frequently used for cryptographic purposes, since some composite degree fields are avoided because of known attacks on them.
- Pipelined multipliers — storing intermediate results in buffers so that new values can be loaded into the multiplier faster
- Systolic multipliers — using many cells that communicate with neighboring cells only; typically systolic devices are used for computation-intensive operations where input and output sizes are not as important, such as multiplication.
Squaring is an important operation because it can be used for general exponentiation as well as inversion of an element. The most basic way to square an element in the polynomial basis would be to apply a chosen multiplication algorithm on an element twice. In general case, there are minor optimizations that can be made, specifically related to the fact that when multiplying an element by itself, all the bits will be the same. In practice, however, the irreducible polynomial for the field is chosen with very few nonzero coefficients which makes squaring in polynomial basis of GF(2m) much simpler than multiplication.
Inversion of elements can be accomplished in many ways, including:
- Lookup tables — once again, only for small fields otherwise the table is too large for implementation
- Subfield inversion — by solving systems of equations in subfields
- Repeated square and multiply — for example in GF(2m), A−1 = A2m−2
- The Extended Euclidean algorithm
- The Itoh-Tsujii inversion algorithm
The advantage of the polynomial basis is that multiplication is relatively easy. For contrast, the normal basis is an alternative to the polynomial basis and it has more complex multiplication but squaring is very simple. Hardware implementations of polynomial basis arithmetic usually consume more power than their normal basis counterparts.