Overview

10 Description of polynomial division using Euclid’s algorithm

This chapter explains how polynomial division works over finite fields and why it is essential for elliptic curve cryptography over extension fields. It shows that once polynomials can be added and multiplied, the next step is division, because point addition formulas require slopes that depend on polynomial inverses. The chapter also emphasizes the role of irreducible polynomials, which behave like primes in ordinary modular arithmetic and make inversion and division possible in a field setting.

The first main idea is Euclid’s division algorithm for polynomials, which produces both a quotient and a remainder. The process starts with the numerator as the remainder, then repeatedly matches leading coefficients, places the resulting term in the correct quotient position, and subtracts an adjusted multiple of the divisor until the remainder has lower degree than the divisor. This same remainder-based process is then used to compute greatest common divisors of polynomials, with special attention to edge cases such as zero inputs. The gcd routine repeatedly applies polynomial division until the remainder vanishes, and the final nonzero polynomial is the gcd, which can be used to detect shared factors and identify irreducible polynomials.

The chapter then extends Euclid’s method to polynomial inversion modulo an irreducible polynomial. Using the extended Euclidean algorithm, it maintains auxiliary polynomials so that when the remainder becomes 1, the tracked coefficient gives the inverse of the original polynomial modulo the irreducible one. Once inversion is available, division becomes a simple combination of inversion followed by multiplication. The chapter closes by presenting code for these routines, showing how the algorithms are implemented in practice, including initialization, loop control, normalization, cleanup, and the handling of special cases needed for reliable low-level arithmetic.

Polynomial Euclid’s algorithm, which is the guts of inversion in elliptic curve pairing algorithms.
figure

Summary

  • Euclid’s division algorithm applies to polynomials over a finite field as well as to integers.
  • The greatest common divisor (gcd) function between two polynomials returns the other argument if one input is zero.
  • The gcd of two polynomials uses the remainder from Euclidean division.
  • The gcd code is used to find irreducible polynomials.
  • Inversion modulo a prime polynomial uses the extended Euclidean algorithm to solve the equation: \[A\cdot t\cong 1\text{ mod }f\]The polynomial \(t=1/A\).
  • Division of polynomials is interpreted as inversion then multiplication.
  • All the routines in this chapter are essential for computing pairing algorithms in part 3.

FAQ

What is Euclid’s algorithm used for in this chapter?It is used to divide polynomials and obtain both the quotient and remainder, which are needed for polynomial gcd computations and for inversion modulo an irreducible polynomial.
How does polynomial division with Euclid’s algorithm start?The routine initializes the remainder to the numerator and the quotient to zero, then repeatedly reduces the remainder until its degree is less than the divisor’s degree.
What do lc() and deg() mean in the polynomial division formulas?lc() means leading coefficient, and deg() means degree of the polynomial.
How is the next quotient term chosen during polynomial division?The algorithm divides the leading coefficient of the current remainder by the leading coefficient of the divisor, then places that value in the quotient at the index equal to the difference of their degrees.
When does the polynomial division loop stop?The loop stops when the degree of the remainder becomes smaller than the degree of the divisor, because the remainder is then the leftover after division.
Why is the gcd of two polynomials useful?The gcd helps identify common factors between polynomials, and if there are no common factors, it can help indicate an irreducible polynomial.
What happens in the gcd routine if one input polynomial is zero?If one polynomial is zero, the gcd is the other polynomial. If both are zero, the routine returns zero by definition.
How is inversion modulo an irreducible polynomial related to the extended Euclidean algorithm?It uses the same steps as the extended Euclidean algorithm, tracking quotients and remainders until the gcd becomes 1, at which point the tracked coefficient gives the inverse.
How is polynomial division modulo an irreducible polynomial implemented?Division is implemented as multiplication by the inverse of the divisor modulo the irreducible polynomial, so a / b becomes a * (1/b).
What is the main idea behind the poly_div() routine?It first computes the inverse of the divisor polynomial and then multiplies the numerator by that inverse to produce the division result modulo the irreducible polynomial.

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