COMPUTATIONAL METHOD AND APPARATUS FOR FINITE FIELD MULTIPLICATION

Abstract: A Galois field multiplier (10) is used for obtaining a product (D), which is stored in an accumulating register (20), of two elements (B, C) which are stored in shift registers (12, 14). The product (D) is represented in normal basis form with each binary digit of the bit vector (the product, D) being determined by a sum of the product of the binary digits (bi, ci) representing the two elements. By grouping like ones of one of ordinary digits in the expression for the binary digit of the product and offsetting the suffixes of the binary digits, it is possible to accumulate grouped terms of each of the binary digits of the product simultaneously.

Description: COMPUTATIONAL METHOD AND APPARATUS FOR FINITE FIELD MULTIPLICATION Background of the Invention The present invention relates to a method and apparatus for multiplying two elements in the finite field GF(2 ) . As explained fully in European application 0080528 from which the following discussion is taken, the finite field GF(2 ) is a number system containing 2 elements. Its attractiveness in practical applications results from the ability to represent each element by a vector of m binary digits. The practical application of error-correcting codes makes considerable use of computation in GF(2 ) . Both the encoding and decoding devices for the important Reed-Solomon codes must perform computations in G (2 m ) . The decoding device for the binary Bo . se-Chaudhuri-Hocquenghem codes also must perform computation in- GF(2 ) . The reader is referred to "Error-Correcting Codes" by W. . Peterson and E.J. Weldon, Jr. , 2nd Ed., the M.I.T. Press, 1972, for details of these and other applications of GF(2 ) computation for error-co rection. There exist cryptographic systems with encryption and decryption algorithms that require exponenti tion operations on large numbers. Several public-key cryptosyste s have been proposed that require or may be adapted to use the exponentiation of elements in GF(2 ) . Since the process of exponentiation consists of squaring and multiplication operations, it is essential that these operations be performed as quickly and efficiently as possible. The reader is referred to "Cryptography and Data Security" by D . E. Denning, Addison-Wesley, 1983, for desriptions of GF(2 ) arithmetic and exponentiation algorithms, and for examples of public-key cryptosystems utilizing these algorithms. Recent advances in the art of secrecy coding also require the use of computation in GF(2 ) . The reader is referred to the letter "Implementing Public Key Scheme", by S. Berkovits, J. Kowalchuk and B. Schanning , IEEE Communications Magazine, Vol. 17, pp. 2-3, May 1979. The finite field GF(2) is the number system in which the only elements are the binary numbers 0 and 1 and in which the rules of addition and multiplication are the following: 0 + 0 = 1 + 1 = 0 0 + 1 = 1 + 0 = 1 0 x 0 = 1 x 0 = 0 x 1 = 0 (1) 1 x 1 = 1 These rules are commonly called modulo-two arithmetic. Hence all additions specified in logic expressions or by adders in this application are performed modulo two. In addition, multiplication is implemented with logical AND gates to correspond with the rule set out at (1) above. The finite field GF(2 ) , where m is an integer greater than l r is the number system in which there are 2 elements and in which the rules of addition and multiplica ion correspond to arithmetic modulo an irreducible polynomial of degree with coefficients in GF(2) . Although in an abstract sense there is for each m only one field GF(2 ) , the complexity of the logic circuitry required to perform operations in GF(2 ) depends strongly on the particular way in which the field elements are represented. The conventional approach to the design of logic circuitry to perform operations in GF ~ (2 ) is described in such papers as T. Bartee and D. Schneider, "Computation with Finite Fields", Information and Control, Vol. 6, pp. 79-98, 1963. In this conventional approach, one first chooses a polynomial P(X) of degree m which is irreducible over GF(2) , that is P(X) has binary coefficients but cannot be factored into a product of polynomials with binary coefficients each of whose degree is less than m. An element A in GF(2 ) is then defined to be a root of P(X) , that is, to satisfy P(A) = 0. The fact that P(X) 0 2 is irreducible guarantees that the m elements A = 1, A, A , ... , A of GF(2 ) are linearly independent over GF(2) , that is, that b Q + b A + b 2 A + ... + b m _ x A vanishes only when the binary digits b_,b ,b ... , b are all zeroes. The conventional approach is then to assign the unit vectors of length m with binary components to the elements, 1, A, A , ... , A • As a specific example of the conventional approach, consider the finite field GF(2 ) with the choice p (X) = x J + x + l for the irreducible polynomial of degree 3 The next step is to define A as an element of GF(2^) such that A 3 + A + 1 0 (3) The following assignment of unit vectors is then made: A° = 1 = [0, 0, 1] A = [0, 1, 0] A 2 = [1, 0, 0] (4) An arbitrary element B of GF(2^) is now represented by the binary vector [b2, ]_, bg] with the meaning that B = [b 2 ,b 1 ,b 0 ] = b 2 A 2 + b χ A + b 0 (5) Let C = [C 2 ,C;L,CgJ be a second element of GF(2 3 ) . It follows from equations (4) and (5) that B + C = [b 2 + c 2 rb 1 + CJL^O + c 0 ]. (6) Thus, in the conventional approach, addition in GF (2 ) is easily performed by logic circuitry that merely forms the modulo-two sum of the two vectors representing the elements to be summed component-by-component. Multiplication is, however, considerably more complex to implement. Continuing the example, one sees from equation (3) that A 3 = A + 1 A 4 = A 2 + A (7) where use has been made of the fact that -1 = +1 in GF (2) . From the equations (4) , (5) and (7) it follows that B x C - [d 2 , d j _, d 0 ] . (8) where d 0 =b 0 c Q + b l c 2 + b 2 c l d 2 = bgc 2 + b C + b ] _C } + b 2 c 2 Complex logic circuitry is required to implement equations (9) . Upon taking C = B equation (8) , it follows from equation (9) th B 2 = [e 2 , e x , e 0 ] (10) where eg = bg ex = b 2 (11) e 2 = b χ + b 2 2 and where use has been made of the facts that b = b and b + b = 0 in GF (2) . Whereas the squaring rule of equations (11) is considerably simpler to implement than the multiplication rule of equations (9) , it still has the disadvantage that some additions (in the example, only one ) must be performed and tha the form of the squaring rule varies among the components of th square. By way of summary, one can say that the conventional approach to the design of logic circuitry to perform operations in GF(2 ) leads to simple circuitry for addition, somewhat more complex circuitry for squaring, and very complex circuitry for multiplication. In the European application 0080528 noted above advantage was taken of the following special features of the finite field GF(2 ) . There always exists a so-called normal basis for this finite field, that is, one can always find a field element A such that A, A2, A4, . . . , A '?~ l ~- are a basis for GF(2 m in the sense that every field element B can be uniquely written as " [b m-l' ' ~ 2 ' b l' b 0 ] where g, b-,, b 2 , . . . , b m _ τ are binary digits, Moreover, squaring in GF(2 m is a linear operation in the sense that for every pair of elements B and C in GF(2 m ) (B + C) 2 = B 2 + C 2 (13) Further, it is the case for every element B of GF(2 m ) that _m B = B (14) The inventors in the above application sought to simplify the multiplication procedure by initially choosing a polynomial P(X) of degree m which is irreducible over GF(2) and which has linearly independent roots. This latter condition on P(X) insures that upon defining A as an element of GF(2 m such that P(A) = 0 then A, A 2 , A4, ... A2 m-1 form a normal basis for GF(2 m ). For a discussion of normal bases in finite fields, the reader is referred to "Finite Fields" by Lidl and Neidereiter. Then it B = [b and m-1' C = [c , c , c , c ] are any two elements of m-1' ,m GF(2 ) in said normal basis representation, then the product D = B X C = [d m-1. , .-., d 2 , d 1 , d n 0] (15) has the property that the same logic circuitry which when applied to the components or binary digits of the vectors representing B and C produces d _, will sequentially produce the remaining components d ., ..., d„ , d. , d n of the m-2 2 1 0 product when applied to the components of the successive rotations of the vectors representing B and C. This may be appreciated by considering the binary digits d_ , d , d of e.g. equation (9) above where do = b lCl + bgC! + b^g + b C 2 + b 2 Cg d l = b 0 c 0 + b 2 c 0 + b 0 c 2 + b 2 c l + b l c 2 d 0 = b 2 c 2 -i- b!C 2 + b 2 c χ + b lC + b QCl Like ones of one of the binary digits b j _ or c 1 are grouped to obtain grouped terms so that these may be rewritten in the form d 2 = y (c j _ + c 2 ) + c 0 (b λ + b 2 ) + d ] _ = b (Cg + C j _) + C 2 (bg + b ] _) + bgCg d = χ (C 2 + Cg) + Cχ (b 2 + bg) + D 2 C 2 Where an expression such as bg(C j _ + c ) is subsequently referred to as a grouped term. Thus the logic equation for d j _ could be derived from that for d 2 by reducing the suffix of all binary digits b., c, by 1 (Modulo-3) . A practical implementation was achieved by entering the vectors in respective shift registers, establishing connections and implementing digital logic circuitry to generate all terms of the component d_ simultaneously. Then the shift register contents are rotated one bit position to obtain d , and, similarly d n . Thus, by rotating the vectors B and C in the two shift registers, the binary digits of the product vector D could be generated by the one logic circuit. However, whilst the above proposal is more efficient than the conventional approach, it suffers the disadvantage that all grouped terms constituting one binary digit of the vector must be added simultaneously at one location. This-makes the implementation of the logic complicated, and for large values of , (e.g. greater than 250) , impractical. The above European application also proposes the simultaneous or parallel generation of all m binary digits of the product vector by m identical multiplier logic circuits. However, this simply compounds the difficulty of logic implementation because of the increase in external shift register connections and the large amount of circuitry required. The applicants have recognised that multiplication may be implemented by storing bit vectors B and C in respective shift registers and establishing connections to respective accumulating cells such that a grouped term of each of the expressions d. is generated in respective ones of accumulating cells. By rotating the bit vectors B and C in the shift registers and by rotating the contents of the accumulating cells each grouped term of a respective binary digit d. is accumulated in successive cells. Thus all of the binary digits of the product vector are generated simultaneously in the accumulating cells after one complete rotation of the bit vectors B and C. Embodiments of the invention will now be described by way of example only with reference to the accompanying drawings in which Figure 1 is a block diagram of a multiplier to implement multiplication of two elements in the field GF(2 ) . Figure 2 is a block logic diagram of a component used in the multiplier of Figure 1. Figure 3 is a block diagram of an alternative form of multiplier to implement multiplication of two elements in the field GF(2 5 ) . Figure 4 is a block diagram of a further embodiment of a multiplier to implement multiplication in the field GF(2 ) . Figure 5 is a block diagram of the multiplier of Figure 4 with the connections modified for an optimal implementation of a GF(2 6 ) multiplier. The principle of operation may best be understood by reference to Figures 1 and 2 that represents the logic implementation for multiplying two elements in the finite field GF(2 ) . Before referring to the figures in detail, it will be useful to consider the form of the product D of two elements B and C . B will be of the form B = (b Q , b,, b 2 , b 3 , b. ) in normal basis representation and C will be of the form C = (c Q , c,, c 2 , c 3 , c.) in normal basis representation. The product D will be of the form D = (d Q , d, , d 2 , d 3 , d- ) in normal basis represen¬ tation. Each of the bit vectors d. will consist of grouped terms of the binary digits representing B and C and for the case where = 5 d i =b i+4 (c i+4 + c i+3 + C i+1 + C i } + b i+3 (c i+4 + C i+2 + C i+1 + C i ) + b i+2 (c i+3 + C i ) + - ± + 1 (c i+4 + c i+3 ) In general, all subscripts are added using modulo 5 arithmetic. Thus the binary digits have the form: d Q = b 4 (c 4 +c 3 +c 1 +c 0 ) + b 3 (c 4 +c 2 +c 1 +c 0 )+ b 2 (c 3 +c Q ) + b 1 (c 4 +c 3 ) + b Q (c 4 +c 3 +c 2 ) d l = b 0 (c 0 + c 4 + c 2 + c l } + b 4 (c 0 + c 3 + ~ 2 + ± ) + b 3 (c 4 + c χ ) + 2 (c Q + c 4 ) + b l (c 0 + c 4 + c 3 ) 2 = b 1 (c 1 + c Q + c 3 + c 2 ) + b Q (c 1 + c 4 + c 3 + c 2 ) + b 4 (c Q + c 2 ) + b 3 (c 1 + c Q ) + b 2 (c l + c 0 + c 4 ) d 3 = b 2 (c 2 + C l + C 4 + c 3 ) + b li c 2 + C 0 + c 4 ÷ c 3 ) + h Q { c λ + c 3 ) + b 4 (c 2 + c ± ) + b 3 (c 2 + c ± + c Q ) and d 4 = b 3 (c 3 + c 2 + c Q + c 4 ) + b 2 (c 3 + c-, + c 0 + C A ) + b l (c 2 + c 4 ) + b 0 (c 3 + c 2 ) + b 4 (G 3 + ~ + Cn ) - li ¬ lt will be appreciated from the above that by establishing logic connections to generate the first grouped term b. (c„ + c, + c, + c_) of d n , the first grouped 4 4 3 1 0 ϋ term of the binary digits d , d , d , and d will also be generated by these same connections if the bit vectors of B and C are successively rotated one place to the right. The applicants have recognised tha if connections are also established to generate the second grouped term of d after the generation of the first grouped term and the bit vectors have been rotated, the connections will in fact generate the second grouped term of d, prior to rotation of the bit vectors B and C. Thus by establishing connections to generate successive group terms of the binary digits d„ in successive clock cycles, it is possible to accumulate in parallel each of the binary digits of the product vector. This simplifies implementation of the logic. Referring therefore to Figure 1, a multiplier 10 includes a pair of shift registers 12, 14 each having m cells 16. Shift registers 12 and 14 are loaded with bit vectors B and C respectively so that ' each cell 16 contains one of the binary d igi ts b . or c .. ^ 1 1 The shift registers 12, 14 are connected, in a manner to be described below, to the respective ones of accumulating cells 18 of a term accumulating register 20. The register 20 will have m cells 18 each of which is configured as shown in Figure 2. Referring to Figure 2, each ceil 18 receives a pair of inputs 22, 24 that originate from the shift registers 12, 14 -Ir¬ respectively and an input 26 from the adjacent cell 18 of the register 20. The inputs 22, 24 are connected to inputs of an AND gate 28. The output of gate 28 is added to the input 26 at MOD 2 ADDER 30 whose output is connected to a latch 32. The output of latch 32 forms the input 26 of the next cell 18 and receives a clock signal 34 to store the output of ADDER 30. The nature of inputs 22, 24 is determined by the connections implemented between the cells 16 of shift registers 12, 14 and the cell 18. The connections are arranged such that one grouped term of the binary digits d. is generated at the output of AND gate 28. Thus for the binary digits d to 4 shown above, the binary digits b Q to b 4 and c to c 4 are stored in shift registers 12, 14 respectively as indicated in Figure 1. A first grouped term of d Q is to be accumulated in cell 18 indicated as d Q in Figure 1, i.e. the output of AND gate 42 will represent the grouped term b n ( c 4 + c 3 + c 2 ). To implement this, a connection is established from the cell 16 of shift register 12 containing the binary digit b Q to form input 22. Connections from cells 16 of shift ' register 14 containing binary digits c 4 , c 3 and c 2 are made to ADDER 36 whose output, representing c 4 + c 3 + c 2 , forms the input 24 to AND gate 28. The output of AND gate 28 will thus be b Q (c 4 + c 3 + c 2 ) . Connections are made between the shift register 12, 14 and the cell 18 indicated as d 1 to generate the penultimate grouped term of d-^, i.e. the term b 2 (c Q + c 4 ). Thus cells 16 of shift register 14 containing the binary digits c and c. are connected to adder 38 whose output forms input 24 of the cell 18 designated d and cell 16 of shift register 12 containing binary digit b ? is connected as the input 22 of cell 18 designated d. so that the output of AND gate 28 is b 2 (c Q + c 4 ) . Similarly the shift registers 12, 14 are connected to the cell 18 indicated d 2 to generate the third term of binary digit d„ , i.e. b (c. + c~) ; to the cell 18 indicated d., to provide the second term of binary digit d.. , i.e. b, (c_ + c n + c + c-.) ; and to the cell 18 indicated 1 2 0 4 3 d. to produce the first term of binary digit d , i.e. b 3 (c 3 + c 2 + c Q + c 4 ) . In general, therefore, the jth cell 18 of accumulating register 20 is connected to the shift registers 12, 14 to produce the jth grouped term of a binary digit d. with the subscripts of binary digits b. and c, increased by j-1 using modulo arithmetic. This adjustment of the subscripts of the grouped term is called "offsetting" and ensures that each of the m accumulating cells generates one grouped term of each of the binary digits d. during each of m successive clock cycles. With the connections established the binary digits d n to d ς can be generated as follows. First, the binary digits b_ to b are loaded into shift register 12 and the binary digits c n to c c are loaded 0 5 into shift register 14. These may be loaded in parallel or in series as is most appropriate for the particular shift register utilised. The contents of the latches 32 of the cells 18 of accumulating register 20 are cleared by loading zeroes into each. Upon initation of the multiplication, the grouped terms corresponding to the connections noted above will be generated at the output of each AND gate 28. Because each of the inputs 26 is zero the outputs of the MOD 2 ADDER 30 in each case will correspond to the output of the AND gate 28. On the first rising edge of the clock signal, the output, of each ADDER 30 is entered into the corresponding latch 32 to appear as the input of the adjacent cell 18. Thus, latch 32 of cell 18 designated d« will contain the term b„ (c . + c 3 + c 2 ) , latch 32 of cell 18 designated d, will contain the term b~ (c fl + c.) etc. The first rising edge of the clock, signal causes the simultaneous rotation one position to the right of the contents of registers 12, 14 respectively so that the binary J dig ~its b1. and c1. are transferred to an adjacent cell. Thus, the inputs to cell 18 designated d n will now be b. from shift register 12 and (c, + c„ + c-.) from the adder 36. The output of AND gate 28 of cell 18 designated d Q will thus be (c. + c 2 + c^ ) . The input 26 of cell 18 (d Q ) will be the contents of latch 32 of cell 18 (d 4 ) , i.e. b 3 (c 3 + c 2 + c Q + c 4 ) and thus the output of the MOD 2 ADDER 30 of cell 18 (d Q ) will be 4 ( C;L + c 2 + c 3 ) + b 3 (c 3 + c 2 + c Q + c 4 ) . It will be seen that this corresponds to two grouped terms of the binary digit d. set out above. A careful consideration of the output of each ADDER 30 will show that the sum of two grouped terms of each binary digit d. will appear as the input of respective latches 32. On the next rising edge of the clock signal, the outputs of each ADDER 30 will be entered into respective latches 32 and the binary digits b. and c. rotated in the shift registers 12, 14 respectively. Thus, the contents of the latch of cell 18 (d Q ) , namely b 4 (c χ + c 2 + c 3 ) + b 3 (c 3 + c , + c + c.) will be present as input 26 of cell 18 (d ) and the output of AND gate 28 of cell 18 (d,) will be b n (c + c-. ) , i.e. a third grouped term of the binary digit d 4 . It will be appreciated that after five clock cycles, the sum of all grouped terms of the binary digit d. will be stored in the latch of cell 18 designated d-, and similarly the sum of all the grouped terms of binary digits d-. to d„ will be stored in respective ones of cells 18. Thus, the bit vector constituting the normal basis representation of product D is available by reading the :ontents of the accumulating register 20. It will also be noted the connections from the cells 16 of shift registers 12, and 14 are distributed amongst the cells 18 of accumulating register 20 to reduce the number of inputs of any adder. Whilst the above multiplier constitutes a significant improvement over tha described in the European patent application 0080528, the number of connections may be reduced further although the number of clock cycles required to generate the binary digits d, is increased. A multiplier for the - 5 field GF(2 ) is shown in figure 3 and is similar to that shown in figure 1. Accordingly the reference numerals used in the description of figure 1 and 2 will be used to identify like components with a prefix 100 added, i.e. reference numeral 12 will become 112. The arrangement shown in figure 3 differs in two important ways, namely the provision for exchang¬ ing the contents of shift registers 112 and 114 as indicated by dashed lines 150, 152 and the nature of the connections between the cells 116 and cells 118. It will also be noted that the shift registers 112, 114 are controlled by a separate clock signal, indicated at clock 1, to the accumulating register 120 whose clock signal is indicated at clock 2. The nature of the connections is established from a further manipulation of the terms representing the binary digits d.. Thus considering the binary digit d 4 above, this may be written as: b 3 c 3 +b 3 c 2 +b 3 c 0 +b 3 c 4 +b 2 c 3 +b 2 c 1 +b 2 Cg+ b 2 c 4 +b 1 c 2 +b 1 c 4 +b 0 c 3 +b 4 c 3 +b 4 c 2 +b 4 c 1 and rearranged as b 3 c 3 +[b 3 c 2 +b 2 c 3 ] + [b 3 c 0 +b Q c 3 ] + [b 3 c 4 + b 4 c 3 ] + [b 2 c 1 + b 1 c 2 ] + b 2 c 4 + b 4 c 2 ] [b l c 4 + b 4 c l ] It will be observed tha the terms within the brackets [] possess a symmetry such that if one product term is of the form b.c, , the other product term is obtained by j k interchanging the suffixes, i.e. b.c.. It has been K j recognised that by implementing the logic to produce one product term of each pair, the other product term may be obtained from a simple interchange of the contents of th ~ e shift registers and by a repeated circuit operation each of the product terms of each pair may be obtained. Moreover, the offsetting principle still applies so that the terms of each binary digit will be generated in parallel. The expression for digit d. is b 3 c 3 + bb 33 CC 22 D 2 C 3 + + b 3 C 0 b 0 C 3 + + b 3 C 4 *4 C 3 + + 2 C l b l C 2 + + b 2 C 0 b 0 C 2 + + D 2 C 4 b 4 C 2 The product terms in column Y are then selected and like terms grouped as discussed above with reference to figure 1. Thus column Y may be expressed as b,. (c_ + c. + c ) + b 2_(c1 η + c0- + c4.) + b.1c4,,. By implementing the logic to generate these terms in successive cells 118 of accumulating register 120, the terms of column Z will also be generated after interchange of the shift registers 112, 114 by a second pass through the accumulating cells. The odd term of column X may be generated during one of the two passes through the cells 118 with its generation inhibited during the other pass. It will be noted that the grouped terms of column Y would require 3 inputs to two of the ADDERS whilst only 3 of the accumulating cells 118 are utilised. In order to spread the connections evenly between the cells 118, the expression is modified to select one of each pair of product terras but obtain a different grouping. Thus, in the example above, the third and sixth product terms are selected from column Z rather than Y so that the expression b-, (c 2 + c Q ) + b (c., + c 2 ) + b 2 (c, + c fi ) + b,c, is to "be implemented. This increases the number of cells 118 utilised and reduces the number of connections to some of the ADDERS. Referring therefore to figure 3, the final term b,c. is implemented in the cell 118 designated d 1 4 o (referred to hereafter as 118 [d ] } by connecting cell 116 of shift register 112 containing binary digit b, and cell 116 of shift register 114 containing binary digit c, to the AND gate 128. The connections to the second of cells 118 is established from a second term with the suffixes of the binary digits increased by 1, Modulo 5 i.e. b, (c^ + c, ) and in general the jth cell 118 accumulates a jth term of the expression with suffixes increased by j-1 (Modulo m) . Connections are also established to implement the odd term b~c of col .ax X in cell 118 designated d . The connections to d are modified to include an AND gate 154 to inhibit the accumulation of the add terms e.g. b-.c . The AND gate 154 is located between the cell 116 designated c, and ADDER 160 and receives as one input the output of cell 116 and as its other input an inhibit signal 156 derived from the clock signal. When the inhibit signal 156 is logic level 0, the output of AND gate 154 will be zero so that zero will be added by ADDER 130 to the contents of the latch 136 of the previous cell 118 [d 3 ] - With the connections established, the binary digits „ to b Λ and c„ to c are loaded in respective cells 116 0 4 0 4 of shift registers 112, 114. The contents of each cell 118 is cleared so that each latch 132 contains 0 and the inhibit signal 156 is held at logic level 0 to force the output of AND gate 154 to also be zero. The contents of the shift registers 112, 114 and the cells 118 are then rotated one bit position rightwards by successive clock cycles so that after clock cycles one of each part of the paired product terms is accumulated in respective cells 118. The generation of the terms is shown in table 1 below. Thus, it will be seen that the terms in d 4 correspond to the rewritten expression for one of each of the pairs of product terms. After five clock cycles, registers 112, 114 will have undergone a complete rotation so that binary digits b. and c - will be stored in the cells 116 in which they were initially loaded. - Now the contents of the shift registers 112 and 114 are exchanged through connections 150, 152. This may be accomplished by shifting the contents of both registers 112, 114 for five clock cycles as a serial, circular exchange or alternately could be achieved by parallel connections between cells 116. Serial exchange is shown in Figure 4 and is easiest to implement for large values of m. During the exchange, clock 1 goes through five cycles while clock 2 is held low to prevent unwanted terms accumulating in register 120. When binary digits d. pass through accumulating cells, both clock signals are identical. After the exchange of binary digits, the inhibit signal 156 is set to logic level 1 so that AND gate 154 passes the input from cell 116 to the input of ADDER 160. The circuit operation then continues as exemplified by the table below for the next five clock cycles. Again, it will be seen that the terms of each of the binary digits d. are accumulated in each of the cells 118 in parallel so that after 2m clock cycles of computation the binary digits of D are available in the cells 118 of accumulating register 120. Because of the need to exchange the contents of the shift registers 112, 114, additional clock cycles are required to complete the computation. However, the number of the connections between the shift registers and the accumulating register in the multiplier of Figure 3 is less than those shown in the multiplier of Figure 1 to compensate for this. The implementation shown in Figure 3 has been used to illustrate the generality of the above principle. However, in practical implementations particularly for large valves of m, the connections may be simplified further by selecting the grouped terms in ascending order of the coefficient b. or c.. In this manner a maximum of two connections between each 1 cell of one of the shift registers and the accumulating register is obtained. In order to reduce the time taken to compute the binary digits d. , the multiplier of Figure 3 can be further modified as shown in Figure 4. Again like components will be identified by like reference numerals with a prefix 2 added for clarity. Figure 4 shows a multiplier for generating the binary digits d. in the field GF(2 6 ) . It will be noted that the shift registers 212 and 214 have been segmented into 3 units, 212a, b, or c and 214 a, b or c respectively, each having two cells 116. Similarly, the accumulating register 220 is segmented into 3 units 220 a, b or c each having two cells. It will be noted that each of the shift register units 212 a, b, and c is connected to a corresponding shift register unit 214 a, b and c by paths 250 a, b, c, and 252 a, b, c respectively. The paths 250,252 are utilised to exchange the contents of the registers 212, 214 between units a, b and c rather than through the entire shift register. In this way the number of clock cycles necessary to transfer the contents of the shift register is reduced from m to the number of cells 216 in each unit. The binary digit d,. of product D in GF (2 ) is given by d 5 = b 5 c 5 + b 5 c 4 + b 4 c 5 + b 2 c 5 + b 5 c 2 + b 0 C 5 + b 50 + b lC2 + b^ + b^ + b χ c 3 + b 4 c 2 + b 2 c 4 + b 0°3 + b 3°0 + b 2 c Q + b Q c 2 Thus by implementing the expression b Q (c 3 + c 5 ) + b 1 c 2 + b 2 (c Q + C 5 ) + b 3 c χ + b.c 2 + b ς {c . + c 5 ) the binary digits d. of the normal basis representation of the product D can be generated. It is believed to be apparent from the above discussion that the initial connections to be established are as follows: cell 118 physical connection d l b 2 C 3 d 3 b 0 C 4 d 4 b 2 C 0 d 5 b 4 (C 3 + C 4 } In this case, the odd term is generated initially in cell 218 [d ς ] and the input to the adder 236 associated with cell 218 [d c ] that is initially from the cell 216 containing digit c. is inhibited after the first pass tnrough the accumulating register 220 by use of an AND gate in a manner similar to that shown in Figure 3. The operation of the multiplier of figure 4 is similar to that described above with reference to figure 3. However, exchange of the contents of the registers 212, 214 occurs over the lines 250, 252 to reduce from 6 to 2 the number of clock cycles necessary to complete the exchange. It is believed the above examples clearly and explicitly explain the operation of GF (2 ) the multiplier. Relatively small values of m have been selected for the sake of simplicity but it will be apparent that the above principles apply for large values of usually employed in encryption. However, for the larger values of usually utilised in encryption, the number of product terms in the expression for binary digit d may increase quadratically with the value of m. This renders the implementation of a multiplier impractical because of the large number of connections necessary. For those values of m listed in Table 3 there does exist an optimal normal basis in the sense that it yields an expression d. that has 2m-l product terms, the smallest number possible. Each of the integers m has an indication of type for use in the computer program discussed below. The binary digits b.c. of the binary digit d„ of the product vector D for the optimal normal basis of a value of m listed in Table 3 may be obtained executing the computer program listed in appendix 1. By running the program for m=6 the following results were obtained: d o - 5 5 0 1 1 0 4 1 1 4 5 3 3 5 4 2 2 4 3 2 3 which yields the equation for d„ as: d 0 = b 5 C 5 + b 0 +C l + b l C 0 + b 4 C l + b l C 4 + b 5 c 3 +b 3 c 5 + b 4 c 2 + b 2 c 4 + b 3 c 2 + b 2 c 3 Figure 5 shows the implementation of this expression for the segmented GF(2 ) multiplier shown in Figure 4 with appropriate modifications to the connections to implement the above. The rearrangement of d„ to obtain these connections will be apparent from the above and consideration of Figure 5. An optimal multiplier design exists for every value of m listed in Table 3 such that every accumulating cell 218 has a single input from same shift register cell 216. Thus, m modulo-two ADDERS are eliminated as compared to the multipliers of Figures 1, 3 and 4 further simplifying the circuitry. In addition, the applicants believe that the maximum number of connections to the output of any shift register cell 216 is three. The above description has utilised block diagram representations of the registers 12, 14, 20 and the adders and logic functions. However, it is believed that the selection and operation of the components to perform the functions discussed above will be apparent to a person skilled in the art of digital logic design and that further particula risation of the components is not necessary. Clearly different offset patterns may be chosen whilst utilising the principle of parallel generation of terms of each of the binary digits of d.. -26- α Ci o + + — t i i — • n #—% * »«» . A- A m ■ V ( H rO Η υ + .+ + * # o o - £ tN * *« • * m + u υ u υ υ •*-** **■* * υ o υ T + + υ -H n ( H «H O r O v H u u A JQ J3 Λ A A A — ' — f» ■ «r < -i m + C r-t «r rH u * o * o 4 «?c ¥ N ¥ f U + • ~J~ ¥ <n ¥ ( + * O <? + u υ υ u o « — ^^ + u υ n o υ υ — ' "f o mi mm. «n -i O en o A •H (J «* f) o «-t n C • Ό I A A A A + X) "-* J3 J3 Λ 3 Λ —r m -+ CN CN CN —» + J3 O CN + υ ¥ Q * o +. ¥ <*»• ¥ o ¥ xr + ¥ m u • «r + m u J- N U o o •-• u U -i υ — w ςj f- •H υ σ *-} ■H IT O Ή o m T A XI « -' XI XI A A A A A A A •H o U u O + O + + + + - + <*> υ o CN O O CN o υ o o υ υ U *- r-i u "— u XI — «τ — O U + o "<r Γ H X> A I A *Q o X3 + XI + Λ XI + + + ts (~ mT\ CJ o u 1 u u CN + • «* • H^ A A + + + rΛ + £ + *r ΓN C u O «» «». .-» A T H *r 4- X3 m IN m ¥ ¥.A * + .U U υ o + u o χι o T + «r o m + + + ( U CN "r ■ * • + -i y u Ή XJ XI O O CN HΛ « -' U en o A Q U U 0 C -* • + υ υ A H H o m o y T3 Λ w y X) XI w y A A A U -f + + — + + Ή O m m o Λ "^ ~N + + N n u m + IT m υ o + υ A A + + \n " • 'r + + n + N + + O + «< <H X3 o <c + υ Xi A H ^ U a A m Ή υ U U <→ + + + 0 U U + XI XI yN w u w u — (-1 mm- (j CO O T — • w 1 CN —i •>— n «-J «» O IN O H o m o xi A m O A A A O T Λ XI A A + A A A — w A A + + — u υ CN + + ιH <n <-ι + IN O <- ~i U u y + .H _» A c W-T, - + + r-« y ■* ■ IN •* ■ <n l +T Λ * H + o U Λ N + ^ o IN u + + χι U U O o.+ <* + υ u V Λ n. u y • w M n + w w ( ( O ^H w w J^ mm- mm. O w w IN .Ω X) o n o v (N J3 H y ■ * ■ en «- ( IN o O H m Λ CN O XI A A A A "-* Xϊ "— J3 A o υ Λ J3 XJ J3 + y U w + • + o • Ό CO : u u J 3 u u u m T3 TAβi. £ U ra m ra ■m 2 - TYPE 1 3 TYPE 2 4 TYPE 1 6 TYPE 2 5 - TYPE 9 2 TYPE 2 10 - TYPE 1 12 - TYPE 1 11 TYPE 14 2 TYPE 2 ia - TYPE 1 26 - 23 - TYPE 2 TYPE 2a 2 TYPE 1 29 - 33 - TYPE 2 TYPE 2 30 - 35 - TYPE 2 TYPE 2 36 - 41 - TYPE 1 TYPE 2 39 - 50 - TYPE 2 TYPE 2 51 TYPE 2 53 - TYPE 2 52 - TYPE 5β - 1 TYPE J 60 - 66 - TYPE 1 TYPE 1 65 - TYPE 69 - 2 TYPE 2 74 82 - TYPE 2 TYPE 1 βl 63 TYPE 2 TYPE 2 66 90 - TYPE 2 09 TYPE 2 TYPE 95 - 2 TYPE 2 9a - 00 - TYPE 2 99 - TYPE 1 TYPE 105 - 2 TYPE 2 106 - 19 - TYPE 1 TYPE 2 113 - TYPE 130 - 2 TYPE 1 131 - 35 - TYPE 2 134 - TYPE 2 YPE 138 - .2 TYPE 1 146 - TYPE 2 55 - 14β - TYPE 2 TYPE 158 - 1 TYPE 2 162 - TYPE 1 73 - 172 - TYPE 2 TYPE 174 - 1 TYPE 2 178 - SO - TYPE 1 179 TYPE 1 TYPE 2 183 - TYPE 2 186 91 - TYPE 2 169 - TYPE 2 TYPE 194 - 2 TYPE 2 196 10 - TYPE 1 209 - TYPE 1 TYPE 2 221 - TYPE 2 226 - 31 - TYPE 1 230 - TYPE 2 TYPE 2 233 - TYPE 2 239 - 45 - TYPE 2 243 - TYPE 2 TYPE 2 251 TYPE 2 254 - 6β - TYPE 2 261 - TrPE 1 TYPE 2 270 - TYPE 2 273 - aι - TYPE 2 278 - TYPE 2 TYPE 2 292 - TYPE 1 293 - 03 - TYPE 2 299 - TYPE 2 306 - TYPE 2 TYPE 2 309 - 23 - TYPE 2 TYPE 2 316 - 326 TYPE 1 TYPE 2 32V - 3a - TYPE 2 TYPE 2 330 - TYPE 346 - 2 TYPE 1 54 - TYPE 1 350 - TTPE 2 TYPE 2 359 - TYPE 2 371 - 5 - TYPE 2 TYPE 2 372 - TYPE 1 37β - TYPE 1 386 3 - TYPE 2 TYPE 2 388 - TYPE 1 396 - TYPE 2 410 - 13 - TYPE 2 411 - TYPE TYPE 2 2 414 - TYPE 2 418 - 0 - TYPE 1 419 - TYPE 1 TYPE 2 426 - TYPE 2 429 - a - TYPE 2 431 - TYPE TYPE 2 2 441 - TYPE 2 442 - TYPE 1 3 - 443 - TYPE 2 TYPE 2 460 - TYPE 1 466 - 3 - TYPE 1 470 - TYPE 2 TYPE 2 483 - TYPE 2 490 - TYPE 1 491 - 5 TYPE 2 TYPE 2 508 - TYPE 1 5C9 - 9 - TYPE 2 515 - TYPE 2 TYPE 2 522 - TYPE 1 Q - 530 - TYPE 2 531 - TYPE TYPE 1 2 543 - TYPE 2 4 - S45 - TYPE 2 TYPE 2 546 - TYPE 1 556 - TYPE 1 *5β - 2 - TYPE 2 561 - TYPE 2 TYPE 1 575 - TYPE 2 585 - 3 - TYPE 2 586 - TYPE 2 TYPE 1 606 - TYPE 2 611 4 TYPE 2 TYPE 2 612 - TYPE 1 615 - TYPE 2 618 - TYPE 1 TYPE 2 629 - TYPE 2 639 - TYPE 2 641 0 - TYPE 2 TYPE 2 645 - TYPE 2 651 TYPE 2 a - 652 - TYPE 1 TYPE 1 653 - TYPE 659 2 TYPE 2 660 TYPE 1 676 TYPE 1 m m 6& 1 TYPE 2 • m- 686 ΓYPE 2 690 TYPE 2 70S TYPE 1 700 TYPE 1 713 TYPE 2 719 TYPE 2 725 - TYPE 2 723 TYPE 2 726 TYPE 2 741 TYPE 2 746 - 743 TYPE 2 TYPE 2 Ϊi9 T PE 2 755 TYPE 2 761 - 756 TYPE TYPE 2 1 ?65 TYPE 2 771 TYPE 774 - 2 TYPE 2. 772 779 TYPE - 1 TYPE 2 783 TYPE 2 786 785 TYPE 1 TYPE 791 2 TYPE 2 796 - TYPE _ 809 1 803 TYPE 2 TYPE 810 2 TYPE 2 818 TYPE 2 826 620 TYPE 1 TYPE 1 828 TYPE 1 831 TYPE 2 834 - 833 TYPE 2 TYPE 646 2 TYPE 2 852 TYPE 1 856 866 TYPE TYPE 2 1 870 - TYPE 2 873 - TYPE 2 876 β TYPE 1 879 TYPE 2 882 - TYPE 1 891 - TYPE 2 893 906 TYPE 2 TYPE 1 911 - TYPE 2 923 - TYPE 2 930 _ TYPE 2 TYPE 2 933 935 - TYPE 2 938 - TYPE 94Q 2 939 — TYPE 1 TYPE 2 946 - TYPE 1 950 — TYPE 2 953 β 965 E 2 TYPE 2 TYP 974 - TYPE 2 975 — TYPE 2 986 69 TYPE 2 TYPE 2 9 993 - TYPE 2 998 - TYPE 1014 2 1013 β TYPE 2 TYPE 2 1018 - TYPE 1 1019 — TYPE 2 1031 1026 TYPE 2 TYPE 2 1034. - TYPE 2 1041 — TYPE 2 1049 1043 mΛ TYPE 2 TYPE 2 1055 ; TYPE 2 1060 - TYPE 1 1070 — 1065 β TYPE 2 TYPE 2 1090 - TYPE 1 1103 - Trpε 2 1106 β 1108 TYPE 2 TYPE 1 1110 - TYPE 2 1116 — TYPE 1 1116 m 1119 - TYPE 2 TYPE 2 1121 TYPE 2 1122 - TYPE 1134 - 1 1133 - TYPE 2 — TYPE 2 1146 TYPE 2 1154 TYPE 2 1166 - 1155 TYPE 2 TYPE 2 1169 - TYPE 2 1170 — TYPE 1 1176 — 1185 TYPE 2 TYPE 2 1186 - TYPE 1 1194 — TYPE 2 1199 — 1211 TYPE 2 TYPE 2 1212 TYPE 1 1218 TYPE 2 1223 "" 1228 - TYPE TYPE 1 2 1229 - TYPE 2 1233 - TYPE 1238 - 2 1236 TYPE 2 TYPE 1 1251 TYPE 2 1258 TYPE 1 1269 1265 TYPE 2 TYPE 2 1271 .- TYPE 2 1274 - TYPE 2 1275 — 1276 E 1 TYPE 2 TYP 1278 - TYPE 2 1282 - 1290 - TYPE 1 1289 β TYPE 1 TYPE 2 1295 - TYPE 2 1300 - TYPE 1 1306 _ - TYPE 1 1210 TYPE 2 1323 TYPE 2 1329 - TYPE 1338 2 1331 - TYPE TYPE 2 1341 • - 2 TYPE 2 1346 TYPE 2 1353 - 1349 TYPE 2 TYPE 2 1355 TYPE 2 1359 — TYPE 1372 - 2 1370 - TYPE 1 TYPE 2 1380 : TYPE 1 1394 TYPE 1401 2 1398 TYPE 2 TYPE 2 1409 - TYPE. 2 1418 - TYPE 2 1421 w TYPE 2 1425 TYPE 2 1426 - TYPE 1 1430 - TYPE 2 1439 _ 1443 - TYPE 2 TYPE 2 1450 - TYPE 1 t451 - TYPE 2 1452 — 1 , 54. TYPE 1 TYPE 2 1463 - TYPE 2 1469 - TYPE 2 1478 _ 14.& T TYPE 2 TYPE 2 1482 - TYPE 1 1492 - TYPE 1 14.99 - 1498 — TYPE 1 TYPE 2 1505 - TYPE 2 1509 - TYPE 2 1511 w 1518 TYPE 2 TYPE 2 1522 - TYPE 1 1530 - TYPE 1 1533 — 1539 TYPE 2 TYPE 2 1541 TYPE 2 154S — TYPE 1570 1 1559 - TYPE 1 TYPE 2 1583 - TYPE 2 1593 TYPE 2 1601 TYPE 2 m ■ ra ~. m i ia TYPE 1 1620 TYPE 1 1626 TYPE 2 1636 TYPE 1649 X P i 2 1653 TYPE 2 16.59 TYPE 2 1661 _ TYPE 2 1666 TYPE 1 166β TypE 1 1 73 - TYPE 2 1679 _ TYPE 2 1685 τ r p ε 2 1692 TY E I 1703 TYPE 2 1706 _ ΓY £ 1 0 - YPE 2 1732 - TYPE 1 1733 - TYPE 2 1734 .. TYPE 1740 TYPE 1. 1745 - TYPE 2 1746 - TYPE 1 1749 _ TYPE 2 1 55 TYPE 2 1753 - TYPE 2 1763 - TYPE 2 1766 _ TYPE 2 1769 TYPE 2 1773 - TYPE ' 2 1778 - TYPE 2 1779 _ TYPE 2 1785 ΓYPE 2 17β6 TYPE 1 1790 - TYPE 2 1791 _ ιao TYPE 2 TYPE 2 1611 TYPE 2 ιaιa - TYPE 2 1621 TYPE 2 1829 TYPE 2 1835 - TYPE 2 1838 - TYPE 2 1845 _. TYPE 2 1850 TYPE 2 1854 TYPE 2 1859 - TYPE 2 1360 _ TYPE 1 1863 TYPE 2 1866 TYPE 1 1876 -- TYPE 1 1663 _ TYPE 2 ιaa9 TYPE 2 1690 TYPE 2 1900 - TYPE 1 1901 _ 1906 TYPE 2 TYPE 1 1923 TYPE 2 1925 - TYPE 2 1926 .. 1930 TYPE 2 TYPE 1 1931 TYPE 2 1938 - TYPE 2 1946 _ TYPE 1 1 53 TYPE 2 1955 - TYPE 2 1958 - TYPE 2 1959 _ TYPE 2 1 61 TYPE 2 1965 TYPE 2 1972 - TYPE 1 1973 _ TYPE 2 1978 TYPE 1 1933. - TYPE 2 1986 - TYPE 1 1994 _ TYPE 2 1996 TYPE 1 2001 , - TYPE 2 2003 - TYPE 2 2006 _ TYPE 2 2009 TYPE 2 2010 TYPE 2 2026 - TYPE 1 202a _ TYPE 1 2039 TYPE 2 2045 TYPE 2 2046 TYPE 2 2049 _ TYPE 2 2052 TYPE 1 2055 - TYPE 2 2063 TYPE 2 2066 _ TYPE 2 2068 TYPE 1 2069 - TYPE 2 2078 - TYPE 2 2079 — TYPE 2 2082 TYPE 1 2098 - TYPE 1 2109 - TYPE 2 2114 _ TYPE 2 2115 TYPE 2 2121 - TYPE 2 2126 - TYPE 2 2129 TYPE 2 2130 TYPE 1 2140 - TYPE 1 2141 - TYPE 2 2163 „. 2174 TYPE 2 TYPE 2 2178 - TYPE 2 2161 TYPE 2 2166 _ 95 TYPE 2 21 TYPE 2 2198 - TYPE 2 2212 - TYPE 1 2220 _ 2223 TYPE 1 TYPE 2 2225 - TYPE 2 2231 - TYPE 2 2236 _ TYPE 1 2241 TYPE 2 2242 - T YP E 1 2246 - TYPE 2 2253 β 25a TYPE 2 2 TYPE 2 2266 TYPE 1 2268 - TYPE 1 2273 _ TYPE 2 2291 TYPE 2 2292 - TYPE 1 2295 - TYPE 2 2301 _ TYPE 2 2308 TYPE 1 2310 - TYPE 2 2318 - TYPE 2 2319 _ TYPE 2 2332 TYPE 1 2338 - TYPE 1 2339 - TYPE 2 2345 _ TYPE 2 2351 TYPE 2 2356 - TYPE 1 2361 - TYPE 2 2370 .. TYPE 1 23aa TYPE 1 2391 - TYPE 2 2393 - TYPE 2 2394 _ TYPE 2 2399 TYPE 2 2406 - TYPE 2 2415 - TYPE 2 2436 _ TYPE V 2438 TYPE 2 2451 TYPE 2 2458 - TYPE 1 2459 _ TYPE 2 2466 TYPE 1 2471 - TYPE 2 2475 - TYPE 2 2476 _ TYPE 1 2478 TYPE 2 2483 - TYPE 2 2486 - TYPE 2 2493 - TYPE 2 ■ 32- APPENDIX I ^include Cstdio.r 8de f i ne HA>N 2560 maximum ield deare- * / 8de f i ne MAXN32 β O array width */ 9de f i ne UORO 32 word size in bits «/ βde f i ne HEX6 ( unsi gned ) 0X80000000 / * most sig bi t in a word * / in βde f ine HEX4 QX4QQQQQQ0 /* second most sig i t a word */ βde f ine ONE 01 /* least sig bit (oc ta L ) */ βdefine ALl-ONE QXFFFFFF FF / * al L one. vector int ; int N32; unsigned po lyCMAXN3 3; in argc; char *argvC ]; / « Program to compute the coefficients b and c of an optimaL rauLtiply equa ion for digit dO of product vector D = B * C where Q t C , and D are the normal basis represen a ions of- eLements in the Galois Field GF(2**m ). Source Language : C under UNIX 0/S Author : Ivan M. Onyszchu Date Last Modified : hay 24, 19S5 2:04 am Modification : uocumen tat ion added Execution : ( program name) n type Result : dO eultiply equation, 2»-1 p.i rs of coefficients b and c. IF an invalid value of m or type i. en tered/ an error message printed. /* variable declarations */ unsigned 'BPCMAXN]; unsigned «DPCMAXN3; unsigned *BICf1AXN3; unsigned m<*sK/ i t erms ut/ o t 1/ b/ * int type/ unsigned * suap/' register int i /" register int j - register int k register int i; register unsigned *bp/ ** b1/ * * b2; register unsigned * dp/ *b3 »b4; register unsigned temp/ temp2; unsigned betd1CMAXN323; unsigned be ta2C( AXN32]/' unsigned one MAXN32 ]; unsigned twoC MA N323; /* Read in value of m and type */ N = atoi C argvl 1 ]); type = atoi CargvC23); N32 = (N - 1 ) / WORD + 1; f or ( i = 0; i <= N32; i + + ) polyCi D = oneCi l = tuoCi ] = beta1Ci 3 = 0; /* Compute generating polynomial * / i f < ( type ! = 1 ) 4& C type ! = 2 ) ) goto next; if C type == 2 ) < «tuo = HEXS; "one = HEX8 ! HEX4; f or( i = 1 ; i ; i ++ ) < "poly = *tuo Λ C*one >> 1 ); or ( j =0; j < N32; j ++ ) polyCj D = twoCj D Λ ((one[ j-1 ] & ONE ) ? ( oneC j D > 1 : Hfc" Xti > ; ( oneC j 3 >> i ; twoCj ] = oneCJ]; > i f C t pe 1 ) < for ( j = 1 ; j N32; j + * • ) poiyc j -1 : = A LONE; polyCN32- 13 = 0X80000000 7? C N X WORD ), for-( i = o; i < N; i + ) <: BPCi D = (unsi ed * ) calloc (N32/ si zeof( unsigned ))- ' DPC i J = (unsigned calloc (N32/ sizeof( unsigned)); BIC i 3 = (unsigned * ) calLoc C N32 si z.eof( unsigned)); > for ( i = 0; i < N32; i++ ) i *(beta1 -r i ) = 0; *( be t<*2 + i ) = 0; > xbetal = HEX4; Construct matrices for norm l basis */ for ( i = 0/ bp = *Bp; i < N32/' i+*-- bp + τ ) *bp = *Cbeta1 + i ); ιnult2 ( betal/ betal/ * D P ) ; for ( i = 1 ; i < N; !+ ■ «- ? mult2 ( BPC i-13^ BPC i-l },- BPCΪ 3); ιαult2 (BPC03/ BP£ i D - DPCi }); > for ( i = 0; i < N i + + ) < for (j = o; j C N32,~ j++ ) BΓC i 3C j i = o; BIC i 3C-i/U0RD D = HEX8 >> C i 7. WORD >; > /« Gaussian elimination section . */ ior ( i = 0; ! < N; i + + ) < if C( * (8PC i 3 + i / WOR0 ) << i WORD & HEXS ) == 0 ) for ( j = i + 1 ; j < ; j ++ ) if ( *(BPCj 3 -r i / WORD ) << i % WORD S HEXδ) < 8PC j 3 ~ swap; swap = BIC i -i; BIC i 3 = BIC j 3; reak; if (( *(BP i 3 + i / WORD ) << i '/. WORD & HEX8) == 0 ) < ρrintf(" Error - Matrix is not invertible! \n" ) ; goto next; for ( j = i T 1 ; j < N; j + + ) i f ( *(BP j + i / UORD J << i '/. WORD & HEX8 ) < for (K = i / WϋKP; k -T N32; ktt) *( BPC j 3 + k ) Λ = *( BPC i 3 + ; for ( k - O; k < N32; k ++ ) • *C βXC j 3 t k) Λ~ * (0lC i 3 t k); for ( i = 0; i < N; i + 1 ) for (j = i - 1 ; j >= α; j-- ) i f ( «( BPC j 3 + i / WORD ) << i / '. WORD & HEX5) < for ( k = i / WORD; k < N32; k++ ) * ( BP j + k) Λ = * (BPCi + k ); for ( k = O; k < N32; k++ ) * ( B1C j 3 + k ) Λ = * ( B IC i 3 + k ); > * Perform matrix transpose x / for ( i = 0/ bi = Bi; i < ; i+t, b11+ ) for ( j = 0, b2 = Bi; j < i; j++, b2++ ) { temp = ( ( *b 1 ) C j /WORD 3 << ( j % WORD )) & HEXβ; teβp2 = ( ( *b2 )C i /WORD 3 << ( i % UORD )) & HEXβ te*p2 >>- j V. ORD; ( *bl ) C j /WOR03 = ( ( *b1 )C j/WORD 3 S. "(HEXS >> j XWORO ) ) ! temp2; ( «b2 )C i /WORD 3 = ( ( *b2 )C i /WORD 3 & ~ ( HEXfi >> > txwoRon : temp; printf("\n Product digi t dO mult iply \n" >; pr.ntfC" equation coeff icients \π\n" ) ; print (" b c \nW ; priπtf ("\n Y. ύ ,7.Ad \n" r N-1/ N-1 ) ; Compute..and print out / c coeff icients */ for ( i = 0/ b1 = OP; i < N; 1++ b1++ ) < for ( j = 0/ b2 = Bi; j < I; j++/ b2r+ ) { out = O f * for, ( k = 0- b3 = »b1/> b = *b2; k < ou t 1 = 0; op (k = u; ■ WORD; k-H-/ out >>= 1 ) out 1 Λ = out & i; i f ( out 1 ) t 1 = ( N - j ) 7. N; 12 = ( N + i - . j ) 7. N; printf ( " 7. ά 7. d \n" , r t2 ; printf ( " . mK V.^ά \n" , t2, t 1 ); > > > next: ; > / ■ Element mult iply subrout ine */ uns igned *&r *b/ *c; i register int I ; register Int J ; register uns igned « e; uns igned ECMAXN323; uns i gned FCf1AXN323; unsiαned feed; for ( i = 0, e = E i < N32; 1++/ e++, «<-+, b++, c++ ) < *e = * b; *( F + i ) = *a; «c = o; > for ( i = o; i < N; i ++ ) < i f (*(F + i/WORD ) 1C I 7. WOR0 & HEX8) for ( J - Q, c -= N32, e = E j < N32; j+t, c++/ e ++ ) * c Λ = *e; feed = * ( e = E + (N-1 )/ WORD ) << (CN - 1 ) 7. WORD ) & HEXβ; for ( j = N32 - 1; j > 0; J --, β-- ) *e = ( C*e >> 1 ) !(C«(e-1 ) & ONE) <C W0RD-1 )) Λ ( feed ? polyC j 3:0 ); *e = <* β >> 1 ) ( feed ? * pol . Q );

Claims: CLAIMS : 1. A method of determining the product of two elements B and C of the finite field GF(2 ), where m is an integer greater than 1, the field having elements A 2 ( 0 x -£- m ) that constitute a normal basis, comprising the steps of: a) representing the element B as a vector of binary digits b-, where b. is the coeffecient of A 2 ~ in the normal basis representa ion of B b) representing the element C as a vector of binary digits c. j , where c. is the coefficient of A 2 1 in the normal basis representation of C c) representing the product D of elements B and C as a vector of binary digits d., where d. is the coefficient of A 2 ~ in the normal basis representation of D, each of said binary digits d. being expressed in the form of sums of products of the binary digits b. and c, , ( O : J' k ^- ~ ) d) storing in m successive cells of a first shift register the binary digits, b. e) storing in m successive cells of a second shift register the binary digits, c. f) selecting at least some of said products of a binary digit d. and grouping like ones of one of the binary digits b- or c, to provide grouped terms of the form g) associating each of said grouped terms with a respective one of m accumulating cells of an accumulating register, h) establishing connections between the cells of said first and second shift registers and a first of said accumulating cells to provide a first of said grouped terms in said accumulating cell, i) establishing connections between the cells of said first and second shift registers and a second of said accumulating cells adjacent to said first cell to provide an expression equivalent to another of said grouped terms with the suffixes of the binary digits of said second grouped term increased by 1 (Modulo m) j) repeating step i for successive ones of the grouped terms with the increase in the suffix of each binary digit of said grouped terms accumulat¬ ing by 1 (Modulo m) for each repetition whereby there is provided in each accumulating cell a grouped term of each of the m binary digits d., k) generating a grouped term in an accumulating cell 1) transferring the contents of the accumulating cell to the adjacent accumulating cell m) transferring contents of each cell of the shift registers to their next cell n) repeating steps k, 1 and m, m times whereby at each repetition an additional term of each of the binary digits d. of the vector D is accumulated in each of the accumulating cells. 2. A method according to claim 1 wherein all of the products are grouped into grouped terms. 3. A method according to claim 1 comprising the steps of pairing said products such that one term of each pair has the form -c, and the other of each pair has the form b k c • , and selecting one of each pair to form said grouped terms. 4. A method according to claim 3 wherein the other product terms of each pair are generated by inter¬ changing the binary digits of said first and second shift registers upon completion of step n and repeating steps k through n. 5. A method according to claim 4 wherein product terms that cannot be paired are included in said groupted terms and generation of such terms is inhibited during one repetition of steps k to n. 6. A method of determining the product of two elements B and C of the finite field GF(2 m ), where m is an integer greater than 1, the field having elements A 2 1 (O .= i -^ ) that constitute a normal basis, comprising the steps of: a) representing the element B as a vector of binary digits b., where b. is the coefficient of A 2 - m. the normal basis representation of B b) representing the element C as a vector of binary digits c. , where c. is the coefficient of A 2 1 i.n the normal basis representation of C c) representing the product D of elements B and C as a vector of binary digits d., where d. is the coefficient of A 2 - in the normal basis representation of D, each of said binary digits d. being expressed in the form of sums of products of the binary digits b. and c. , (0 f= j,k - m) J ■κ d) storing in m successive cells of a first shift register the binary digits, b. e) storing in m successive cells of a second shift register the binary digits, c- f) selecting at least some of said terms of a binary digit d. and grouping like ones of one of the binary digits b. or c, to J κ provide grouped terms of the form g) establishing connections from respective cells of said shift registers to each of said accumulating cells to produce in each accumulating cell a grouped term of a binary digit representing the vector D, said 3 connections being established such that a first grouped term of one of said binary digits is accumulated in a first of said cells and upon repeated transfer of the contents of one of said accumulating cells through each of said accumulating cells accompanied by successive rotations of said shift register contents, successive grouped terms of said one binary digit will be generated in successive cells h) accumulating successive ones of said grouped terms of said one binary digit by transferring the contents of one accumulating cell to another cell and rotating the vectors representing B and C in the shift registers to generate another grouped term i) adding said other grouped term to the contents of said other cell j) repeating the accumulation m times whereby grouped terms of a binary digit are accumulated successively in each of said accumulating cells to generate simultaneously grouped terms of each the m binary digits of the vector representing the product D.

Inventors: MULLIN RONALD C, ONYSZCHUK IVAN M, VANSTONE SCOTT A, MULLIN, RONALD, C., ONYSZCHUK, IVAN, M., VANSTONE, SCOTT, A.
Applicants: COHN RONALD D, MULLIN RONALD C, ONYSZCHUK IVAN M, VANSTONE SCOTT A, COHN, RONALD, D., MULLIN, RONALD, C., ONYSZCHUK, IVAN, M., VANSTONE, SCOTT, A.
Application year: 1986
Main classification: G06F7
IPC codes: G06F7, H03M13