
EFFICIENT GROBNER¨ BASIS REDUCTIONS FOR FORMAL VERIFICATION OF GALOIS FIELD MULTIPLIERS Jinpeng Lv and Priyank Kalla Florian Enescu Department of Electrical and Computer Eng. Department of Mathematics and Statistics University of Utah, Salt Lake City, UT-84112 Georgia State University, Atlanta, GA 30302-4038 Abstract - Galois field arithmetic finds application in Problem Statement: We are given the following: many areas, such as cryptography, error correction codes, Given a finite field F k , i.e. given k (circuit input size), • 2 signal processing, etc. Multiplication lies at the core of most along with the corresponding irreducible polynomial Galois field computations. This paper addresses the problem of P(x). Let P(α)= 0, i.e. α be the root of P(x). formal verification of hardware implementations of (modulo) Given a word-level multiplier specification polynomial • multipliers over Galois fields of the type F k , using a computer- F 2 Z = A B (mod P(x)), where A,B,Z 2k (k-bit vectors). algebra/algebraic-geometry based approach. The multiplier Given· a gate-level combinational∈ circuit C. F • circuit is modeled as a polynomial system in 2k [x1,x2, ,xd] The bit-level primary inputs of the circuit are and the verification problem is formulated as a membership··· a0,...,ak 1, b0,...,bk 1 , and z0,...,zk 1 are test in a corresponding (radical) ideal. This requires the { − − } { − } the primary outputs; here ai,bi,gi F2,i = 0,...,k 1. computation of a Grobner¨ basis, which can be computationally ∈ k 1 − Therefore, A = a0 + a1α + + ak 1α − , B = b0 + intensive. To overcome this limitation, we analyze the circuit k 1 ··· − k 1 b1α + + bk 1α − and Z = z0 + z1α + + zk 1α − . topology and derive a term order to represent the polynomials. ··· − ··· − Our objective is to formally prove that A,B F k , the circuit Subsequently, using the theory of Grobner¨ bases over Galois 2 C correctly computes the multiplication∀Z = A∈ B (mod P(x)) fields, we prove that this term order renders the set of polyno- · over F k . Otherwise, we have to produce a counter-example mials itself a Grobner¨ basis of this ideal – thus significantly 2 that excites the bug in the design. improving verification. Using our approach, we can verify the correctness of, and detect bugs in, upto 163-bit circuits in We formulate and solve the verification problem using a computer-algebra and algebraic-geometry based approach. F 163 ; whereas contemporary approaches are infeasible. 2 In particular, we apply the results of Strong Nullstellensatz I. INTRODUCTION over Galois fields, along with Grobner¨ basis techniques, to Finite (Galois) field theory is extensively applied in Elliptic efficiently perform the equivalence verification between the Curve Cryptography (ECC), error correction codes, digital specification polynomial and the multiplier circuit implemen- signal processing, etc. Therefore, dedicated hardware imple- tation. Our approach and contributions can be outlined as mentations of Galois field arithmetic abound. Multiplication follows: lies at the core of most Galois field computations and is a high- We model the given circuit C as a polynomial system • complexity operation, particularly in cryptosystems where the f1,..., fs in F k [x1,x2,...,xd], and denote the generated { } 2 datapath size can be very large. For example, k = 163 for ideal as J = f1,..., fs . The specification Z = A B a Galois field recommended for ECC by the U.S. National (mod P(x)) ish also modeledi as a polynomial f : Z +A· B Institute for Standards and Technology (NIST). Therefore, F · in 2k [x1,x2,...,xd]. this has lead researchers to derive efficient and sophisticated Using the results of Strong Nullstellensatz over finite • hardware implementations of multiplier circuits over Galois fields [6], we show that the verification test can be for- Fields [1] [2] [3]. mulated as membership testing of f in the ideal (J +J0), The complicated and specialized nature of these arithmetic 2k 2k where J0 = x1 x1,...,xd xd . architectures requires custom design, raising the potential for For this idealh membership− test,− iti is required to compute errors and bugs in the implementation. Such errors not only • a Grobner¨ basis of (J + J0). Buchberger’s algorithm [7], cause unintended operation, but they also manifest them- employed for Grobner¨ basis computation, can be compu- selves as security vulnerabilities which can be maliciously tationally intensive, and its efficiency is highly susceptible exploited [4]. Arithmetic bugs are especially catastrophic for to the term orderings used to represent and manipulate the cryptosystems, as incorrect (buggy) hardware multiplication polynomials. To overcome this complexity, we draw in- can lead to full leakage of the secret key [5]. Therefore, it spirations from [8], and derive a term order by analyzing is of utmost importance to verify the correctness of hardware the circuit topology to represent the polynomials. implementations of finite field multipliers residing at the core The work of [8] shows that this term order makes the of such systems. This paper addresses formal verification of • set f1,..., fs a Grobner¨ basis of J. However, using F { } multiplier circuits over (binary) Galois fields of the type 2k the theoretical concepts of Grobner¨ bases over Galois using computer algebra techniques. fields, we further prove that this term order also makes 2k 2k the set f1,..., fs, x x1,...,x xd a Grobner¨ basis This work is sponsored in part by a grant from NSF #CCF-546859. { 1 − d − } 978-3-9810801-8-6/DATE12/ c 2012 EDAA of J + J0. This significantly enhances the capacity of our verification framework, enabling verification of custom However, the result is yet to be reduced modulo the primitive implementations of 163-bit circuits – corresponding to polynomial P(x)= x4 + x3 + 1. This is shown below: the NIST recommended 163-bit elliptic curve. s3 s2 s1 s0 α4 α α3 Not only can we verify the correctness of multiplier s4 0 0 s4 s4 (mod P( )) = s4 ( + 1) • ⇐ · α5 α · α3 α circuits, but we can also detect the presence of bugs using s5 0 s5 s5 s5 (mod P( )) = s5 ( + + 1) ⇐ · α6 α · α3 α2 α our approach. Moreover, the time required to prove cor- s6 s6 s6 s6 s6 (mod P( )) = s6 ( + + + 1) z z z z ⇐ · · rectness or to detect bugs is comparable. Our experiments 3 2 1 0 The final result (output) of the circuit is: Z = z0 + z1α + show that none of the contemporary techniques based 2 3 z2α + z3α ; where z0 = s0 + s4 + s5 + s6; z1 = s1 + s5 + on BDDs, SAT, SMT-solvers etc. can prove correctness s6; z2 = s2 + s6; z3 = s3 + s4 + s5 + s6. beyond 16-bit circuits. The above multiplier design is called the Mastrovito multi- Our approach is generic enough to verify the implemen- plier [1]. In cryptosystems, multiplication is often performed tation of any Galois field arithmetic circuit against its given repeatedly – e.g., for exponentiation. For such applications, polynomial specification. However, for this paper, we concen- Montgomery multiplier architectures [2] [3] over Galois fields F trate only on multiplier circuits over Galois fields 2k . are employed for faster computation (at the expense of area). In our experiments, we verify custom implementations of both II. GALOIS FIELDS & MULTIPLICATION Mastrovito and Montgomery multipliers, where the circuits are given as gate-level (flattened) netlists. We briefly describe the relevant finite field concepts (details can be found in the textbook [9]) and modular multiplier III. RELATED PREVIOUS WORK design over such fields [1] [2] [3]. Contemporary graph-based canonical DAG representations A finite field, also called a Galois field, is a field with a of Boolean functions such as BDDs [10], OKFDDs [11], finite number of elements. The number of elements q of the BMDs [12] and MODDs [13], etc. are ill-suited for such finite field is a power of a prime integer – i.e. q = pk, where p modulo-multiplication applications, particularly over large fi- is prime integer, and k 1. Galois fields are denoted as Fq and nite fields. The work of [14] presents a DAG representation ≥ also GF(q = pk). We are interested in fields where p = 2 and for synthesis and verification of multi-output polynomials over k > 1; i.e. binary Galois extension fields F k , as these are often Z 2 finite integer rings 2k ,k > 1. Since their canonical reduction employed in elliptic curve cryptography implementations. rules employ the theory of polynomial functions over finite F F To construct 2k , we take the polynomial ring 2[x] and an integer rings [15], this approach is not directly applicable F F irreducible polynomial P(x) 2[x] of degree k, and construct over finite fields 2k . Similarly, the work of [16] is also only F F ∈ F F 3 2k as 2[x] (mod P(x)). For example, 8 = 2[x] (mod x + applicable for verification of integer-modulo-arithmetic over Z x + 1). All the field operations are performed modulo the 2k at word-level/RTL, and not over Galois field circuits. irreducible polynomial P(x) and the coefficients are reduced This verification problem is also very hard for SAT solvers, F modulo p = 2. Any element A 2k can be represented in due to the large circuit size, and the presence of AND- ∈ k 1 polynomial form as A = a0 + a1α + + ak 1α − , where XOR computations. Contemporary Satisfiability Modulo The- ··· − q ai F2 = 0,1 and P(α)= 0. For all elements A Fq,A = A, ory (SMT) solvers employ a mixture of theories for reasoning ∈ { q } ∈ and hence A A = 0, A Fq. – however, none of them employ polynomial equation solving − ∀ ∈ F Multiplier circuit design over 2k is illustrated below. over Galois fields (which is itself a hard problem).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-