Karatsuba Multiplication
Presentation: https://youtu.be/jtImWo3CmZM
1. Field Context: FPk Multiplication
In the extension field FPk, an element A is represented as a polynomial of degree up to k−1 with coefficients in the base field FP:
Multiplying two elements A and B in FPk involves two steps:
Polynomial Multiplication: Compute C′(x)=A(x)⋅B(x).
Reduction: Compute C(x)=C′(x)(modf(x)), where f(x) is the irreducible polynomial of degree k defining the extension.
The Karatsuba algorithm is used to speed up the Polynomial Multiplication step (Step 1).
2. Karatsuba Algorithm for Polynomials
We aim to compute C′(x)=A(x)⋅B(x), where A(x) and B(x) are polynomials of degree N=k−1. We assume k is an even number for simplicity, and let m=k/2.
Step 1: Splitting (Divide)
The polynomials A(x) and B(x) are split into two halves, where A1(x),A0(x),B1(x),B0(x) are polynomials of degree less than m
The product C′(x)=A(x)B(x) expands algebraically as:
The classical method would require four recursive polynomial multiplications of size m.
Step 2: Three Recursive Multiplications
Karatsuba reduces this to three recursive polynomial multiplications, where the coefficients of the polynomials are in FP (or another base field).
M1(x) (High Part):
M1(x)=A1(x)⋅B1(x)M2(x) (Low Part):
M2(x)=A0(x)⋅B0(x)M3(x) (Middle Part – The Karatsuba Trick):
M3(x)=(A1(x)+A0(x))⋅(B1(x)+B0(x))
Step 3: Combination (Conquer)
The middle term is extracted by performing polynomial additions and subtractions over FP:
The final unreduced product C′(x) is then constructed:
(Multiplication by xm or x2m is a simple coefficient shift.)
Step 4: Final Reduction
After obtaining the unreduced product C′(x), the result must be reduced modulo the defining polynomial f(x) to get the final result C(x)∈FPk:
3. Complexity in FPk Context
For a base field FP, the Karatsuba algorithm reduces the complexity of polynomial multiplication from O(k2) base field operations (classical) to O(klog23) base field operations.
Recursive Call Size: The size of the polynomials in the recursive calls is reduced from degree k−1 to approximately degree k/2−1.
Base Operations: The "cost" of addition/subtraction (O(k)) and the recursive multiplications (3⋅T(k/2)) is measured in terms of operations within the base field FP.
The overall time complexity for the polynomial multiplication step remains:
Karatsuba is highly effective in cryptographic contexts (like Elliptic Curve Cryptography) that extensively rely on fast finite field arithmetic in FPk or F2k.
Written by Ryan Kim of Fractalyze
Last updated