The disclosure generally relates to a sequential Galois Field (GF) multiplication architecture and method based on Mastrovito multiplication and composite field with a two-tier sequential input fashion.
Galois Counter Mode-Advanced Encryption Standard (GCM-AES) algorithm is already widely used in Internet Protocol Security (IPsec) environment. The link layer security standard, MACsec, of Ethernet has also adopted GCM-AES algorithm as the default encryption/decryption operation. GCM-AES algorithm uses Galois Field GF(2128) multiplication to realize the hash function so that the GCM-AES hardware realization is much more expensive. The hardware size of a single GF(2128) multiplier equals to that of a 128-bit AES core engine. When a MACsec controller with GCM-AES is integrated into a MAC controller of Ethernet, the effected cost ratio for GCM-AES might be higher.
GF(2k) is a finite field having 2k elements, a set defined by a k-order irreducible polynomial. Each element in the set has k bits. The k bits are the coefficients of a polynomial b0+b1x+ . . . +bk−1xk−1 for the element, where bi is an element of GF(2), i.e., 0 or 1. If the irreducible polynomial constituting GF(2k) is g(x), the multiplication of GF(2k) element may be viewed as a two-step computation. The first step is to perform a general polynomial multiplication on the two elements, and the second step is to divide the final polynomial by g(x) and obtain the remainder, i.e., the final result of the multiplication. The addition of GF(2k) elements is logically equivalent to the k-bit XOR operation.
Numerous technologies have been developed for GF multipliers. For example, U.S. Pat. No. 4,251,875 disclosed a general GF multiplier architecture. By using a single GF(2m) multiplier architecture to sequentially input two operands, the disclosed patent accomplishes the GF(2n) multiplication, where m is a multiple of n. U.S. Pat. No. 7,113,968 disclosed a GF multiplier which is based on polynomial multiplication and remainder.
U.S. Pat. No. 7,133,889 disclosed a GF multiplier architecture. As shown in
A direct scheme for designing a GF(2k) multiplier is through the use of fully parallel operation, i.e., two k-bit inputs and one k-bit output. Take Mastrovito method as example. If A, BεGF(2k), A=[a0 a1 . . . ak−1], B=[b0 b1 . . . bk−1], then, Mastrovito multiplier C=AB may be expressed as a matrix vector multiplier, where one operand stays in the original form, i.e., the vector B of equation (1), and the other operand is transformed into another matrix, i.e., ZA:
where all the coefficients of ZA are the linear combination of the A coefficients, i.e., zi,j=fi,j(a0, a1, . . . , ak−1).
In equation (2), qi,j are the coefficients of the remainders with respect to g(x) from xk to X2k−2, expressed as:
where g(x) is a generator polynomial of GF(2k).
Hence, to realize the GF(2k) multiplication through the use of the Mastrovito architecture, equations (2) and (3) must be used to obtain matrix ZA in advance.
Therefore, the realization process for a Mastrovito multiplier only needs to realize matrix ZA and the matrix vector multiplier of equation (1). However, using this approach to realize a GF(2k) multiplier might be expensive in hardware cost. For example, in the GHASH computation of GCM mode, the primitive polynomial of GF(2128) is 1+x+x2+x7+x128, and 24,448 XOR computations (matrix transformation computation), 214 registers, 214 AND computations and 127×128 XOR computations are required. The amounts of hardware cost close to 1˜2 128-bit AES engines.
The exemplary embodiments of the disclosure may provide a sequential Galois Field (GF) multiplication architecture and method.
In an exemplary embodiment, the disclosed relates to a sequential GF multiplication architecture for executing a multiplication of operands A and B of GF(2k), where k is an integer. The multiplication architecture comprises a first tier that prepares related data of operand A in entirety and proceeds data of operand B by sequentially inputting m n-bit data, k=nm, where n and m are positive integers, and a second tier that sequentially receives operand B and directly performs multiplication of GF((2n)m) with a plurality of n-bit multipliers; wherein before the first tier processes, operands A and B are transformed from a GF(2k) into a composite field GF((2n)m), while a multiplication result from the second tier is transformed back to the GF(2k) to accomplish the GF(2k) multiplication.
In another exemplary embodiment, the disclosed relates to a sequential GF multiplication method for executing a multiplication of operands A and B of GF(2k). The multiplication method comprises: transforming operands A and B from a GF(2k) into a composite field GF((2n)m), k=nm, where k, n and m are positive integers; using a first tier for preparing the related data of operand A in entirety and proceeding data of operand B by sequentially inputting m n-bit data; using a second tier for sequentially receiving data of operand B and directly performs the multiplication of GF((2n)m) with a plurality of n-bit multipliers; and transforming a multiplication result from the second tier back to the GF(2k) to accomplish the GF(2k) multiplication.
The foregoing and other features, aspects and advantages of the present disclosure will become better understood from a careful reading of a detailed description provided herein below with appropriate reference to the accompanying drawings.
When k is a large number, such as, 128, GF(2k) multiplication requires an expensive cost for computation. The use of composite field may reduce the computation complexity. The disclosed exemplary embodiments implement a GF(2k) multiplier with composite field GF((2n)m) multipliers and input one of the operands in a sequential manner.
The mathematical expression of composite field is GF((2n)m), where nm=k, n and m are both positive integers. Using the number of bits of the element to explain, the meaning of the composite field is to transform a k-bit element in GF(2k) into m n-bit elements in GF(2n). Because nm=k, the entirety appears to be a k-bit value. In composite field, GF(2n) is a ground field. To map an element from field GF(2k) to field GF((2n)m), it requires the polynomial g(x) to construct the GF(2k) field, as well as an n-order irreducible polynomial p(x) and an m-order irreducible polynomial r(x), where the coefficients of polynomial p(x) belong to GF(2) and the coefficients of r(x) belong to GF(2n).
Then, based on the theory proposed by Christof Paar, a k×k matrix M is found to map the element from GF(2k) to GF((2n)m), the inverse matrix M−1 will map the element from GF((2n)m) back to GF(2k). Take m=2 as an example. Assume that g(x) is the irreducible polynomial to generate GF(2k) space and g(α)=0. The polynomial expression of operand A in GF(2k) is:
A=a
0
+a
1
α+ . . . +a
k−1αk−1, where ai belongs to GF(2).
After being mapped to the composite field, GF((2n)2), A may be expressed as:
A=a
0
+a
1ω, where ai belongs to GF(2n), and ω is the primitive element of GF((2n)2), i.e., the root of r(x) for generating the field, GF((2n)2).
The disclosed exemplary embodiments first construct the ground field GF(2n), then, uses an m-order irreducible polynomial with coefficients belonging to GF(2n) to construct GF((2n)m), e.g., designing GF(2128) with GF((28)16) composite field. The mathematical theory is as follows. Assume that the polynomial for generating GF((2n)m) is:
r(x)=r0+r1x+ . . . +rm−1xm−1+xm,riεGF(2n) (5)
And A, BεGF((2n)m), the polynomial expressions are:
where r(ω)=0, then A×B is
As found in equation (4), there exists regularity in the Mastrovito matrix. After analysis, matrix ZA of the Matsrovito multiplication has a simpler expression different from equations (2) and (3), that is:
Z
A
=[Z
0
Z
1
. . . Z
k−1
], Z
i
=A×ω
i (8)
where Zi is a column vector, and r(ω)=0. This expression allows matrix ZA of Mastrovito to be obtained on-the-fly, and may be easily implemented with hardware. Hence, by using the Mastrovito architecture described in equation (1) and equation (8) to implement equation (7), the following equation may be obtained:
where ω is a primitive element of r(x), i.e., r(ω)=0. In equation (9), Aωi is an m×1 column vector. Hence, each biAωi multiplication is made up by m GF(2n) multipliers. The following is a recursive method to obtain all the Aωi. Assume that A=a0+a1ω+a2ω2+ . . . +am−1ωm−1, then Aω may be expressed as:
With the above equation, a recursive architecture may be designed to obtain Aω, Aω2=(Aω)ω, Aω3=(Aω2)ω and so on in order.
Due to r(ω)=0, Aω multiplication architecture may be implemented with shift registers. Based on equation (5),
Assume that polynomial is r(x)=r0+x3+x4+x5+x16, r0εGF(28), then the exemplary architecture of
Hence, the disclosed exemplary embodiments may be designed as a two-tier multiplication architecture to implement a single GF(2k) multiplier having sequential inputs. The theory of the multiplier architecture is to implement the GF(2k) multiplication with GF((2n)m) multiplication.
Before first tier 610 processes, operands A and B are mapped from field GF(2k) to field GF((2n)m). Then, first tier 610 uses a sequential architecture to obtain A, Aω, . . . , Aωm−1 sequentially. Because of requiring the shift operation, the related data of operand A need to be ready simultaneously for placing on the exemplars of
Take k=128=8×16 as example. First tier 610 may process one 128-bit operand by sequentially inputting 16 8-bit data, and the processing requires 16 cycles. Second tier 620 may use 16 8-bit Mastrovito multipliers to implement GF((28)16) multiplication directly.
In the exemplary flow of
As aforementioned, Aω multiplication architecture may be implemented with shift registers. Accordingly,
Please refer to
Step 930 includes shifting first group registers 411-41m to the right once to obtain Aω, simultaneously inputting b1 and performing a GF(2n) multiplication with the values stored in the first group registers to compute b1Aω, further performing an XOR operation with b0A stored in second group registers 701-70m, and restoring the operation result in second group registers 701-70m. At this point, b0A+b1Aω may be obtained from the values stored in second group registers 701-70m. Accordingly, for sequential inputs b2, b3, bm−1, step 930 is repeated, i.e., from shifting the first group registers to right once until restoring the operation result to the second group registers. Finally, the result of equation (9) is obtained from second group registers 701-70m, i.e. b0A+b1Aω+ . . . +bm−1Aωm−1, as shown in step 940.
As found in the exemplar of
Therefore, for the similar applications with two operands having different timing, the exemplary architecture of
The table of
In summary, the disclosed exemplary embodiments are based on Mastrovito multiplication and composite field theory. By using a two-tier multiplication architecture to implement a single sequential GF(2k) multiplier. The first tier prepares one k-bit operand by sequentially inputting m n-bit data. The second tier uses directly a n-bit architecture to implement GF((2n)m) multiplication. When the disclosed exemplary embodiments are used in, such as, default encryption/decryption system based on GCM algorithm, e.g., MACsec and IPsec, the disclosed exemplary embodiments may effectively reduce the GCM hardware cost. In addition, the disclosed exemplary embodiments may also be used in general applications of GF multiplication, such as, error correction or elliptic curve cryptography (ECC).
Although the disclosed exemplary embodiments have been described with reference to the exemplary embodiments, it will be understood that the present invention is not limited to the details described thereof. Various substitutions and modifications have been suggested in the foregoing description, and others will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
099110213 | Apr 2010 | TW | national |