Overview

11 Creating irreducible polynomials

This chapter explains why irreducible polynomials are needed for elliptic-curve pairings over field extensions and how to construct them in practice. Since a field extension of degree k requires a degree-k irreducible polynomial, the text focuses on finding usable examples rather than deriving them directly from closed-form formulas. The author emphasizes that trinomial choices are especially attractive because they are simple and often likely to exist, making them a practical starting point for implementation.

The core mathematical idea is that irreducible polynomials can be identified through properties of finite fields and by testing candidates against the expression x^{q^i} - x. A key theorem states that the product of all monic irreducible polynomials with degrees dividing n equals x^{q^n} - x, which gives a powerful way to detect factors. Using Ben-Or’s algorithm, the chapter describes a trial-and-error process: choose a candidate polynomial, compute greatest common divisors with successive Frobenius-power expressions, and reject any polynomial that shares a factor. Because the density of irreducible polynomials is favorable, especially for the sizes used in cryptographic settings, a working polynomial is expected to be found quickly.

The implementation section translates this method into code by storing the chosen irreducible polynomial and the field-size parameter globally, then initializing a trial polynomial such as x^n + x + 2. The routine repeatedly changes the constant term, builds the multiplication structures needed for exponentiation modulo the candidate, and checks gcds against x^{p^i} - x up to about half the degree. If no factor is found, the candidate is accepted as irreducible and returned; otherwise the search continues with the next coefficient. The chapter concludes that this procedure is efficient enough for the intended cryptographic field sizes and illustrates the method with an example showing that b = 7 gives the first irreducible trinomial for the sample exercise.

Ben-Or’s algorithm for finding irreducible polynomials using trial and error
figure

Summary

  • Trinomials are the simplest polynomials with a high probability of being irreducible over a finite field. Trinomials reduce the amount of work required in computing polynomial products and remainders.
  • A \(k\) degree polynomial \(f\) is irreducible when \[\text{gcd}(x^{p^i}-x, f)=1\]for all \(1\le i\le k/2\).
  • We can find irreducible trinomials incrementing the constant term \(a_0\) until one passes Ben-Or’s algorithm. Mathematicians have proven the density of irreducible polynomials is high, so this is guaranteed to work in only a few steps.

FAQ

Why do elliptic curve pairings need an irreducible polynomial?Pairings are computed over field extensions, and an irreducible polynomial is what defines the extension field. Without it, the finite-field arithmetic needed for pairing computations is not properly established.
What is an irreducible polynomial in this chapter?It is a polynomial over a finite field whose coefficients are taken modulo a prime and which has no nontrivial factors. Such a polynomial is used to define a field extension of the desired degree.
Why are trinomials emphasized as a practical choice?Trinomials are simple three-term polynomials and, among common choices, they have a high probability of being irreducible. That makes them a convenient starting point when searching for a defining polynomial.
What does the theorem about x^{q^n} - x tell us?The theorem states that the product of all monic irreducible polynomials whose degrees divide n is x^{q^n} - x. This means irreducible factors of the relevant degrees are all contained in that expression.
How does Ben-Or’s algorithm test whether a polynomial is irreducible?It checks whether the candidate polynomial shares any common factor with x^{q^i} - x for increasing values of i. If a nontrivial gcd appears, the polynomial is reducible; if no such factor is found up to the needed bound, it is irreducible.
Why does the algorithm only search up to n/2?Any factor larger than n/2 would have a smaller companion factor, so checking beyond that point is unnecessary. This reduces the work while still detecting reducibility.
Why does the code start with a polynomial like x^n + x + 2?It needs a simple trial polynomial to test and adjust. The code then changes the constant term until it finds one that passes Ben-Or’s irreducibility test.
What do the variables irrd and ptok store?irrd stores the chosen irreducible polynomial, and ptok stores the field size q = p^k used by Ben-Or’s algorithm.
Why is the constant term varied in the search loop?The chapter notes that irreducible polynomials are uniformly distributed among coefficient choices, so changing the constant term is an efficient way to try new candidates until one works.
What happens when the routine finds an irreducible polynomial?The polynomial is copied into the output variable, the temporary variables are cleared, and the function returns success. If no polynomial is found within the allowed degree limit, it returns failure.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Elliptic Curve Cryptography for Developers Elliptic Curve Cryptography for Developers ebook for free