Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4998225B2 - Finite field computation method and finite field computation device - Google Patents
[go: Go Back, main page]

JP4998225B2 - Finite field computation method and finite field computation device - Google Patents

Finite field computation method and finite field computation device Download PDF

Info

Publication number
JP4998225B2
JP4998225B2 JP2007298063A JP2007298063A JP4998225B2 JP 4998225 B2 JP4998225 B2 JP 4998225B2 JP 2007298063 A JP2007298063 A JP 2007298063A JP 2007298063 A JP2007298063 A JP 2007298063A JP 4998225 B2 JP4998225 B2 JP 4998225B2
Authority
JP
Japan
Prior art keywords
term
finite field
polynomial
word width
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2007298063A
Other languages
Japanese (ja)
Other versions
JP2008197625A (en
Inventor
俊哉 中島
哲也 伊豆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2007298063A priority Critical patent/JP4998225B2/en
Publication of JP2008197625A publication Critical patent/JP2008197625A/en
Application granted granted Critical
Publication of JP4998225B2 publication Critical patent/JP4998225B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、有限体(ガロア体)GF(q)の演算方法に関し、特に既約多項式による剰余演算のリダクション演算の演算方法に関する。   The present invention relates to a calculation method of a finite field (Galois field) GF (q), and more particularly to a calculation method of a reduction calculation of a remainder calculation using an irreducible polynomial.

デジタルオーディオ機器などのエラー訂正方式、公開キー暗号方式などの技術分野で有限体(ガロア体)の演算が広く行われている。有限体の演算において、楕円曲線上の点のペアリングが持つ双線形性を応用して、効率的な暗号システムが実現できることが知られている。ペアリングにはWeilペアリングとTateペアリングがあり、Tateペアリングの方が計算量が少ないため暗号分野ではTateペアリングないしその改良版が用いられる。それでもTateペアリングは計算量が大きいため、現在まで種々の高速化手法が提案されている。   Arithmetic operations of finite fields (Galois fields) are widely performed in technical fields such as error correction systems for digital audio equipment and public key cryptosystems. It is known that an efficient encryption system can be realized by applying the bilinearity of pairing of points on an elliptic curve in the operation of a finite field. There are two types of pairing: Weil pairing and Tate pairing. Since Tate pairing requires less computation, Tate pairing or its improved version is used in the cryptographic field. Nevertheless, Tate pairing is computationally intensive, and various speedup methods have been proposed to date.

Tateペアリングを高速化した代表的なアルゴリズムとしてDuursma-Leeアルゴリズム・ηTペアリングが研究されている。これらの演算では標数3の有限体GF(3m)上の乗算が大部分を占める。従って高速化のためにはGF(3m)上の乗算を効率化することが重要になる。以下、標数3の有限体GF(3m)における例を説明するが、本発明の演算方法及び演算装置は標数3の有限体GF(3m)に限定されるものではない。 Duursma-Lee algorithm and η T pairing have been studied as representative algorithms that speed up Tate pairing. In these operations, multiplication on the characteristic 3 finite field GF (3 m ) is mostly occupied. Therefore, it is important to increase the efficiency of multiplication on GF (3 m ) for speeding up. Hereinafter, an example in a finite field GF (3 m ) with characteristic 3 will be described. However, the calculation method and the calculation apparatus of the present invention are not limited to the finite field GF (3 m ) with characteristic 3.

非特許文献1は、Tateペアリング演算の高速化について記載しており、楕円曲線暗号におけるペアリングの高速計算で、有限体GF(3m)の乗算を必要とすること、及びペアリングを用いることでIDベース暗号等の新しい暗号システムが可能になること、を記載している。 Non-Patent Document 1 describes the speed-up of Tate pairing operation, and requires the multiplication of a finite field GF (3 m ) and uses pairing in high-speed calculation of pairing in elliptic curve cryptography. It is described that a new encryption system such as ID-based encryption becomes possible.

非特許文献1に記載されるように、ペアリングの計算には、計算量の多い標数3の有限体GF(3m)の乗算が多数回必要である。GF(3m)の乗算は、次の2段階で計算される。 As described in Non-Patent Document 1, the pairing calculation requires many multiplications of the characteristic 3 finite field GF (3 m ) with a large amount of calculation. The multiplication of GF (3 m ) is calculated in the following two stages.

(1)GF(3)の元を係数に持つm−1次以下の2個の多項式の積を計算する。この計算結果は、GF(3)の元を係数とする2m−2次以下の多項式になる。   (1) Calculate the product of two polynomials of m-1 order or less having the elements of GF (3) as coefficients. The calculation result is a polynomial of 2m-2 order or lower with the element of GF (3) as a coefficient.

(2)(1)で得られる積の多項式f(x)に対して、GF(3)の元を係数とするm次既約多項式p(x)による剰余g(x)=f(x)modp(x)を計算する。この値はGF(3)の元を係数とするm−1次以下の多項式であり、これがGF(3m)の乗算の結果になる。上記のf(x)modp(x)の演算では、多項式f(x)のm次以上の項に対するリダクション演算が行われる。 (2) The remainder g (x) = f (x) by the m-th irreducible polynomial p (x) with the coefficient of the element of GF (3) as the coefficient for the product polynomial f (x) obtained in (1) Modp (x) is calculated. This value is an m-1 or lower order polynomial with the factor of GF (3) as a coefficient, and this is the result of multiplication of GF (3 m ). In the above calculation of f (x) modp (x), a reduction calculation is performed on terms of the polynomial f (x) of the mth order or higher.

リダクションの対象であるGF(3)上のn次の多項式をf(x)、GF(3)上のm次既約多項式をp(x)とする。ここで、n≧mとする(n<mの場合はg(x)=f(x))。リダクション演算は、p(x)による剰余演算によりf(x)をm−1次以下の多項式g(x)に変換する演算である。以下、リダクション演算について説明する。   It is assumed that an nth-order polynomial on GF (3) to be reduced is f (x) and an mth-order irreducible polynomial on GF (3) is p (x). Here, n ≧ m (in the case of n <m, g (x) = f (x)). The reduction operation is an operation for converting f (x) into a polynomial g (x) of m−1 order or less by a remainder operation using p (x). Hereinafter, the reduction calculation will be described.

f(x)及びp(x)は、次のように表すことができる。(一般にp(x)のm次の高の係数は1)
f(x)=cnxn+cn-1xn-1+...+c1x+c0 (1)
p(x)=xm+dm-1xm-1+...+d1x+d0 (2)
P(x)=0の関係式から次の式が得られる。
f (x) and p (x) can be expressed as follows. (In general, the m-th order high coefficient of p (x) is 1)
f (x) = c n x n + c n-1 x n-1 + ... + c 1 x + c 0 (1)
p (x) = x m + d m-1 x m-1 + ... + d 1 x + d 0 (2)
From the relational expression of P (x) = 0, the following expression is obtained.

xm=-dm-1xm-1+...-d1x-d0 (3)
この式を用いて、f(x)のm次以上の各項を置き換える。具体的には、まず式(3)のxmがf(x)の一番上の項と等しくなるように、両側にcnxn-mを乗じると次の式が得られる。
x m = -d m-1 x m-1 + ...- d 1 xd 0 (3)
Using this equation, the terms of the mth order or higher of f (x) are replaced. Specifically, the following equation is obtained by multiplying both sides by c n x nm so that x m in equation (3) is equal to the top term of f (x).

cnxn=-cndm-1xn-1+...-cnd1xn-m+1-cnd0xn-m (4)
そして、f(x)の第1項を(4)の右側の式で置き換えると、次の式が得られる。
c n x n = -c n d m-1 x n-1 + ...- c n d 1 x n-m + 1 -c n d 0 x nm (4)
Then, when the first term of f (x) is replaced with the expression on the right side of (4), the following expression is obtained.

f(x)=(cn-1-cndm-1)xn-1+(cn-2-cndm-2)xn-2...+(cn-m+1-cnd1)xn-m+1
+(cn-m-cnd0)xn-m+cn-m-1xn-m-1+c1x+c0 (5)
この式(5)は、n−1次の多項式であり、f(x)の次数が1つだけ小さいn−1次の多項式になる。
f (x) = (c n-1 -c n d m-1 ) x n-1 + (c n-2 -c n d m-2 ) x n-2 ... + (c n-m + 1 -c n d 1 ) x n-m + 1
+ (c nm -c n d 0 ) x nm + c nm-1 x nm-1 + c 1 x + c 0 (5)
This equation (5) is an n−1 order polynomial, and is an n−1 order polynomial in which the order of f (x) is smaller by one.

次に、n−1次の多項式である式(5)について、上記と同様に第1項を置き換える処理を行い、n−2次の多項式にする。以下、同じ処理を、m−1次の多項式が得られるまで繰り返す。得られた結果が、mod演算の結果g(x)になる。   Next, the processing for replacing the first term is performed on the equation (5), which is an n−1th order polynomial, in the same manner as described above to obtain an n−2nd order polynomial. Thereafter, the same processing is repeated until an m-1 order polynomial is obtained. The obtained result becomes the result g (x) of the mod operation.

GF(3)上のm次既約多項式は、各mについて複数存在する場合が多い。アプリケーションの目的において、mのみ指定され、実際の演算で使用するm次既約多項式の選択に自由度がある場合に、効率的にリダクション演算が実行できるm次既約多項式を考える。なお、ここでは、固定されたm次既約多項式を対象とする専用のハードウエアを使用せずに、一般的なCPUを用いたソフトウエア処理により演算を実行するものとする。   In many cases, a plurality of m-th irreducible polynomials on GF (3) exist for each m. For the purpose of an application, consider an m-th irreducible polynomial that can efficiently perform a reduction operation when only m is specified and there is a degree of freedom in selecting an m-th irreducible polynomial to be used in an actual operation. Here, it is assumed that the calculation is executed by software processing using a general CPU without using dedicated hardware for a fixed m-th irreducible polynomial.

上記のリダクション演算の方法から、リダクション演算に用いる既約多項式の項数はできるだけ少ない方が効率的であるのは明らかである。GF(3)上の既約多項式のうち2項式はx2+1のみであるため、3項式xm+axk+b(m>k>0;a,b∈GF(3);ab≠0)が候補となる。 From the above reduction calculation method, it is clear that it is more efficient that the number of terms of the irreducible polynomial used in the reduction calculation is as small as possible. Of the irreducible polynomials on GF (3), the binomial expression is only x 2 +1, so the ternary expression x m + ax k + b (m>k>0; a, b∈GF (3); ab ≠ 0 ) Is a candidate.

既約多項式を使用した剰余演算については、特許文献1などに記載されているので、これ以上の説明は省略する。   Since the remainder calculation using the irreducible polynomial is described in Patent Document 1 and the like, further explanation is omitted.

白勢・高木・岡本,「Tateペアリングの効率的なアルゴリズム」信学技報ISEC2006-12,0019-26,電子情報通信学会Shirase, Takagi, Okamoto, "Efficient Algorithm for Tate Pairing" IEICE Technical Report ISEC2006-12,0019-26, IEICE 境・大岸・笠原,「ペアリングに基づく暗号方式」暗号理論とそれを支える代数曲線理論,第1回ワークショップ(2000年8月30日−9月1日,中央大学市ヶ谷キャンパス)Sakai, Ogishi, Kasahara, "Cryptography Based on Pairing" Cryptography Theory and Algebraic Curve Theory that Supports It, First Workshop (August 30-September 1, 2000, Chuo University Ichigaya Campus) G. Granger, D. Page & M. Stam, "Hardware and Software Normal Basis Arithmetic for Pairing Based Cryptography in Characteristic Three", IEEE Trans. on Computers, Vol.54, No.7, pp852.860, 2005G. Granger, D. Page & M. Stam, "Hardware and Software Normal Basis Arithmetic for Pairing Based Cryptography in Characteristic Three", IEEE Trans. On Computers, Vol.54, No.7, pp852.860, 2005 特開2000−148013JP 2000-148013 A

上記のように、GF(3m)の乗算におけるリダクション演算では、既約3項式xm+axk+bが候補になる。ハードウエア実装を含む従来例では、それらのうち最小のkを有するものがこれまでは用いられてきた。 As described above, in the reduction operation in the multiplication of GF (3 m ), the irreducible ternary expression x m + ax k + b is a candidate. In the conventional example including the hardware implementation, the one having the smallest k has been used so far.

ここでは、一般的なCPUを使用してリダクション演算を行う場合に、処理ステップを低減して高速化することを目的とする。   Here, the purpose is to reduce the processing steps and increase the speed when performing a reduction operation using a general CPU.

上記目的を実現するため、この有限体演算方法および装置は、一般的なCPUを使用して既約多項式でリダクション演算を行う場合に、既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つが、CPUの演算処理のワード幅の倍数である既約多項式を使用する。これにより、リダクション演算におけるシフト処理の一部を省略できる。
例えば、中間項の次数がワード幅の倍数である場合を説明する。ワード幅がWビットで、既約多項式が3項式のxm+axk+bで表され、中間項の次数がワード幅の倍数であるとする。すなわち、k=W×g(gは1以上の整数)とする。mはWより大きく、ペアリング演算であれば、通常は90以上である。
In order to achieve the above object, this finite field calculation method and apparatus, when performing a reduction operation with an irreducible polynomial using a general CPU, determines the degree of the irreducible polynomial, the order of the intermediate term, and the irreducible polynomial. At least one of the values obtained by subtracting the order of the intermediate term from the order uses an irreducible polynomial that is a multiple of the word width of the arithmetic processing of the CPU. Thereby, a part of the shift process in the reduction calculation can be omitted.
For example, the case where the order of the intermediate term is a multiple of the word width will be described. It is assumed that the word width is W bits, the irreducible polynomial is represented by a trinomial x m + ax k + b, and the order of the intermediate term is a multiple of the word width. That is, k = W × g (g is an integer of 1 or more). m is larger than W and is usually 90 or more for pairing calculation.

上記のように、GF(3m)の乗算におけるリダクション演算では、既約3項式xm+axk+bが候補であり、従来は最小のkを有するものが多く、少なくともCPUを使用してソフトウエア制御により演算を行う場合に、演算の効率化を目的として中間項の次数がCPUのワード幅の倍数であるように意図したものはなかった。 As described above, in the reduction operation in the multiplication of GF (3 m ), the irreducible ternary expression x m + ax k + b is a candidate, and many of them have the smallest k in the past, and at least the software using the CPU In the case where computation is performed by wear control, there has been no intention that the order of the intermediate term is a multiple of the word width of the CPU for the purpose of efficient computation.

CPUを使用してソフトウエア制御により既約多項式によるリダクション演算を行う時には、リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶し、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する。この際に、対象多項式の前記既約多項式の次数以上のリダクション対象部分を、上位ビットから順にワード幅単位で、既約多項式の次数に対応する項をワード幅内の最小ビットに対応するようにシフトさせるシフト量だけシフトし、シフトしたワード幅単位のデータを、次数が既約多項式の第1項と中間項及び定数項との関係にある対象多項式の対応する項に加減算することが行われる。この場合、本発明のように中間項の次数がCPUのワード幅の倍数であれば、中間項及び定数項の加減算のためのワード幅内でのシフト量が同一であり、シフト処理が共通化できるので、その分処理量を低減できる。   When performing a reduction operation using an irreducible polynomial by software control using the CPU, each bit data representing the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is stored as continuous bit data. Then, data of the number of bits corresponding to the word width of the arithmetic processing of the CPU is processed in parallel. At this time, the reduction target portion of the target polynomial having a degree equal to or higher than the degree of the irreducible polynomial is assigned in units of word width in order from the higher order bit, and the term corresponding to the degree of the irreducible polynomial corresponds to the smallest bit in the word width. Shifting by the shift amount to be shifted, and adding / subtracting the shifted word width unit data to / from the corresponding terms of the target polynomial whose degree is related to the first term of the irreducible polynomial, the intermediate term and the constant term . In this case, if the order of the intermediate term is a multiple of the CPU word width as in the present invention, the shift amount within the word width for addition and subtraction of the intermediate term and the constant term is the same, and the shift processing is shared. Therefore, the amount of processing can be reduced accordingly.

シフト処理の低減は、上記の場合に限られず、既約多項式の次数がCPUの演算処理のワード幅の倍数であれば、定数項の加減算処理で格納されている係数がワード幅単位でシフトするだけで使用できるので、定数項の加減算のためのワード幅内でのシフト処理は不要になる。また既約多項式の次数から中間項の次数を減じた値がCPUの演算処理のワード幅の倍数であれば、中間項の加減算のためのワード幅内でのシフト処理は不要になり、処理量を低減できる。これは、既約多項式が4項以上である場合も同様であり、各項が次数がワード幅の倍数であれば上記と同様にワード幅内でのシフト処理が不要になり、中間項同士の次数の差がCPUの演算処理のワード幅の倍数であればそれらの中間項の加減算のためのシフト量が同一であるのでワード幅内でのシフト処理が共通化できる。   The reduction of the shift processing is not limited to the above case. If the degree of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU, the coefficient stored in the addition / subtraction processing of the constant term is shifted in units of word width. Therefore, the shift processing within the word width for addition / subtraction of the constant term is not necessary. If the value obtained by subtracting the degree of the intermediate term from the degree of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU, the shift processing within the word width for addition / subtraction of the intermediate term is unnecessary, and the processing amount Can be reduced. This is the same when the irreducible polynomial has four or more terms. If each term is a multiple of the word width, the shift processing within the word width is not necessary as described above, and the intermediate terms If the order difference is a multiple of the word width of the arithmetic processing of the CPU, the shift amounts for addition and subtraction of the intermediate terms are the same, so that the shift processing within the word width can be shared.

後述する例では、Tateペアリングの高速化に適した標数が3の有限体で、既約多項式は3項式である例を説明するが、既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つがCPUのワード幅の倍数であるという本発明の特徴は、標数2などの標数3以外の有限体でも有効であり、また上記のように既約多項式が4項以上である場合も有効である。   In the example described later, an example is described in which the characteristic is a finite field of 3 suitable for speeding up Tate pairing and the irreducible polynomial is a trinomial. However, the degree of the irreducible polynomial, the order of the intermediate term, and the existing The feature of the present invention that at least one of the values obtained by subtracting the order of the intermediate term from the order of the polynomial is a multiple of the CPU word width is also effective in a finite field other than characteristic 3 such as characteristic 2. As described above, it is also effective when the irreducible polynomial has four or more terms.

標数が3の場合、リダクション演算の対象である有限体上の対象多項式の各項の係数は2ビットのデータで表せるが、各項の上位ビットと下位ビットをそれぞれ連続したビットデータとして記憶し、CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する。   When the characteristic is 3, the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation can be represented by 2-bit data, but the upper and lower bits of each term are stored as continuous bit data. The data of the number of bits corresponding to the word width of the arithmetic processing of the CPU is processed in parallel.

記載される実施例によれば、CPUを使用してソフトウエア制御により有限体の剰余演算で発生する既約多項式によるリダクション演算を行う時の処理量を低減して高速化が図れる。   According to the described embodiment, it is possible to reduce the amount of processing when performing a reduction operation using an irreducible polynomial generated by a finite field remainder operation by software control using a CPU, and to increase the speed.

実施例の有限体演算装置は、図1に示すようなハードウエア構成の演算装置を使用して、ハードウエアにインストールするプログラムによるソフトウエア制御により実現され、有限体演算が実行される。   The finite field arithmetic unit of the embodiment is realized by software control by a program installed in hardware using an arithmetic unit having a hardware configuration as shown in FIG. 1 and executes finite field arithmetic.

図1(A)に示すように、実施例で使用するハードウエアは、CPU21と、ROM25と、RAM26と、I/O27、これらを接続する外部バス28と、を有する一般的なコンピュータである。CPU21は、内部に演算ユニット(ALU)22と、レジスタ群23とそれらを接続する内部バス24と、を有する。内部バス24はワード幅(ビット幅)は16ビットであり、CPU21は各種処理を16ビットのワード幅で行う。なお、ここではワード幅が16ビットのCPUを使用するが、これに限定されるものではなく、広く使用される8ビット、32ビット、64ビットのワード幅のCPUを使用してもよい。   As shown in FIG. 1A, the hardware used in the embodiment is a general computer having a CPU 21, a ROM 25, a RAM 26, an I / O 27, and an external bus 28 for connecting them. The CPU 21 includes an arithmetic unit (ALU) 22, a register group 23, and an internal bus 24 that connects them. The internal bus 24 has a word width (bit width) of 16 bits, and the CPU 21 performs various processes with a word width of 16 bits. Although a CPU with a word width of 16 bits is used here, the present invention is not limited to this, and CPUs with word widths of 8 bits, 32 bits, and 64 bits that are widely used may be used.

図1(B)は、実施例の有限体演算装置の機能ブロック図である。図1(B)に示すように、有減退演算部(装置)31は、リダクション演算部32を有する。リダクション演算部32は、対象多項式の各項の係数を連続したビットデータとして記憶し、レジスタ群23により実現される計数記憶部33を有する。   FIG. 1B is a functional block diagram of the finite field arithmetic device of the embodiment. As shown in FIG. 1B, the existence / decrease calculation unit (apparatus) 31 includes a reduction calculation unit 32. The reduction calculation unit 32 stores a coefficient of each term of the target polynomial as continuous bit data, and includes a count storage unit 33 realized by the register group 23.

第1実施例は、3項式の既約多項式で、中間項の次数がCPU21のワード幅の倍数、すなわち16の倍数である場合である。
図2は、第1実施例におけるリダクション演算フローを示す図である。ここでは、演算対象の対象多項式f(x)(n次)を既約3項式p(x)(m次)で剰余演算する時のリダクション演算を行うものとし、f(x)は前述の式(1)で表され、p(x)は次の式(6)で表される場合を例として説明する。
The first embodiment is a trinomial irreducible polynomial in which the degree of the intermediate term is a multiple of the word width of the CPU 21, that is, a multiple of 16.
FIG. 2 is a diagram showing a reduction calculation flow in the first embodiment. Here, it is assumed that a reduction operation is performed when a target polynomial f (x) (n-th order) to be calculated is subjected to a remainder operation with an irreducible ternary expression p (x) (m-th order), and f (x) The case where it is represented by Formula (1) and p (x) is represented by the following Formula (6) will be described as an example.

p(x)=xm+axk+b (6)
ステップ101では、既約3項式のパラメータm、k、a、b及びワード幅(ビット数)W(ここでは16ビット)を入力する。
p (x) = x m + ax k + b (6)
In step 101, the parameters m, k, a, b and the word width (number of bits) W (16 bits here) of the irreducible ternary equation are input.

ステップ102では、f(x)の係数をワード幅単位で格納する時の、m次の項及び第1項(n次の項)のワード幅内での位置を示すRとy、及び既約3項式の中間項(k次の項)のワード幅内での位置を示すKを算出する。R,y,Kは次の式で表される。   In step 102, R and y indicating the positions of the m-th term and the first term (n-th term) within the word width when the coefficient of f (x) is stored in units of word width, and an irreducible factor. K indicating the position within the word width of the intermediate term (k-th term) of the ternary expression is calculated. R, y, and K are expressed by the following equations.

R=m mod W
y=(n+1) mod W
K=truncate(k/W)
ここで、truncateは小数点未満を切り捨てた値を示す。
R = m mod W
y = (n + 1) mod W
K = truncate (k / W)
Here, “truncate” indicates a value obtained by rounding down the fractional part.

ステップ103では、yがR以下であるか判定し、yがR以下であればステップ104Bに、yがRより大きければステップ104Aに進む。   In step 103, it is determined whether y is equal to or less than R. If y is equal to or less than R, the process proceeds to step 104B, and if y is greater than R, the process proceeds to step 104A.

ステップ104A及び104Bでは、演算に使用する変数iの最大値maxと最小値minを算出する。maxはステップ104Aと104Bで異なる。ステップ104Aでは、
max=roundup{(n+1)/W}
min=roundup{m/W}−1
ステップ104Bでは、
max=roundup{(n+1)/W}−1
min=roundup{m/W}−1
に設定される。ここで、roundupは小数点以下を切り上げた値を示す。
In steps 104A and 104B, the maximum value max and the minimum value min of the variable i used for the calculation are calculated. max is different in steps 104A and 104B. In step 104A,
max = roundup {(n + 1) / W}
min = roundup {m / W} -1
In step 104B,
max = roundup {(n + 1) / W} -1
min = roundup {m / W} -1
Set to Here, roundup indicates a value rounded up after the decimal point.

ステップ104Aと104Bの後はステップ105に進む。   After steps 104A and 104B, the process proceeds to step 105.

ステップ105では、要素数がmaxの配列H,Lを確保して、f(x)の係数データを配列H,Lに格納する。図3は、第1実施例の計数記憶部33における係数データの格納方法を説明する図である。   In step 105, arrays H and L with the number of elements being max are secured, and coefficient data of f (x) is stored in arrays H and L. FIG. 3 is a diagram for explaining a coefficient data storage method in the count storage unit 33 of the first embodiment.

標数3の有限体であるので、係数は0,1,2のいずれかであり、係数データは2ビットで表すことができる。格納用配列は、ワード幅(16ビット)単位であり、1配列単位は2ビットの上位ビットを格納するH(i)と、下位ビットを格納するL(i)と、で構成され、このような配列がH(0)からH(max)まで(およびL(0)からL(max)まで)確保される。例えば、nが189で、mが97である場合には、R=1、y=14、であるからステップ104Bによりmax=11になり、配列HについてはH(0)からH(11)までの12配列単位が確保される。12配列単位では12×16=192ビットを格納可能であり、H(11)の上位2ビットには係数データが格納されないことになるので、そこにはゼロを入れる。   Since it is a finite field of characteristic 3, the coefficient is either 0, 1, or 2, and the coefficient data can be represented by 2 bits. The storage array is in units of word width (16 bits), and one array unit is composed of H (i) for storing the upper bits of 2 bits and L (i) for storing the lower bits. New sequences are reserved from H (0) to H (max) (and from L (0) to L (max)). For example, when n is 189 and m is 97, since R = 1 and y = 14, max = 11 is obtained by step 104B, and the array H is from H (0) to H (11). 12 array units are secured. In 12 array units, 12 × 16 = 192 bits can be stored, and coefficient data is not stored in the upper 2 bits of H (11).

ステップ106では、変数iをmaxに設定し、ステップ107でiがminより小さいかを判定し、小さければステップ110に進むが、それ以外の場合にはステップ108に進む。   In step 106, the variable i is set to max, and in step 107, it is determined whether i is smaller than min. If it is smaller, the process proceeds to step 110. Otherwise, the process proceeds to step 108.

ステップ108では、加減算を行うためにf(x)のリダクション対象部分をp(x)の中間項及び定数項の位置に合わせるためのデータの生成と対応配列位置の演算を行う。   In step 108, in order to perform addition / subtraction, data generation for matching the reduction target portion of f (x) with the positions of the intermediate term and constant term of p (x) and the calculation of the corresponding array position are performed.

リダクション演算では、f(x)のリダクション対象部分のあるビットにp(x)の第1項を対応させ、中間項及び定数項に対応するビットに対して、ビット値に応じた加減算処理を行う。従って、f(x)のリダクション対象部分の最終ビット、すなわちp(x)の次数に対応するビットが、定数項に対応するように、すなわちワード幅の最終ビットに対応するようにシフトすると、ワード幅(16ビット)単位で演算を行うのに適当である。このシフト量は、W−Rで表される。   In the reduction operation, the first term of p (x) is made to correspond to a bit in the reduction target portion of f (x), and addition / subtraction processing according to the bit value is performed on the bit corresponding to the intermediate term and the constant term. . Therefore, if the last bit of the reduction target part of f (x), that is, the bit corresponding to the order of p (x) is shifted so as to correspond to the constant term, that is, corresponding to the last bit of the word width, Appropriate for performing operations in units of width (16 bits). This shift amount is represented by WR.

リダクション演算は、リダクション対象部分の上位ビットから順番に行う必要があるので、H(12)の右側R個とH(11)の左側W−R個のビットデータ列を連結してthとし、L(12)の右側R個とH(11)の左側W−R個のビットデータ列を連結してtlとし、ワード(16ビット)幅のデータを作る。このデータに応じて加減算処理が行われるのはp(x)の中間項に対応するH(j1)と、定数項に対応するH(j2)である。j1とj2は、次の式で表される。   Since the reduction operation needs to be performed in order from the higher order bits of the reduction target portion, the right R bits of H (12) and the left WR bit data strings of H (11) are concatenated to th, and L The right R pieces of (12) and the left WR bit data strings of H (11) are concatenated into tl to create word (16 bits) wide data. It is H (j1) corresponding to the intermediate term of p (x) and H (j2) corresponding to the constant term that is subjected to addition / subtraction processing according to this data. j1 and j2 are expressed by the following equations.

j1=i−min+K
j2=i−min
ステップ109では、生成したth及びtlを、f(x)の対応する配列位置に対して、p(x)のa及びbに応じて加減算する。
j1 = i-min + K
j2 = i-min
In step 109, the generated th and tl are added to or subtracted from the corresponding array position of f (x) according to a and b of p (x).

図4は、この演算処理を示す図である。ここではp(x)の中間項の係数aについて説明するが、定数項の係数bについても同様である。   FIG. 4 is a diagram showing this calculation process. Here, the coefficient a of the intermediate term of p (x) will be described, but the same applies to the coefficient b of the constant term.

図4の(A)に示すように、この演算は標数3の有限体上での演算であり、aが1であれば、f(x)の対応するビット値(H(j1),L(j1)からの(th,tl)の減算に置き換えることができ、aが2であれば、f(x)の対応するビット値(H(j1),L(j1)への(th,tl)の加算に置き換えることができ、計算結果をf(x)に上書きする。この演算は、ワード幅の全ビットに対して並列に行う。   As shown in FIG. 4A, this operation is an operation on a finite field of characteristic 3, and if a is 1, the corresponding bit value (H (j1), L) of f (x) It can be replaced by subtraction of (th, tl) from (j1), and if a is 2, (th, tl) to the corresponding bit value (H (j1), L (j1) of f (x) The calculation result is overwritten on f (x), and this operation is performed in parallel for all the bits of the word width.

図4の(B)は、(A)で説明した処理をフロー図で示したものであり、加算関数のthとtlが入れ替わっていることに注目する必要がある。   FIG. 4B is a flowchart showing the processing described in FIG. 4A. It should be noted that th and tl of the addition function are interchanged.

図4の(C)は、加算関数の実際の処理を示すフロー図であり、f(x)のH及びLレジスタの値、th(h)及びtl(l)の値、及びそれらの算出地の間でOR及びXORを演算することにより、上書きする値を算出することができる。有限体の演算については広く知られているので、説明は省略する。   FIG. 4C is a flowchart showing the actual processing of the addition function, the values of the H and L registers of f (x), the values of th (h) and tl (l), and their calculation locations. A value to be overwritten can be calculated by calculating OR and XOR between the two. Since the calculation of the finite field is widely known, the description thereof is omitted.

ステップ109では、上記の処理が終了すると、H(i)及びL(i)の全ビットをゼロに設定し、変数iを1だけ減少させてステップ107に戻る。   In step 109, when the above processing ends, all bits of H (i) and L (i) are set to zero, the variable i is decreased by 1, and the process returns to step 107.

以下、演算対象の配列単位を1単位ずつずらしながら、p(x)の第1項の次数に対応する項の処理が終了するまでステップ108及び109の処理を繰り返し、その項の処理が終了したら、ステップ107からステップ110に進み、H(i)及びL(i)の左側W−R個のビットをゼロにして終了する。   Thereafter, the processing of steps 108 and 109 is repeated until the processing of the term corresponding to the order of the first term of p (x) is completed while shifting the array unit to be calculated one unit at a time. , The process proceeds from step 107 to step 110, and the left WR bits of H (i) and L (i) are set to zero and the process is terminated.

以上、第1実施例の演算処理を説明したが、第1実施例では、既約多項式の中間項の次数がCPUのワード幅の倍数であるので、中間項は定数項と同様にワード幅のLSBに対応しており、中間項と定数項の演算のためのシフト量が同じであり、シフト処理が共通化できるので、演算量を低減できる。   The arithmetic processing of the first embodiment has been described above. In the first embodiment, since the degree of the intermediate term of the irreducible polynomial is a multiple of the word width of the CPU, the intermediate term has the word width as in the constant term. It corresponds to LSB, the shift amount for the calculation of the intermediate term and the constant term is the same, and the shift processing can be made common, so that the calculation amount can be reduced.

次に、上記の処理を具体的な既約3項式を例として、図5を参照して説明する。   Next, the above processing will be described with reference to FIG. 5, taking a specific irreducible ternary expression as an example.

図5は、対象多項式f(x)の次数nが189で、既約3項式p(x)のパラメータm、k、a、bがそれぞれ97、16、1、2である場合、すなわちp(x)が次の式で表される場合の例である。   FIG. 5 shows the case where the order n of the target polynomial f (x) is 189 and the parameters m, k, a, and b of the irreducible ternary expression p (x) are 97, 16, 1, and 2, respectively, that is, p This is an example where (x) is represented by the following equation.

p(x)=x97+x16+2
図示のように、f(x)の次数nが189であるから、H(0)からH(12)までの13配列単位が確保され、リダクション演算ではp(x)の次数97より小さい次数96にすればよいので、f(x)の0ビットから96ビットまでの97ビット分がリダクション結果の範囲であり、97ビットから189ビットまでの93ビット分がリダクション対象部分である。
p (x) = x 97 + x 16 +2
As shown in the figure, since the order n of f (x) is 189, 13 array units from H (0) to H (12) are secured, and the order 96 is smaller than the order 97 of p (x) in the reduction operation. Therefore, 97 bits from 0 bits to 96 bits of f (x) are the range of the reduction result, and 93 bits from 97 bits to 189 bits are the reduction target part.

f(x)のリダクション対象部分の最終ビット、すなわちp(x)の次数に対応するビットが、定数項に対応するように、すなわちワード幅の最終ビットに対応するようにシフトする。このシフト量は、W−Rで表され、図5では、f(x)の97ビットが16ビット幅のLSBになるように15ビットシフトされる。   The final bit of the reduction target part of f (x), that is, the bit corresponding to the order of p (x) is shifted so as to correspond to the constant term, that is, to correspond to the final bit of the word width. This shift amount is represented by WR, and in FIG. 5, the shift is performed by 15 bits so that 97 bits of f (x) become LSB having a 16-bit width.

リダクション演算は、リダクション対象部分の上位ビットから順番に行う必要があるので、H(12)の右側1ビットとH(11)の左側の15ビットの列を連結してthとし、L(12)の右側1ビットとL(11)の左側の15ビットの列を連結してtlとし、ワード(16ビット)幅のデータを作る。このデータに応じて加減算処理が行われるのはp(x)の中間項に対応する6配列単位離れたH(6)と、定数項に対応する7配列単位離れたH(5)である。このように中間項に対応する配列と定数項に対応する配列は、ワード幅分ずれているので、シフト処理は共通に行える。   Since the reduction operation needs to be performed in order from the higher order bits of the reduction target portion, the th 1 bit on the right side of H (12) and the 15-bit column on the left side of H (11) are concatenated to th, and L (12) 1 bit on the right side and 15 bit column on the left side of L (11) are concatenated into tl to create data of word (16 bits) width. It is H (6) that is 6 array units away corresponding to the intermediate term of p (x) and H (5) that is 7 array units away corresponding to the constant term that is added or subtracted according to this data. As described above, since the array corresponding to the intermediate term and the array corresponding to the constant term are shifted by the word width, the shift process can be performed in common.

加減算処理は上記のように行われる。   The addition / subtraction process is performed as described above.

加減算処理が終了すると、H(12)とL(12)の全ビットをゼロにして、変数iを1だけ減じて11として、同様の動作を繰り返す。   When the addition / subtraction process is completed, all the bits of H (12) and L (12) are set to zero, the variable i is reduced by 1 to 11, and the same operation is repeated.

iが6になるとリダクション対象部分に対する上記演算処理が終了する。この時、H(6)の左側W−R個(15)ビットはゼロになっていないので、この部分をゼロにする処理を行って終了する。   When i becomes 6, the above arithmetic processing for the reduction target portion is completed. At this time, since the left WR (15) bits of H (6) are not zero, the process of setting this part to zero is performed and the process ends.

ここで、本発明の効果を説明するために、対象多項式f(x)の次数nは189で図5の例と同じで、既約3項式p(x)のパラメータm、k、a、bがそれぞれ97、12、1、2である場合を、図6に示す。すなわち、図6では、p(x)が次の式で表される。   Here, in order to explain the effect of the present invention, the order n of the target polynomial f (x) is 189, which is the same as the example of FIG. 5, and the parameters m, k, a, The case where b is 97, 12, 1, and 2 is shown in FIG. That is, in FIG. 6, p (x) is expressed by the following equation.

p(x)=x97+x12+2
図6に示すように、p(x)の中間項に対応する加減算を行うには、f(x)の97ビットがワード幅内の12ビットに対応するように11ビット分シフトする必要がある。そこで、f(x)のH(12)とH(11)でこのようなシフトを行い、th及びtlを生成し、H(6)に対して加減算を行う。
p (x) = x 97 + x 12 +2
As shown in FIG. 6, in order to perform addition / subtraction corresponding to the intermediate term of p (x), it is necessary to shift 11 bits so that 97 bits of f (x) correspond to 12 bits within the word width. . Therefore, such a shift is performed on H (12) and H (11) of f (x), th and tl are generated, and addition / subtraction is performed on H (6).

この処理が終了すると、p(x)の定数項に対応する加減算を行うために、f(x)の97ビットがワード幅内の0ビットに対応するように15ビット分シフトする処理を、f(x)のH(12)とH(11)で行い、th及びtlを生成し、H(6)に対して加減算を行う。   When this process is completed, in order to perform addition / subtraction corresponding to the constant term of p (x), a process of shifting by 15 bits so that 97 bits of f (x) correspond to 0 bits within the word width is performed. (X) H (12) and H (11) are performed to generate th and tl, and addition / subtraction is performed on H (6).

次に、H(11)とH(10)で11ビット分のシフト処理を行ってth及びtlを生成し、H(5)に対して中間項に対応する加減算を行う。そして、H(11)とH(10)で15ビット分のシフト処理を行ってth及びtlを生成し、H(5)に対して定数項に対応する加減算を行う。   Next, a shift process of 11 bits is performed on H (11) and H (10) to generate th and tl, and addition / subtraction corresponding to the intermediate term is performed on H (5). Then, a shift process of 15 bits is performed with H (11) and H (10) to generate th and tl, and addition / subtraction corresponding to the constant term is performed with respect to H (5).

以下、このような処理を繰り返す。
このように、m=12の場合、中間項と定数項に対する加減算を行うためのシフト量が異なるので、中間項演算のためのシフト処理と定数項演算のためのシフト処理を別々に行う必要がある。
Thereafter, such processing is repeated.
In this way, when m = 12, the shift amount for performing addition / subtraction for the intermediate term and the constant term is different, so that it is necessary to separately perform the shift processing for the intermediate term operation and the shift processing for the constant term operation. is there.

第1実施例では、ワード幅が16ビットの場合を例として、既約3項式の中間項の次数がワード幅の倍数の場合を説明したが、同様の効果は、既約3項式の次数がワード幅の倍数である場合や、既約3項式の次数から中間項の次数を減じた値がワード幅の倍数である場合にも得られる。既約多項式の次数がワード幅の倍数である場合には、定数項の加減算のためのシフト処理が不要になる。また既約3項式の次数から中間項の次数を減じた値がCPUの演算処理のワード幅の倍数であれば、中間項の加減算のためのシフト処理は不要になる。   In the first embodiment, the case where the order of the intermediate term of the irreducible ternary expression is a multiple of the word width has been described by taking the case where the word width is 16 bits as an example, but the same effect is obtained by the irreducible ternary expression. It can also be obtained when the order is a multiple of the word width, or when the value obtained by subtracting the order of the intermediate term from the order of the irreducible ternary expression is a multiple of the word width. When the degree of the irreducible polynomial is a multiple of the word width, a shift process for adding or subtracting constant terms is not necessary. If the value obtained by subtracting the degree of the intermediate term from the degree of the irreducible ternary expression is a multiple of the word width of the arithmetic processing of the CPU, the shift process for adding / subtracting the intermediate term is not necessary.

ここで、シフト処理の低減について、より一般化して検討する。
前述の式(1)で表されるn次多項式f(x)に対する、式(6)で表されるm次既約3項式p(x)によるリダクション演算は、前述の処理であり、プログラムで表せば図7に示す処理となる。この処理を実際に行うには、ワード幅のビット数に等しい個数の係数を同時に処理するため、forループ内の1行目と2行目の処理で、ワード幅内のシフト処理が必要になる。
Here, the reduction of the shift process will be examined more generally.
The reduction operation by the m-th irreducible ternary expression p (x) represented by the expression (6) with respect to the n-order polynomial f (x) represented by the expression (1) is the above-described process, and the program This is the process shown in FIG. In order to actually perform this processing, a number of coefficients equal to the number of bits of the word width are processed at the same time, so that the shift processing within the word width is necessary in the processing of the first and second rows in the for loop. .

この処理において、各cの処理において、中間項axに対応する処理ではa*cをiからm−kだけ移動した位置の係数ci-(m-k)に加算し、定数項bに対する処理ではb*cをiからmだけ移動した位置の係数ci-mに加算している。 In this process, the processing of each c i, the processing corresponding to the intermediate section ax k is added to the coefficient c i-(mk) of the position moved by mk the a * c i from i, for the constant term b In the process, b * c i is added to the coefficient c im at a position moved from i to m.

従って、加算先の2つの係数ci-(m-k)およびci-mの位置の差はkであるので、k(中間項の次数)がワード幅で割り切れる場合には、第1実施例で述べたとおり中間項と定数項に対応するシフトデータが共通化できる。すなわち、どちらか一方に対応するシフトデータのみを作成すればよい。 Accordingly, since the difference between the positions of the two coefficients c i− (mk) and c im to be added is k, the case where k (the order of the intermediate term) is divisible by the word width is described in the first embodiment. As described above, the shift data corresponding to the intermediate term and the constant term can be shared. In other words, only shift data corresponding to one of them needs to be created.

これに対して、中間項axに対応する処理において、ciおよびci-(m-k)の位置の差がm−kであることから、m−k、すなわち既約3項式の次数から中間項の次数を引いた値がワード幅で割り切れる場合は、中間項に対応する処理において、係数が格納されている配列のデータをそのまま用いることができるためシフトデータの作成は不要であり、定数項に対応したシフトデータのみを作成すればよい。 In contrast, in the process corresponding to the intermediate section ax k, since the difference between the position of c i and c i-(mk) is mk, mk, that is, from the order of the irreducible trinomial If the value obtained by subtracting the order of the intermediate term is divisible by the word width, it is not necessary to create shift data because the array data in which the coefficient is stored can be used as it is in the processing corresponding to the intermediate term. Only shift data corresponding to the term needs to be created.

また、定数項bに対応する処理では、b*ciをiからmだけ移動した位置の係数に加算することから、既約3項式の次数mがワード幅のビット数で割り切れる場合は、定数項に対応する処理において、係数が格納されている配列のデータをそのまま使用できるためシフトデータの作成は不要であり、中間項に対応したシフトデータのみを作成すればよい。 Further, in processing corresponding to the constant term b, since adding the coefficients of the position moved the b * c i from i by m, if the degree m of irreducible trinomial is divisible by the number of bits of the word width, In the processing corresponding to the constant term, the data of the array in which the coefficients are stored can be used as it is, so that it is not necessary to create shift data, and only the shift data corresponding to the intermediate term needs to be created.

上記のいずれの場合においても、第1実施例の中間項の次数がワード幅で割り切れる場合と比較して、作成するシフトデータの量およびリダクション処理全体の計算量は変わらないため、同等の計算量削減効果が得られることになる。   In any of the above cases, the amount of shift data to be created and the total amount of reduction processing are the same as compared with the case where the order of the intermediate term in the first embodiment is divisible by the word width. A reduction effect will be obtained.

第2実施例として、既約3項式の次数から中間項の次数を減じた値がワード幅の倍数である例を、図8を参照して説明する。
第2実施例では、対象多項式f(x)の次数nが189で、既約3項式p(x)のパラメータm、k、a、bがそれぞれ97、81、2、1である場合、すなわちp(x)が次の式で表される場合の例である。
As a second embodiment, an example in which the value obtained by subtracting the order of the intermediate term from the order of the irreducible ternary expression is a multiple of the word width will be described with reference to FIG.
In the second embodiment, when the order n of the target polynomial f (x) is 189 and the parameters m, k, a, and b of the irreducible ternary expression p (x) are 97, 81, 2, and 1, respectively, That is, this is an example where p (x) is expressed by the following equation.

p(x)=x97+2x81+1
図示のように、f(x)の次数nが189であるから、第1実施例と同様にH(0)からH(12)までの13配列単位が確保され、リダクション演算ではp(x)の次数97より小さい次数96にすればよいので、f(x)の0ビットから96ビットまでの97ビット分がリダクション結果の範囲であり、97ビットから189ビットまでの93ビット分がリダクション対象部分である。
p (x) = x 97 + 2x 81 +1
As shown in the figure, since the order n of f (x) is 189, 13 array units from H (0) to H (12) are secured as in the first embodiment, and p (x) is obtained in the reduction operation. Since the order 96 is smaller than the order 97, 97 bits from 0 to 96 bits of f (x) are the range of the reduction result, and 93 bits from 97 bits to 189 bits are the reduction target part. It is.

p(x)の次数97と中間項の次数81の差は16であるから、係数が格納されている配列のデータをそのまま用いることができ、1ワード(16ビット)分シフトして−2倍した上で、配列のデータに加算すればよい。
定数項については、第1実施例と同様に、f(x)のリダクション対象部分の最終ビット、すなわちp(x)の次数に対応するビットが、定数項に対応するように、すなわちワード幅の最終ビットに対応するようにシフトした上で、−1倍して配列のデータに加算すればよい。加算処理は、第1実施例と同じなので、説明は省略する。
Since the difference between the order 97 of p (x) and the order 81 of the intermediate term is 16, the data of the array in which the coefficients are stored can be used as it is, and shifted by 1 word (16 bits) and multiplied by -2 After that, it may be added to the array data.
As for the constant term, as in the first embodiment, the last bit of the reduction target part of f (x), that is, the bit corresponding to the order of p (x) corresponds to the constant term, that is, the word width After shifting so as to correspond to the last bit, it may be multiplied by −1 and added to the array data. Since the addition process is the same as that in the first embodiment, description thereof is omitted.

次に、既約3項式を探索する処理について説明する。
図9は、既約3項式を探索する処理を示すフロー図である。ここでは、式(6)で示す前述の既約3項式で、kがワード幅の倍数であるものを探索するとする。mの値は応用分野に依存するが、ペアリングでは500以下であれば十分である。また、3項式がひとつ与えられた時、その既約性の判定は、有限体を対象にする数式処理システム(例えばRisa/Asir)を用いれば十分に高速に実行できる。従って、既約3項式を探索するには図7に示すフローに従って行うことができる。
Next, processing for searching for an irreducible ternary expression will be described.
FIG. 9 is a flowchart showing a process for searching for irreducible ternary expressions. Here, it is assumed that k is a multiple of the word width in the above-described irreducible ternary expression represented by Expression (6). The value of m depends on the application field, but 500 or less is sufficient for pairing. In addition, when one ternary expression is given, the irreducibility determination can be performed sufficiently quickly using a mathematical expression processing system (for example, Risa / Asir) that targets a finite field. Therefore, searching for the irreducible ternary expression can be performed according to the flow shown in FIG.

ステップ201では、mの最大値maxを入力し、ステップ202でmを1に設定し、ステップ203でmがmaxより大きいかを判定し、大きければ終了し、大きくなければステップ204に進む。   In step 201, the maximum value max of m is input. In step 202, m is set to 1. In step 203, it is determined whether m is larger than max.

ステップ204ではkを1に設定し、ステップ205でkがmと等しいかを判定し、等しければステップ210に進んでmを1だけ増加させてステップ203に戻り、等しくなければ(小さければ)ステップ206に進む。   In step 204, k is set to 1, and in step 205, it is determined whether k is equal to m. If they are equal, the process proceeds to step 210, m is incremented by 1, and the process returns to step 203. Proceed to 206.

ステップ206では、その時点のmとkで、aが1、bが2である3項式について既約であるか判定して既約であればリストアップし、既約でなければステップ207でaが2、bが1である3項式について既約であるか判定して既約であればリストアップし、既約でなければステップ208でaが2、bが2である3項式について既約であるか判定して既約であればリストアップし、既約でなければステップ209でkを1増加させた後ステップ205に戻る。   In step 206, it is determined whether or not an irreducible ternary expression in which a and b are 2 at m and k at that time. It is determined whether a ternary expression in which a is 2 and b is 1 is irreducible. If it is irreducible, a list is given. If not, a ternary expression in which a is 2 and b is 2 in step 208 If it is irreducible, it is listed. If it is not irreducible, k is incremented by 1 in step 209, and the process returns to step 205.

以下、k及びmを順次増加させて処理を繰り返して既約3項式のリストを作成する。   Thereafter, k and m are sequentially increased and the process is repeated to create an irreducible ternary expression list.

図10は、mが256以下で、kが8の倍数である全ての既約3項式をリストアップしたものである。例えば、x128+x80+2のような既約3項式の次数および中間項の次数が共に8(または16)の倍数である既約3項式を使用すれば、ワード幅内でのシフト処理は不要である。 FIG. 10 lists all irreducible ternary expressions in which m is 256 or less and k is a multiple of 8. For example, if an irreducible ternary expression such as x 128 + x 80 +2 is used and an irreducible ternary expression in which the order of the intermediate term is a multiple of 8 (or 16) is used, shift processing within the word width is performed. Is unnecessary.

図10のような既約多項式のリストがある場合に、応用に適した既約多項式を選ぶには、以下のような手順が考えられる。   When there is a list of irreducible polynomials as shown in FIG. 10, the following procedure can be considered to select an irreducible polynomial suitable for application.

(1)応用によりmが決まっており、mがmax以下の場合
この場合、リストで所望のmの既約多項式が存在するか確認し、存在しなければ既約多項式は選択できない。所望のmの既約多項式が存在すれば、その中に使用予定のCPUのワード幅(ビット)の倍数であるkを有するものがあるか確認し、あればそれを選択し、なければワード幅の異なるCPUに交換可能か確認し、交換不能であれば既約3項式は選択できないことになる。CPUが交換可能であれば、新たに使用予定のCPUのワード幅を変えて同じ処理を行う。
(1) When m is determined by application and m is less than or equal to max In this case, it is confirmed whether there is a desired m irreducible polynomial in the list, and if there is not, the irreducible polynomial cannot be selected. If there is a desired m irreducible polynomial, check to see if any of them has k that is a multiple of the word width (bits) of the CPU you plan to use, select it, otherwise select word width If the CPU can be replaced with a different CPU, the irreducible ternary expression cannot be selected. If the CPU can be replaced, the same processing is performed by changing the word width of the CPU to be newly used.

(2)応用によりmが決まっており、mがmaxより大きい場合
第1の方法は、図9に示したフローでmax=mとしてリストを再作成して、(1)の処理を行う。
(2) When m is determined by application and m is larger than max The first method re-creates a list with max = m in the flow shown in FIG. 9 and performs the processing of (1).

第2の方法は、図9のフローでmをmaxに固定して、ステップ204から209を繰り返す処理を行い、m=maxである既約多項式をリストアップする。そして、そのリスト中に使用予定のCPUのワード幅(ビット)の倍数であるkを有するものがあるか確認し、あればそれを選択し、なければワード幅の異なるCPUに交換可能か確認し、交換不能であれば既約3項式は選択できないことになる。CPUが交換可能であれば、新たに使用予定のCPUのワード幅を変えて同じ処理を行う。   In the second method, m is fixed at max in the flow of FIG. 9, and the processing of repeating steps 204 to 209 is performed, and irreducible polynomials with m = max are listed. Then, check if there is one in the list that has k that is a multiple of the word width (bit) of the CPU you plan to use, select it, and if not, check if it can be replaced with a CPU with a different word width. If the exchange is impossible, the irreducible ternary expression cannot be selected. If the CPU can be replaced, the same processing is performed by changing the word width of the CPU to be newly used.

(3)応用でmが決まっていない場合
mが任意に選択できるので、リスト中に使用予定のCPUのワード幅(ビット)の倍数であるkを有するものがあるか確認し、あればその中から任意の(または追加条件を満たす)ものを選択し、なければワード幅の異なるCPUに交換可能か確認し、交換不能であれば既約3項式は選択できないことになる。CPUが交換可能であれば、新たに使用予定のCPUのワード幅を変えて同じ処理を行う。
(3) When m is not determined by application Since m can be arbitrarily selected, check whether there is a k having a multiple of the word width (bit) of the CPU to be used in the list, and if there is, If an arbitrary one (or an additional condition) is selected, it is confirmed whether it can be replaced with a CPU having a different word width. If it cannot be replaced, the irreducible ternary expression cannot be selected. If the CPU can be replaced, the same processing is performed by changing the word width of the CPU to be newly used.

(4)リストを作成せずに見つかった既約3項式を用いる場合(mが決まっている)
図9のフローでmを設定し、更にkをCPUのワード幅に設定して、ステップ205から209を行い、所望の既約3項式が見つかったら終了する。なお、既約3項式がなく、CPUのワード幅が変更可能な時には、ワード幅を変更して同じ処理を行う。
(4) When using an irreducible ternary expression found without creating a list (m is determined)
In the flow of FIG. 9, m is set, k is set to the word width of the CPU, steps 205 to 209 are performed, and when a desired irreducible ternary expression is found, the process ends. When there is no irreducible ternary expression and the word width of the CPU can be changed, the same processing is performed by changing the word width.

(5)リストを作成せずに見つかった既約3項式を用いる場合(mが決まっていない)
mを変えて、(4)の処理を行う。
(5) When using an irreducible ternary expression found without creating a list (m is not determined)
The process of (4) is performed by changing m.

以上説明した実施例では、標数が3の有限体で、既約多項式は3項式である例を説明したが、中間項がCPUのワード幅の倍数であるという本発明の特徴は、標数2などの標数3以外の有限体にも適用可能である。その場合、リダクション対象の多項式の係数は1ビットで表現できる(0又は1)ため、配列にはこの1ビット列を格納すればよい。   In the embodiment described above, an example has been described in which the characteristic is a finite field of 3 and the irreducible polynomial is a trinomial, but the characteristic of the present invention that the intermediate term is a multiple of the word width of the CPU is the characteristic. The present invention is also applicable to finite fields other than characteristic 3 such as Equation 2. In that case, since the coefficient of the reduction target polynomial can be expressed by 1 bit (0 or 1), this 1-bit string may be stored in the array.

また、mの値によっては既約3項式が存在しない可能性がある。そのような場合には、既約4項式、既約5項式などに拡張して、本発明を適用することが可能である。
4項以上のn項既約多項式を用いる場合には、中間項の数はn−2個であるため、各中間項の少なくとも1つの項の次数についてワード幅の倍数であるか、または既約多項式の次数から中間項の次数を引いた値がワード幅の倍数であるか、または中間項の次数の差がワード幅の倍数である既約n項式に拡張して、本発明を適用することが可能である。
In addition, there is a possibility that an irreducible ternary expression does not exist depending on the value of m. In such a case, the present invention can be applied by expanding to the irreducible 4-term equation, the irreducible 5-term equation, or the like.
When an n-ary irreducible polynomial of 4 or more terms is used, the number of intermediate terms is n-2, so that the order of at least one term of each intermediate term is a multiple of the word width or is irreducible. The value obtained by subtracting the order of the intermediate term from the order of the polynomial is a multiple of the word width, or is expanded to an irreducible n-term expression in which the difference in the order of the intermediate term is a multiple of the word width. It is possible.

本発明は、多項式のリダクションが用いられる場合に全て適用できるが、特に挙げれば以下のような分野に応用が可能である。   The present invention can be applied to all cases where polynomial reduction is used, but can be applied to the following fields, in particular.

本発明が適用可能な代表的な例は、楕円曲線上でのペアリングの計算である。ペアリングは、楕円曲線暗号についての種々の応用に用いられるが、その一例としてIDベース暗号が挙げられる。IDベース暗号の例として、通信者のID情報(eメールアドレス、電話番号など通信相手に固有の公開情報)を基に共通鍵を作成・配布する方法があり、IDは任意の値が使用できる。この方法にペアリングを用いることが、非特許文献2に記載されており、ペアリング以外の方法によるIDベース暗号に比べて安全性が向上されることが記載されている。非特許文献1に記載されるように、ペアリングの計算にはGF(3m)の乗算を計算する必要があり、GF(3m)の乗算では既約多項式による剰余演算が必要であり、本発明はこの剰余演算を効率化することができる。 A typical example to which the present invention can be applied is calculation of pairing on an elliptic curve. Pairing is used in various applications for elliptic curve cryptography, and an example thereof is ID-based cryptography. As an example of ID-based encryption, there is a method of creating and distributing a common key based on a communication person's ID information (e-mail address, public information such as a telephone number), and any value can be used for the ID . The use of pairing in this method is described in Non-Patent Document 2, and it is described that safety is improved as compared with ID-based encryption by a method other than pairing. As described in Non-Patent Document 1, it is necessary to calculate multiplication of GF (3 m ) for calculation of pairing, and multiplication of GF (3 m ) requires a remainder operation using an irreducible polynomial. The present invention can improve the efficiency of this remainder operation.

最後に、本発明の効果を説明するため、C言語のソフトウエア実装で、m=97,167,193,239の場合について、最小のkを選択する従来例の実行時間に対する、本発明に従ってkを選択した場合の実行時間の比を図11に示す。図11で、m=97の時にはワード幅は16ビットで、それ以外が32ビットである。いずれの場合も、本発明により実行時間が60%乃至70%に低減されることが分かる。
以上説明した実施例を含む実施形態に関し、更に以下の付記を開示する。
(付記1)CPUを使用してソフトウエア制御により有限体の剰余演算を行う有限体演算方法であって、
既約多項式によるリダクション演算を行う時に、既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つが、前記CPUの演算処理のワード幅の倍数である既約多項式を使用することを特徴とする有限体演算方法。(1)(図2、図5)
(付記2)リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶し、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する付記1に記載の有限体演算方法。(2)(図3)
(付記3)前記有限体は標数が3の有限体で、前記既約多項式の項数は3項以上であり、
リダクション演算の対象である有限体上の対象多項式の各項の係数を2ビットのデータで表し、各項の上位ビットと下位ビットをそれぞれ連続したビットデータとして記憶する付記2に記載の有限体演算方法。(3)(図3)
(付記4)前記既約多項式は3項式であり、中間項の次数が前記CPUの演算処理のワード幅の倍数であり、
リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶し、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理し、前記対象多項式の前記既約多項式の次数以上のリダクション対象部分を、上位ビットから順に前記ワード幅単位で、前記既約多項式の次数に対応する項を前記ワード幅内の最小ビットに対応するようにシフトさせるシフト量だけシフトし、シフトしたワード幅単位のデータを、次数が前記既約多項式の第1項と中間項及び定数項との関係にある前記対象多項式の対応する項に加減算する付記1に記載の有限体演算方法。(4)(図5)
(付記5)前記既約多項式は3項式であり、前記既約多項式の次数から中間項の次数を減じた値が前記CPUの演算処理のワード幅の倍数であることを特徴とする付記1に記載の有限体演算方法。(図8)
(付記6)前記既約多項式は3項式であり、前記既約多項式の次数が前記CPUの演算処理のワード幅の倍数であることを特徴とする付記1に記載の有限体演算方法。
(付記7)前記既約多項式は4項以上の式であり、前記既約多項式の少なくとも2つの中間項の次数の差が前記CPUの演算処理のワード幅の倍数であることを特徴とする付記1に記載の有限体演算方法。(図8)
(付記8)CPUを備え、ソフトウエア制御により有限体の剰余演算を行う有限体演算装置であって、
既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つが、前記CPUの演算処理のワード幅の倍数である既約多項式を使用してリダクション演算を行うリダクション演算手段を備えることを特徴とする有限体演算装置。(5)(図1、図2、図5)
(付記9)前記リダクション演算手段は、リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶する係数記憶手段を備え、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する付記8に記載の有限体演算装置。(6)(図3)
(付記10)前記有限体は標数が3の有限体で、前記既約多項式の項数は3項以上であり、
前記リダクション演算手段は、リダクション演算の対象である有限体上の対象多項式の各項の係数を2ビットのデータで表し、各項の上位ビットと下位ビットをそれぞれ連続したビットデータとして記憶する係数記憶手段を備える付記8に記載の有限体演算装置。(図3)
(付記11)前記既約多項式は3項式であり、中間項の次数が前記CPUの演算処理のワード幅の倍数であり、
前記リダクション演算手段は、
リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶する係数記憶手段を備え、
前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理し、
前記対象多項式の前記既約多項式の次数以上のリダクション対象部分を、上位ビットから順に前記ワード幅単位で、前記既約多項式の次数に対応する項を前記ワード幅内の最小ビットに対応するようにシフトさせるシフト量だけシフトし、シフトしたワード幅単位のデータを、次数が前記既約多項式の第1項と中間項及び定数項との関係にある前記対象多項式の対応する項に加減算する付記8に記載の有限体演算装置。(図5)
Finally, in order to explain the effect of the present invention, in the case of m = 97,167,193,239 in C language software implementation, k according to the present invention for the execution time of the conventional example in which the minimum k is selected. FIG. 11 shows the ratio of execution times when is selected. In FIG. 11, when m = 97, the word width is 16 bits, and the others are 32 bits. In any case, it can be seen that the present invention reduces the execution time to 60% to 70%.
The following supplementary notes are further disclosed with respect to the embodiments including the examples described above.
(Supplementary note 1) A finite field operation method for performing a finite field remainder operation by software control using a CPU,
When performing a reduction operation using an irreducible polynomial, at least one of the degree of the irreducible polynomial, the order of the intermediate term, and the value obtained by subtracting the order of the intermediate term from the order of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU A finite field arithmetic method characterized by using an irreducible polynomial. (1) (FIGS. 2 and 5)
(Supplementary Note 2) Each bit data representing a coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is stored as continuous bit data, and the number of bits corresponding to the word width of the arithmetic processing of the CPU The finite field calculation method according to supplementary note 1, wherein the data is processed in parallel. (2) (Figure 3)
(Supplementary Note 3) The finite field is a finite field with characteristic 3, and the number of terms of the irreducible polynomial is 3 or more.
The finite field operation according to appendix 2, wherein the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is represented by 2-bit data, and the upper and lower bits of each term are stored as continuous bit data. Method. (3) (Figure 3)
(Supplementary Note 4) The irreducible polynomial is a trinomial, the order of the intermediate term is a multiple of the word width of the arithmetic processing of the CPU,
Each bit data representing the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is stored as continuous bit data, and the data of the number of bits corresponding to the word width of the CPU arithmetic processing is stored in parallel. A reduction target portion of the target polynomial that is equal to or higher than the degree of the irreducible polynomial in terms of the word width in order from the upper bit, and a term corresponding to the degree of the irreducible polynomial is set to the minimum bit in the word width. The data is shifted by the shift amount to be shifted correspondingly, and the data in the shifted word width unit is converted into the corresponding term of the target polynomial whose degree is in the relationship between the first term of the irreducible polynomial, the intermediate term, and the constant term. The finite field calculation method according to attachment 1, wherein addition / subtraction is performed. (4) (Figure 5)
(Supplementary note 5) The irreducible polynomial is a trinomial, and a value obtained by subtracting the order of the intermediate term from the order of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU. The finite field calculation method described in 1. (Fig. 8)
(Supplementary note 6) The finite field arithmetic method according to supplementary note 1, wherein the irreducible polynomial is a trinomial, and the degree of the irreducible polynomial is a multiple of a word width of arithmetic processing of the CPU.
(Supplementary note 7) The irreducible polynomial is an expression of four or more terms, and the difference between the orders of at least two intermediate terms of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU. The finite field calculation method according to 1. (Fig. 8)
(Supplementary note 8) A finite field arithmetic unit including a CPU and performing a finite field remainder operation by software control,
Reduction using at least one of the degree of the irreducible polynomial, the degree of the intermediate term, and the value obtained by subtracting the order of the intermediate term from the order of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU A finite field arithmetic device comprising reduction arithmetic means for performing arithmetic operations. (5) (FIGS. 1, 2, and 5)
(Additional remark 9) The said reduction calculating means is provided with the coefficient memory | storage means which memorize | stores each bit data showing the coefficient of each term of the object polynomial on the finite field which is the object of reduction calculation as continuous bit data, and said CPU Item 9. The finite field arithmetic device according to appendix 8, wherein data of the number of bits corresponding to the word width of the arithmetic processing is processed in parallel. (6) (Figure 3)
(Supplementary Note 10) The finite field is a finite field with characteristic 3, and the number of terms of the irreducible polynomial is 3 or more,
The reduction calculation means represents a coefficient of each term of a target polynomial on a finite field that is a target of the reduction calculation, expressed as 2-bit data, and stores coefficient data in which the upper bit and the lower bit of each term are stored as continuous bit data. The finite field arithmetic device according to appendix 8, comprising means. (Figure 3)
(Supplementary Note 11) The irreducible polynomial is a trinomial, and the degree of the intermediate term is a multiple of the word width of the arithmetic processing of the CPU,
The reduction calculation means includes:
Coefficient storage means for storing each bit data representing a coefficient of each term of a target polynomial on a finite field that is a target of reduction operation as continuous bit data,
Processing the data of the number of bits corresponding to the word width of the arithmetic processing of the CPU in parallel;
The reduction target portion of the target polynomial that is equal to or higher than the degree of the irreducible polynomial is assigned in units of the word width in order from the upper bit, and the term corresponding to the degree of the irreducible polynomial corresponds to the smallest bit in the word width. Supplementary Note 8: Shifts by the shift amount to be shifted, and adds / subtracts the shifted data in word width units to the corresponding term of the target polynomial whose degree is in the relationship between the first term of the irreducible polynomial, the intermediate term, and the constant term. The finite field arithmetic device described in 1. (Fig. 5)

本発明は、有限体(ガロア体)演算で、多項式のリダクションが用いられる場合には、どのような場合にも適用可能である。   The present invention is applicable to any case where polynomial reduction is used in a finite field (Galois field) operation.

実施例で使用するハードウエアの構成を示す図である。It is a figure which shows the structure of the hardware used in an Example. 第1実施例のリダクション演算フローである。It is a reduction calculation flow of the first embodiment. 第1実施例における係数データの格納方法を示す図である。It is a figure which shows the storage method of the coefficient data in 1st Example. 第1実施例における演算処理の説明図である。It is explanatory drawing of the arithmetic processing in 1st Example. 第1実施例におけるシフト処理を説明する図である。It is a figure explaining the shift process in 1st Example. 比較のための従来例におけるシフト処理を説明する図である。It is a figure explaining the shift process in the prior art example for a comparison. リダクション演算におけるシフト処理を説明するためのプログラムを示す図である。It is a figure which shows the program for demonstrating the shift process in a reduction calculation. 第2実施例におけるシフト処理を説明する図である。It is a figure explaining the shift process in 2nd Example. 既約3項式の探索フローである。This is an irreducible ternary search flow. mが256以下で、kが8の倍数の既約3項式のリストである。This is a list of irreducible ternary expressions in which m is 256 or less and k is a multiple of 8. 本発明と従来例の実行時間の比較結果を示す図である。It is a figure which shows the comparison result of the execution time of this invention and a prior art example.

符号の説明Explanation of symbols

21 CPU
22 ALU
24 内部バス
25 ROM
26 RAM
28 外部バス
21 CPU
22 ALU
24 Internal bus 25 ROM
26 RAM
28 External bus

Claims (8)

CPUを使用してソフトウエア制御により有限体の剰余演算を行う有限体演算方法であって、
既約多項式によるリダクション演算を行う時に、既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つが、前記CPUの演算処理のワード幅の倍数である既約多項式を使用することを特徴とする有限体演算方法。
A finite field operation method for performing a finite field remainder operation by software control using a CPU,
When performing a reduction operation using an irreducible polynomial, at least one of the degree of the irreducible polynomial, the order of the intermediate term, and the value obtained by subtracting the order of the intermediate term from the order of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU A finite field arithmetic method characterized by using an irreducible polynomial.
リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶し、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する請求項1に記載の有限体演算方法。   Each bit data representing the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is stored as continuous bit data, and the data of the number of bits corresponding to the word width of the CPU arithmetic processing is stored in parallel. The finite field calculation method according to claim 1, wherein the finite field calculation method is processed. 前記有限体は標数が3の有限体で、前記既約多項式の項数は3項以上であり、
リダクション演算の対象である有限体上の対象多項式の各項の係数を2ビットのデータで表し、各項の上位ビットと下位ビットをそれぞれ連続したビットデータとして記憶する請求項1または2に記載の有限体演算方法。
The finite field is a finite field with characteristic 3, and the number of terms of the irreducible polynomial is 3 or more,
The coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation is represented by 2-bit data, and the upper bit and the lower bit of each term are stored as continuous bit data, respectively. Finite field calculation method.
前記既約多項式は3項式であり、中間項の次数が前記CPUの演算処理のワード幅の倍数であり、リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶し、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理し、
前記対象多項式の前記既約多項式の次数以上のリダクション対象部分を、上位ビットから順に前記ワード幅単位で、前記既約多項式の次数に対応する項を前記ワード幅内の最小ビットに対応するようにシフトさせるシフト量だけシフトし、シフトしたワード幅単位のデータを、次数が前記既約多項式の第1項と中間項及び定数項との関係にある前記対象多項式の対応する項に加減算する請求項1に記載の有限体演算方法。
The irreducible polynomial is a trinomial, the degree of the intermediate term is a multiple of the word width of the arithmetic processing of the CPU, and bit data representing the coefficient of each term of the target polynomial on the finite field that is the target of the reduction operation Are stored as continuous bit data, and data of the number of bits corresponding to the word width of the arithmetic processing of the CPU is processed in parallel,
The reduction target portion of the target polynomial that is equal to or higher than the degree of the irreducible polynomial is assigned in units of the word width in order from the upper bit, and the term corresponding to the degree of the irreducible polynomial corresponds to the smallest bit in the word width. Shifting by a shift amount to be shifted, and adding / subtracting the shifted data in units of word width to a corresponding term of the target polynomial whose degree is a relation between the first term of the irreducible polynomial, an intermediate term, and a constant term. The finite field calculation method according to 1.
CPUを備え、ソフトウエア制御により有限体の剰余演算を行う有限体演算装置であって、
既約多項式の次数、中間項の次数および既約多項式の次数から中間項の次数を減じた値の少なくとも1つが、前記CPUの演算処理のワード幅の倍数である既約多項式を使用してリダクション演算を行うリダクション演算手段を備えることを特徴とする有限体演算装置。
A finite field arithmetic device that includes a CPU and performs a finite field remainder operation by software control,
Reduction using at least one of the degree of the irreducible polynomial, the degree of the intermediate term, and the value obtained by subtracting the order of the intermediate term from the order of the irreducible polynomial is a multiple of the word width of the arithmetic processing of the CPU A finite field arithmetic device comprising reduction arithmetic means for performing arithmetic operations.
前記リダクション演算手段は、リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶する係数記憶手段を備え、前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理する請求項5に記載の有限体演算装置。   The reduction operation means includes coefficient storage means for storing each bit data representing a coefficient of each term of a target polynomial on a finite field that is an object of reduction operation as continuous bit data, and 6. The finite field arithmetic unit according to claim 5, wherein data of a number of bits corresponding to a word width is processed in parallel. 前記有限体は標数が3の有限体で、前記既約多項式の項数は3項以上であり、
前記リダクション演算手段は、リダクション演算の対象である有限体上の対象多項式の各項の係数を2ビットのデータで表し、各項の上位ビットと下位ビットをそれぞれ連続したビットデータとして記憶する係数記憶手段を備える請求項5に記載の有限体演算装置。
The finite field is a finite field with characteristic 3, and the number of terms of the irreducible polynomial is 3 or more,
The reduction calculation means represents a coefficient of each term of a target polynomial on a finite field that is a target of the reduction calculation, expressed as 2-bit data, and stores coefficient data in which the upper bit and the lower bit of each term are stored as continuous bit data. The finite field arithmetic unit according to claim 5, comprising means.
前記既約多項式は3項式であり、中間項の次数が前記CPUの演算処理のワード幅の倍数であり、
前記リダクション演算手段は、
リダクション演算の対象である有限体上の対象多項式の各項の係数を表すビットデータのそれぞれを、連続したビットデータとして記憶する係数記憶手段を備え、
前記CPUの演算処理のワード幅に対応するビット数のデータを並列に処理し、
前記対象多項式の前記既約多項式の次数以上のリダクション対象部分を、上位ビットから順に前記ワード幅単位で、前記既約多項式の次数に対応する項を前記ワード幅内の最小ビットに対応するようにシフトさせるシフト量だけシフトし、シフトしたワード幅単位のデータを、次数が前記既約多項式の第1項と中間項及び定数項との関係にある前記対象多項式の対応する項に加減算する請求項5に記載の有限体演算装置。
The irreducible polynomial is a trinomial, and the order of the intermediate term is a multiple of the word width of the arithmetic processing of the CPU,
The reduction calculation means includes:
Coefficient storage means for storing each bit data representing a coefficient of each term of a target polynomial on a finite field that is a target of reduction operation as continuous bit data,
Processing the data of the number of bits corresponding to the word width of the arithmetic processing of the CPU in parallel;
The reduction target portion of the target polynomial that is equal to or higher than the degree of the irreducible polynomial is assigned in units of the word width in order from the upper bit, and the term corresponding to the degree of the irreducible polynomial corresponds to the smallest bit in the word width. Shifting by a shift amount to be shifted, and adding / subtracting the shifted data in units of word width to a corresponding term of the target polynomial whose degree is a relation between the first term of the irreducible polynomial, an intermediate term, and a constant term. 5. The finite field arithmetic device according to 5.
JP2007298063A 2007-01-19 2007-11-16 Finite field computation method and finite field computation device Active JP4998225B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007298063A JP4998225B2 (en) 2007-01-19 2007-11-16 Finite field computation method and finite field computation device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2007010135 2007-01-19
JP2007010135 2007-01-19
JP2007298063A JP4998225B2 (en) 2007-01-19 2007-11-16 Finite field computation method and finite field computation device

Publications (2)

Publication Number Publication Date
JP2008197625A JP2008197625A (en) 2008-08-28
JP4998225B2 true JP4998225B2 (en) 2012-08-15

Family

ID=39756583

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007298063A Active JP4998225B2 (en) 2007-01-19 2007-11-16 Finite field computation method and finite field computation device

Country Status (1)

Country Link
JP (1) JP4998225B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5840086B2 (en) * 2012-07-17 2016-01-06 日本電信電話株式会社 Reduction device, reduction method, and program

Also Published As

Publication number Publication date
JP2008197625A (en) 2008-08-28

Similar Documents

Publication Publication Date Title
JP5957120B1 (en) Secret sharing method, secret sharing system, distribution apparatus, and program
Bhaskar et al. Efficient Galois field arithmetic on SIMD architectures
JP5147085B2 (en) Calculation method and calculation device
JP4998225B2 (en) Finite field computation method and finite field computation device
KR101929984B1 (en) Modular multiplicator and modular multiplication method thereof
CN120371259A (en) Method and device for determining processing parameters for rounding multiplication circuit and modulo multiplication circuit
KR101533929B1 (en) Subquadratic Space Complexity Parallel Multiplier for using shifted polynomial basis, method thereof, and recording medium using this
US7539719B2 (en) Method and apparatus for performing multiplication in finite field GF(2n)
CN114706557B (en) ASIC chip and implementation method and device of Montgomery modular multiplication
CN108228138B (en) Method for rapid modular multiplication of special domain in SIDH
JP5840086B2 (en) Reduction device, reduction method, and program
TWI784406B (en) Modular operation circuit adopting iterative calculations
JP5927323B1 (en) Matrix action device, matrix action method, and program
JP3907976B2 (en) Arithmetic apparatus and arithmetic method using SPN structure in F function
JP4304937B2 (en) Jacobian group element adder
KR100954586B1 (en) Polynomial Basis-based Binary Parallel Multiplication Apparatus and Method and Microprocessor Using the Same
JP2010008883A (en) Arithmetic device for cipher, arithmetic method for cipher, and program
KR102110162B1 (en) Parallel finite field multiplication method based on a polynomial multiplication method
CN117196052B (en) Polynomial modular multiplication operator, operation method and related device
CN114610269B (en) Method, system equipment and medium for generating finite field multiplication circuit
CN119788282B (en) Data processing method, device, processor, computer equipment, medium and program
CN120744994A (en) Method and apparatus for performing truncated multiplication using optimized truncated multiplication circuit
CN119962696A (en) Polynomial modular operator, polynomial modular operation method and related device
CN118468299A (en) Encryption method, chip and electronic equipment
Cosme et al. Block recursive matrix inverse

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080730

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100825

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120409

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120417

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120430

R150 Certificate of patent or registration of utility model

Ref document number: 4998225

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150525

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350