liveBook · Manning

Ben-Or algorithm

As explained in Elliptic Curve Cryptography for Developers

Ben-Or's algorithm is a randomized or coefficient-search procedure for testing whether a polynomial over a finite field is irreducible.

Ben-Or’s algorithm tests whether a degree-n polynomial over a finite field is irreducible. It rejects a trial polynomial when it shares a nonconstant factor with x^(p^i)−x for any 1 ≤ i ≤ n/2. section 11.1 section 11.4

A trial-and-error implementation follows this flow:

  • Choose a degree-n trial polynomial, commonly the trinomial x^n+x+a, and vary its constant coefficient. section 11.1 section 11.2
  • For each i from 1 through n/2, compute x^(p^i) modulo the trial polynomial, subtract x, and calculate the polynomial gcd. section 11.1 section 11.2
  • Reject the candidate as soon as a gcd has nonzero degree; otherwise accept it as irreducible. section 11.2 section 11.4
  • Stop when a candidate passes or when the coefficient search reaches the prime-field limit; return failure if no candidate passes. section 11.2

Quadratic example

For f=x²+13x+1 modulo 1187, gcd(x^1187−x,f) is the constant 849, normalized to 1. Because n=2, the test is complete; checking gcd(x^(1187²)−x,f) returns f as expected. section 11.1

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

Use the algorithm flow to inspect candidate initialization, repeated Frobenius-power computation, gcd rejection, acceptance, and cleanup. section 11.2

How Elliptic Curve Cryptography for Developers covers it

How deep it goes
Derives the gcd criterion and maps candidate initialization, power computation, rejection, acceptance, bounds, and cleanup into code.
Examples
Uses degree-n trinomials, coefficient incrementation, and f=x²+13x+1 modulo 1187 as concrete tests.
What it assumes
Assumes polynomial arithmetic and finite-field notation while grounding the decision in a stated gcd condition.
What you can do after
Build it from scratch by implementing bounded coefficient search, modular polynomial powers, gcd rejection, result copying, and cleanup.
How it connects
Connects finite fields, finite-field extensions, polynomial gcds, Frobenius powers, trinomials, and polynomial arithmetic.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elliptic Curve Cryptography for Developers. The section links point to the parts of the book it draws on.