Reverse Engineering of Irreducible Polynomials in GF(2^m) Arithmetic

Cunxi Yu, Daniel E. Holcomb, Maciej J. Ciesielski

Abstract

Current techniques for formally verifying circuits implemented in Galois field (GF) arithmetic are limited to those with a known irreducible polynomial $P(x)$. This paper presents a computer algebra based technique that extracts the irreducible polynomial $P(x)$ used in the implementation of a multiplier in $GF(2^m)$. The method is based on first extracting a unique polynomial in Galois field of each output bit independently. $P(x)$ is then obtained by analyzing the algebraic expression in $GF(2^m)$ of each output bit. We demonstrate that this method is able to reverse engineer the irreducible polynomial of an n-bit GF multiplier in n threads. Experiments were performed on Mastrovito and Montgomery multipliers with different $P(x)$, including NIST-recommended polynomials and optimal polynomials for different microprocessor architectures.

Introduction

Galois Field ($GF(2^m)$) arithmetic serves as the mathematical foundation for modern security protocols, including Elliptic Curve Cryptography (ECC) and the Advanced Encryption Standard (AES). A critical design choice in implementing multipliers within these fields is the selection of an irreducible polynomial $P(x)$. This choice dictates the circuit's power consumption, area, and performance characteristics.

However, this design flexibility introduces a significant challenge for formal verification—the process of mathematically proving a circuit's correctness. State-of-the-art verification tools, such as those utilizing Gröbner Basis, require the specific irreducible polynomial as an input. When dealing with third-party IP blocks or legacy designs where documentation is missing, the polynomial is unknown, rendering standard verification nearly impossible. While reverse engineering techniques exist for standard integer arithmetic, they are generally inapplicable to the "carry-free" nature of Galois Fields.

Methodology

The proposed approach utilizes symbolic computer algebra to reconstruct $P(x)$ from a gate-level netlist through a two-step process:

1. Parallel Backward Rewriting

The circuit is modeled as a network of logic gates, where each gate is represented by a polynomial (e.g., an XOR gate is represented as $a + b \pmod 2$). Starting from the primary output bits, the algorithm performs backward rewriting, substituting gate functions until the expression is defined entirely by the primary inputs.

2. Irreducible Polynomial Extraction

In $GF(2^m)$, multiplication is performed modulo $P(x)$. This modular reduction causes "out-field" products—terms that would naturally result in a degree higher than $m$—to be reduced and distributed back into lower-order bits. The authors demonstrate that by identifying which specific output bits contain these reduced "out-field" product terms, they can uniquely reconstruct the coefficients of $P(x)$.

Algorithm for extracting the irreducible polynomial by analyzing output bit expressions.

The "No-Carry" Advantage

A key innovation of this method is exploiting the lack of carry chains in GF arithmetic. In standard integer multipliers, every output bit typically depends on a large number of input bits due to carries, leading to a "memory explosion" during symbolic analysis. Conversely, in $GF(2^m)$, the logic cones for each output bit are relatively independent. This allows the extraction process to be parallelized across multiple CPU threads, significantly improving scalability.

Experimental Results

The method was evaluated using Mastrovito and Montgomery multipliers across various bit-widths and architectures, including NIST-recommended standards and polynomials optimized for ARM, Intel Pentium, and MSP430 processors.

Runtime performance across different output bit positions for various architectures, demonstrating the parallel nature of the extraction.

Performance and Scalability

  • Mastrovito Multipliers: The tool successfully extracted polynomials for multipliers up to 571 bits (a high-security ECC standard). A 571-bit multiplier, comprising over 1.6 million equations, was reverse-engineered in approximately 68 minutes using 16 threads.
  • Montgomery Multipliers: The tool handled these more complex architectures up to 283 bits. At 409 bits, the process exceeded the 32GB memory limit of the test environment, indicating a current ceiling for unoptimized Montgomery rewriting.
  • Impact of Logic Synthesis: Interestingly, multipliers processed by logic synthesis tools (like ABC) were faster to reverse engineer. Optimization tends to reduce logic cone depth, which simplifies the symbolic rewriting process.

Conclusion

This research provides a robust solution for identifying the mathematical rules governing cryptographic hardware. By leveraging the unique algebraic signatures of irreducible polynomials and the parallelizable nature of carry-free arithmetic, the authors enable the formal verification of large-scale, black-box $GF(2^m)$ components. Future work may focus on reducing memory overhead for Montgomery multipliers and extending the technique to composite field arithmetic.

Summary updated

Abstract

Current techniques for formally verifying circuits implemented in Galois field (GF) arithmetic are limited to those with a known irreducible polynomial P(x). This paper presents a computer algebra based technique that extracts the irreducible polynomial P(x) used in the implementation of a multiplier in GF(2^m). The method is based on first extracting a unique polynomial in Galois field of each output bit independently. P(x) is then obtained by analyzing the algebraic expression in GF(2^m) of each output bit. We demonstrate that this method is able to reverse engineer the irreducible polynomial of an n-bit GF multiplier in n threads. Experiments were performed on Mastrovito and Montgomery multipliers with different P (x), including NIST-recommended polynomials and optimal polynomials for different microprocessor architectures.
BibTeX
@inproceedings{yu2017reverse,
  author = {Cunxi Yu and Daniel E. Holcomb and Maciej J. Ciesielski},
  title = {{Reverse Engineering of Irreducible Polynomials in GF(2^m) Arithmetic}},
  booktitle = {DATE},
  year = {2017},
  url = {https://openreview.net/forum?id=hW9pdfzpd48P},
}
Figure