JP2009258502A - Multiplication device and program - Google Patents

Multiplication device and program Download PDF

Info

Publication number
JP2009258502A
JP2009258502A JP2008109304A JP2008109304A JP2009258502A JP 2009258502 A JP2009258502 A JP 2009258502A JP 2008109304 A JP2008109304 A JP 2008109304A JP 2008109304 A JP2008109304 A JP 2008109304A JP 2009258502 A JP2009258502 A JP 2009258502A
Authority
JP
Japan
Prior art keywords
multiplication
input
mod
input value
value
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.)
Pending
Application number
JP2008109304A
Other languages
Japanese (ja)
Inventor
Akito Niwa
朗人 丹羽
Yoshihiro Fujii
吉弘 藤井
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions Corp
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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2008109304A priority Critical patent/JP2009258502A/en
Publication of JP2009258502A publication Critical patent/JP2009258502A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To execute multiplication at high speed by using a small memory size when a processing unit (g) is large. <P>SOLUTION: In a multiplication device 10, an input/output part 12 inputs respective input values A(x), B(x), F(x), a multiplication device control part 13 partitions an input value B(x)(=x<SP>(s-1)g</SP>B<SB>S-1</SB>(x)+x<SP>(s-2)g</SP>B<SB>S-2</SB>(x)+...+x<SP>ig</SP>B<SB>i</SB>(x)+...+x<SP>g</SP>B<SB>1</SB>(x)+B<SB>0</SB>(x)) for each processing unit (g), values of (s) pieces B<SB>s-1</SB>(x), ..., B<SB>0</SB>(x) are created, and a M table creating part 14 creates an M table composed the calculation result of M[i]=A(x)x<SP>ig</SP>mod F(x) of for each order (i) of values B<SB>i</SB>(x). A T table creating part 15 refers to the M table, and creates a T table composed the calculation result of T[i]=M[i]B<SB>i</SB>(x) mod F(x) of for each order (i). A multiplication executing part 16 calculates the sum total of the calculation result T[s-1], ..., T[0] of the T table, and outputs it as a multiplication result P(x)=A(x)B(x) mod F(x). <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、有限体上の乗算を高速に実行し得る乗算装置及びプログラムに関する。   The present invention relates to a multiplication apparatus and program capable of executing multiplication on a finite field at high speed.

近年、インターネットなどのオープンなネットワークを介し、文書データや画像データなどのさまざまなデータを送受信したい要望がある。これら送受信したいデータには秘密にしたいデータが多く含まれている。そのため、第三者には分からないようにデータを暗号化した状態で送受信するための暗号化技術が普及している。   In recent years, there is a demand for transmitting and receiving various data such as document data and image data via an open network such as the Internet. These pieces of data to be transmitted / received contain a lot of data to be kept secret. For this reason, an encryption technique for transmitting and receiving data in an encrypted state so that a third party does not know it has become widespread.

この種の暗号化技術の一つとして、有限体上の演算を用いる方法がある。暗号化技術は、一般に暗号や署名を有限体GF(pm)上で定義される演算を用いて実現される。ここで、高速な暗号や署名を実現するためには、有限体上の演算を高速に実行する必要がある。高速化対象の演算には、例えば有限体上の乗算がある。 As one of this kind of encryption technology, there is a method using an operation on a finite field. The encryption technique is generally realized by using an operation defined on a finite field GF (p m ) for encryption and signature. Here, in order to realize high-speed encryption and signature, it is necessary to execute operations on a finite field at high speed. The calculation to be accelerated includes, for example, multiplication on a finite field.

有限体上の乗算の高速な実行方法としては、ハサン(Hasan)のテーブル参照法が知られている(例えば、非特許文献1参照。)。   As a high-speed execution method for multiplication on a finite field, Hasan table reference method is known (for example, see Non-Patent Document 1).

このテーブル参照法では、入力値A(x)、B(x)に対し、mビットのB(x)をgビット毎に区切ることにより、得られた値Bs-1,Bs-2,…B,…B1,B0を用いて乗算処理を実行する。この乗算処理の際に、Mテーブル及びTテーブルという2種類のテーブルを参照する。ここで、BはmビットのB(x)をgビット毎に区切ったi番目の値である。sはmより小さい自然数である(s=m/g)。また、入力値B(x)は有限体GF(pm)上の値であり、例えば次式で表される。 In this table reference method, the input values A (x) and B (x) are divided into m bits B (x) for every g bits, and the obtained values B s-1 , B s-2 , ... B i , ... B 1 and B 0 are used to perform multiplication processing. In this multiplication process, two types of tables, M table and T table, are referred to. Here, B i is an i-th value obtained by dividing m bits of B (x) every g bits. s is a natural number smaller than m (s = m / g). Further, the input value B (x) is a value on the finite field GF (p m ), and is represented by the following expression, for example.

B(x)=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xg1(x)+B0(x)
他方の入力値A(x)も有限体GF(pm)上の値であり、例えば次式で示される。
B (x) = x (s -1) g B s-1 (x) + x (s-2) g B s-2 (x) + ... + x g B 1 (x) + B 0 (x)
The other input value A (x) is also a value on the finite field GF (p m ), and is represented by the following equation, for example.

A(x)=am-1m-1+am-2m-2+…+a1x+a0
ここで、m個の係数{am-1,am-2,…,a1,a0}は、それぞれ有限体GF(p)上の要素{0,…,p−1}のいずれかである。但し、非特許文献1では、有限体GF(pm),GF(p)をそれぞれ有限体GF(2n),GF(2)としている。
A (x) = a m-1 x m-1 + a m-2 x m-2 + ... + a 1 x + a 0
Here, m coefficients {a m−1 , a m−2 ,..., A 1 , a 0 } are respectively elements {0,..., P−1} on the finite field GF (p). It is. However, in Non-Patent Document 1, the finite fields GF (p m ) and GF (p) are finite fields GF (2 n ) and GF (2), respectively.

このとき、ハサンのテーブル参照法のアルゴリズムは、図8の左欄に示すように、実行される。すなわち、A(x),B(x),F(x)及びMテーブルが入力されると、Tテーブルが作成される(step 1)。次に、入力B(x)を区切って得られたs−1番目の値Bs-1に基づき、Tテーブルを参照してP(x)が得られる(step 2)。更にFor文として、s−2番目から0番目までの各i番目の各B(x)について、次のτ1、τ2、τ3及びP(x)の演算が実行される(step 3)。 At this time, Hasan's table reference algorithm is executed as shown in the left column of FIG. That is, when A (x), B (x), F (x) and M table are input, a T table is created (step 1). Next, based on the s−1th value B s−1 obtained by dividing the input B (x), P (x) is obtained by referring to the T table (step 2). Further, as the For statement, the following operations τ 1 , τ 2 , τ 3, and P (x) are executed for each i-th B i (x) from s−2 to 0 (step 3). ).

τ1=xg1(x)、
τ2=M[P2(x)]、
τ3=T[Bi(x)]、
P(x)=τ1+τ2+τ3
ここで、P(x)、Mテーブル(M−table)、Tテーブル(T−table)及びF(x)は次式で表されるとする。

Figure 2009258502
τ 1 = x g P 1 (x),
τ 2 = M [P 2 (x)],
τ 3 = T [B i (x)],
P (x) = τ 1 + τ 2 + τ 3
Here, it is assumed that P (x), M table (M-table), T table (T-table), and F (x) are expressed by the following equations.
Figure 2009258502

しかる後、P(x)=A(x)B(x) mod F(x)の計算結果が出力される。   Thereafter, the calculation result of P (x) = A (x) B (x) mod F (x) is output.

ここで、以上のようなハサンのアルゴリズムについて簡単に説明する。   Here, the Hasan algorithm as described above will be briefly described.

ハサンのアルゴリズムでは、Bi(x)の次数をxg毎に区切って乗算処理を実行する際に、Bi(x)とxgの項に分けている。すなわち、途中計算結果であるP(x)全てに対してBi(x)を掛けるのではなく、P(x)で剰余演算が必要となる(m−g)次以上の項のみを用いるために分けている。そのため、P(x)は(m−g)次未満の項(P1(x))と(m−g)次以上の項(P2(x))に分けて処理が実行される。 In the Hasan algorithm, when the multiplication process is executed by dividing the order of B i (x) every x g , the order is divided into B i (x) and x g terms. In other words, not all the P (x) that are intermediate calculation results are multiplied by B i (x), but only the (m−g) -order or higher terms that require a remainder operation on P (x) are used. It is divided into. Therefore, P (x) is divided into a term (P 1 (x)) less than the (m−g) order and a term (P 2 (x)) higher than the (m−g) order.

そして、その(m−g)次以上の項に対する計算結果はMテーブルを用いてテーブル参照により求め、またA(x)にBi(x)を掛ける処理についてはTテーブルを参照して計算結果を求め、その処理をxg毎に区切った全てのBi(x)に対して実行することで乗算結果を得る。 Then, the (m-g) is computed for the next higher order terms obtained by table reference using M table and calculated results with reference to the T table for processing to apply a B i (x) to A (x) And the process is executed for all B i (x) divided every x g to obtain a multiplication result.

つまり、ハサンのアルゴリズムは、次のように式変形して説明できる。

Figure 2009258502
In other words, Hasan's algorithm can be explained by changing the formula as follows.
Figure 2009258502

前述したように、A(x)Bi(x) mod F(x)の計算は、Tテーブルを参照しながら実行される。Tテーブルの計算結果とxgとの乗算は、剰余演算が必要な(m−g)次以上の項に対してMテーブルを参照しながら計算結果を得る。それら計算結果を繰り返し加えながらアルゴリズムを実行している。 As described above, the calculation of A (x) B i (x) mod F (x) is performed with reference to the T table. The multiplication of the calculation result of the T table and x g obtains the calculation result while referring to the M table for the (m−g) th and higher terms that require a remainder operation. The algorithm is executed while repeatedly adding these calculation results.

しかしながら、ハサンのアルゴリズムは、処理単位gの値が大きくなると、各テーブルに必要なメモリサイズが指数関数的に大きくなることが知られている。ハサンのアルゴリズムに関し、Mテーブル及びTテーブルに必要なメモリサイズは、次式で評価できる。   However, it is known that Hasan's algorithm exponentially increases the memory size required for each table as the value of the processing unit g increases. Regarding the Hasan algorithm, the memory size required for the M table and the T table can be evaluated by the following equation.

<一般的な場合>
Mテーブル=(g+d)×2g
Tテーブル=m×g [2g<sのとき]又はm×2g [それ以外]
<m=160、g=16、s=10の場合>
Mテーブル=(16+d)×216、Tテーブル=160×216
<m=160、g=4、s=40の場合>
Mテーブル=(4+d)×24、Tテーブル=160×4
M. A. Hasan, “Look-Up Table-Based Large Finite Field Multiplication in Memory Constrained Cryptosystems”, IEEE Transactions on Computers, 2000
<General case>
M table = (g + d) × 2 g
T table = m × g [when 2 g <s] or m × 2 g [others]
<When m = 160, g = 16, s = 10>
M table = (16 + d) × 2 16 , T table = 160 × 2 16
<When m = 160, g = 4, s = 40>
M table = (4 + d) × 2 4 , T table = 160 × 4
MA Hasan, “Look-Up Table-Based Large Finite Field Multiplication in Memory Constrained Cryptosystems”, IEEE Transactions on Computers, 2000

以上説明したように、処理単位gを大きくとると、各テーブルのメモリサイズが指数関数的に増加する。特に、Mテーブルは、入力によらずに(g+d)×2gビットという大きいメモリ量を必要とする。 As described above, when the processing unit g is increased, the memory size of each table increases exponentially. In particular, the M table requires a large memory amount of (g + d) × 2 g bits regardless of input.

一方、近年のCPUのビットサイズを考慮すると、処理単位gを大きくした方が計算機上で演算を効率的に実行可能である。   On the other hand, considering the bit size of the CPU in recent years, the operation can be efficiently executed on the computer by increasing the processing unit g.

また、処理単位gを大きくすると、B(x)の個数s(=m/g)が少なくなり、ひいてはアルゴリズムのFor文の実行回数が少なくなるので、アルゴリズムの実行効率の観点からも処理単位gを大きくした方がよい。 In addition, when the processing unit g is increased, the number s (= m / g) of B i (x) decreases, and consequently the number of executions of the For statement of the algorithm decreases. Therefore, the processing unit also from the viewpoint of the algorithm execution efficiency. It is better to increase g.

従って、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行し得る乗算手法が望まれている。   Therefore, there is a demand for a multiplication method that can perform multiplication at high speed with a small memory size when the processing unit g is large.

本発明は上記実情を考慮してなされたもので、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行し得る乗算装置及びプログラムを提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a multiplication apparatus and program capable of performing multiplication at high speed with a small memory size when the processing unit g is large.

本発明の第1の局面は、第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行し、乗算結果P(x)=A(x)B(x) mod F(x)を出力する乗算装置であって、前記各入力値A(x),B(x),F(x)を入力するための入力手段と、前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段と、前記第1入力値A(x)及び前記第3入力値F(x)と、前記値B(x)の個数sとに基づき、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルを作成する手段と、前記作成したMテーブルを記憶するテーブル記憶手段と、前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成する手段と、前記作成したTテーブルを前記テーブル記憶手段に書き込む手段と、前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段と、前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段と、を備えた乗算装置である。 The first aspect of the present invention executes multiplication processing on a finite field based on the first input value A (x), the second input value B (x), and the third input value F (x), and the multiplication result A multiplier that outputs P (x) = A (x) B (x) mod F (x) for inputting the input values A (x), B (x), and F (x). input means, the second input value B (x) (= x ( s-1) g B s-1 (x) + x (s-2) g B s-2 (x) + ... + x ig B i ( x) +... + x g B 1 (x) + B 0 (x)) is divided into processing units g, and s values B s-1 (x), B s-2 (x) ,. x),..., B 1 (x), B 0 (x), the first input value A (x), the third input value F (x), and the value B i (x) based on the number s of the calculation of M for each order i of the value B i (x) [i] = a (x) x ig mod F (x) Means for creating a M table of results, a table storage means for storing the M table above created with reference to the M table in the table storage unit, the value B i (x) and the third input value Means for creating a T table composed of calculation results of T [i] = M [i] B i (x) mod F (x) for each order i of the values B i (x) based on F (x); , Means for writing the created T table into the table storage means, and all calculation results T [s-1], T [s-2],..., T [i], T table in the table storage means ..., means for calculating the sum of T [1], T [0], and means for outputting the calculation result of the sum as the multiplication result P (x) = A (x) B (x) mod F (x) And a multiplication device.

本発明の第2の局面は、第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行し、乗算結果P(x)=A(x)B(x) mod F(x)を出力する乗算装置であって、前記第1入力値A(x)及び前記第3入力値F(x)と、前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切って得られるs個の値B(x)の個数sとに基づき(但し、i=s−1,s−2,…,1,0)、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルが予め作成された場合、このMテーブルと、前記各入力値A(x),B(x),F(x)とを入力するための入力手段と、前記入力された第2入力値B(x)を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段と、前記入力されたMテーブルを記憶するテーブル記憶手段と、前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成する手段と、前記作成したTテーブルを前記テーブル記憶手段に書き込む手段と、前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段と、前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段と、を備えた乗算装置である。 The second aspect of the present invention executes a multiplication process on a finite field based on the first input value A (x), the second input value B (x), and the third input value F (x), and the multiplication result A multiplier that outputs P (x) = A (x) B (x) mod F (x), wherein the first input value A (x), the third input value F (x), and the first second input value B (x) (= x ( s-1) g B s-1 (x) + x (s-2) g B s-2 (x) + ... + x ig B i (x) + ... + x g Based on the number s of s values B i (x) obtained by dividing B 1 (x) + B 0 (x)) for each processing unit g (where i = s−1, s−2,...). , 1, 0) and M [i] = A (x) xig mod F (x) for each order i of the values B i (x), if this M table is created in advance, this M A table and the input values A (x), B (x), and F (x) are input. Input means because the separated input second input value B (x) to each processing unit g s number of values B s-1 (x), B s-2 (x), ..., B i (X),..., B 1 (x), B 0 (x), a table storage unit that stores the input M table, and an M table in the table storage unit, Based on the value B i (x) and the third input value F (x), T [i] = M [i] B i (x) mod F (x) for each order i of the value B i (x). ) For creating a T table comprising the calculation results of (1), a means for writing the created T table into the table storage means, and all the calculation results T [s−1], T for the T table in the table storage means [S-2],..., T [i],..., T [1], T [0] And outputting as a multiplication result P (x) = A (x) B (x) mod F (x), a multiplication device provided with.

なお、第1及び第2の局面は、装置として表現したが、装置に限らず、方法、プログラム、又はプログラムを記憶したコンピュータ読み取り可能な記憶媒体、として表現することもできる。   Although the first and second aspects are expressed as devices, the present invention is not limited to devices, and may be expressed as a method, a program, or a computer-readable storage medium storing a program.

また、第1及び第2の局面では、Tテーブルとしては、T[i]=M[i]Bi(x) mod F(x)の計算結果からなるものとしたが、メモリに余裕がある場合は、TテーブルをT[i]=M[i]Bi(x)の計算結果からなるものとし、mod F(x)の演算をP(x)=A(x)B(x) mod F(x)の計算時にまとめて行うことによってmod F(x)の計算量をより一層削減することも可能である。この場合のフローチャートは図3および図6のステップST13のmod F(x)を除いたものとなる。 In the first and second aspects, the T table is composed of the calculation results of T [i] = M [i] B i (x) mod F (x). In this case, the T table is composed of the calculation results of T [i] = M [i] B i (x), and the operation of mod F (x) is P (x) = A (x) B (x) mod It is also possible to further reduce the amount of calculation of mod F (x) by carrying out collectively at the time of calculating F (x). In this case, the flowchart is obtained by removing mod F (x) in step ST13 of FIGS.

(作用)
第1の局面によれば、Mテーブルを入力値A(x)に依存して順番i毎に独立して計算される構成としたことにより、従来とは異なり、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。なお、従来のMテーブルは、入力値A(x)とは無関係に全ての場合の値を予め用意したので、処理単位gに比例してテーブルサイズが指数関数的に増加している。
(Function)
According to the first aspect, the M table is configured to be independently calculated for each order i depending on the input value A (x), and unlike the conventional case, when the processing unit g is large, Multiplication can be performed at high speed with a small memory size. In the conventional M table, values in all cases are prepared in advance regardless of the input value A (x), and therefore the table size increases exponentially in proportion to the processing unit g.

第2の局面によれば、一方の入力値A(x)が固定値の場合、入力値A(x)に依存して順番i毎に独立して予め計算したMテーブルを入力する構成により、従来とは異なり、一方の入力値が固定値でも、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。   According to the second aspect, when one input value A (x) is a fixed value, depending on the input value A (x), an M table calculated in advance independently for each order i is input. Unlike the conventional case, even when one input value is a fixed value, when the processing unit g is large, multiplication can be executed at high speed with a small memory size.

以上説明したように本発明によれば、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行できる。   As described above, according to the present invention, when the processing unit g is large, multiplication can be executed at high speed with a small memory size.

以下、本発明の各実施形態について図面を用いて説明するが、その前に各実施形態の概要を述べる。   Each embodiment of the present invention will be described below with reference to the drawings, but before that, an outline of each embodiment will be described.

(第1の実施形態の概要)
第1の実施形態では、図8の中央欄に示すように、乗算を実行する。すなわち、A(x),B(x),F(x)が入力されると、M[i]=A(x)xig mod F(x)に基づき、Mテーブルが作成される(step 0)。なお、Mテーブルは、入力B(x)を区切って得られた値Bの順番i毎に、A(x)xig mod F(x)の演算結果を示している。
(Outline of the first embodiment)
In the first embodiment, multiplication is executed as shown in the center column of FIG. That is, when A (x), B (x), and F (x) are input, an M table is created based on M [i] = A (x) xig mod F (x) (step 0 ). Note that the M table indicates the calculation result of A (x) xig mod F (x) for each order i of values B i obtained by dividing the input B (x).

次に、T[i]=M[i]B(x) mod F(x)に基づき、Tテーブルが作成される(step 1)。なお、Tテーブルは、値Bの順番i毎に、M[i]B(x) mod F(x)の演算結果を示している。 Next, a T table is created based on T [i] = M [i] B i (x) mod F (x) (step 1). Note that the T table shows the calculation result of M [i] B i (x) mod F (x) for each order i of the values B i .

続いて、途中の計算結果P(x)に0を代入する(step 2)。さらに、For文として、全てのBについて、順番i毎のTテーブルの参照結果T[i]が累積加算される(step 3)。しかる後、P(x)=A(x)B(x) mod F(x)の計算結果が出力される。 Subsequently, 0 is substituted into the calculation result P (x) in the middle (step 2). Furthermore, as a For sentence, the reference result T [i] of the T table for every order i is cumulatively added for all B i (step 3). Thereafter, the calculation result of P (x) = A (x) B (x) mod F (x) is output.

以上から、処理単位gを大きくとった場合におけるメモリ使用量の少ない乗算手法を提供できる。   From the above, it is possible to provide a multiplication method with a small memory usage when the processing unit g is large.

第1の実施形態のアルゴリズムは次式で評価できる。

Figure 2009258502
The algorithm of the first embodiment can be evaluated by the following equation.
Figure 2009258502

第1の実施形態では、入力値A(x),F(x)の分だけ、順番i毎に独立にA(x)xig mod F(x)を計算してMテーブルを作成することで、準備するMテーブルのメモリサイズを削減でき、その結果、必要なメモリサイズを削減できる。例えば、Mテーブルにおいては、mビットの計算結果がxig乗の種類だけあればよく、順番iが0番目からs−1番目まであることから、mビットの計算結果がs個だけあればよい。ここで、Mテーブルのメモリサイズはm×sビットである。Tテーブルは、MテーブルとBi(x)の計算結果を格納すればよく、Mテーブルと同様に、mビットの計算結果がs個だけあればよい。 In the first embodiment, the M table is created by calculating A (x) xig mod F (x) independently for each order i for the input values A (x) and F (x). The memory size of the prepared M table can be reduced, and as a result, the required memory size can be reduced. For example, in the M table, the m-bit calculation result only needs to be of the x ig power type, and since the order i is from 0th to s−1th, there are only s m-bit calculation results. . Here, the memory size of the M table is m × s bits. The T table only needs to store the calculation results of the M table and B i (x), and only s m-bit calculation results are required as in the M table.

一方、従来手法であるハサンのテーブル参照法は、高次の計算結果を再帰的に低次の計算結果へ反映していたが、計算可能な範囲内の全ての計算結果を含むMテーブルを予め記憶しておく必要があるので、図9に示すように、(g+d)×2gビットのメモリサイズを必要とする。ここで、dは、次の多項式F(x)内の2番目に大きい次数dを意味している。

Figure 2009258502
On the other hand, the Hasan table reference method, which is a conventional method, recursively reflects high-order calculation results in low-order calculation results, but previously stores M tables including all calculation results within a computable range. Since it needs to be stored, a memory size of (g + d) × 2 g bits is required as shown in FIG. Here, d means the second largest degree d in the following polynomial F (x).
Figure 2009258502

また、mは多項式F(x)の次数である。 M is the degree of the polynomial F (x).

メモリサイズについて、図10に示すように、第1の実施形態は、gが小さな場合(g<6)にはメモリサイズが大きいが、gが大きくなってもメモリサイズが多項式的にしか増加しない。一方、ハサンのテーブル参照法は、gが小さな場合(g<6)にはメモリサイズが小さいが、gが大きくなると(6<g)、指数関数的にメモリサイズが増加する。例えば、g=16の場合のメモリサイズは、明らかに第1の実施形態の方が小さい。なお、「メモリサイズ」の用語は「メモリ量」と読み替えてもよい。   Regarding the memory size, as shown in FIG. 10, in the first embodiment, when g is small (g <6), the memory size is large, but even if g is large, the memory size only increases in a polynomial manner. . On the other hand, in the Hasan table reference method, when g is small (g <6), the memory size is small, but when g is large (6 <g), the memory size increases exponentially. For example, the memory size when g = 16 is clearly smaller in the first embodiment. The term “memory size” may be read as “memory amount”.

計算量について、図9に示すように、第1の実施形態は、TテーブルとMテーブルの2種類のテーブルを作成する必要があるが、各テーブルのメモリサイズがm×sビットと小さいので、テーブル作成時間が短くて済む。一方、ハサンのテーブル参照法は、g=16の場合、Tテーブルのメモリサイズがm×216ビットと大きいので、テーブル作成時間が第1の実施形態と比べて長くかかる。 Regarding the amount of calculation, as shown in FIG. 9, the first embodiment needs to create two types of tables, T table and M table, but the memory size of each table is as small as m × s bits. Short table creation time. On the other hand, in the Hasan table reference method, when g = 16, the memory size of the T table is as large as m × 2 16 bits, so that the table creation time is longer than that in the first embodiment.

またFor文の処理時間について、第1の実施形態とハサンのテーブル参照法とは処理内容が異なるがほぼ同等の処理時間であると考えられる。   Regarding the processing time of the For sentence, it is considered that the processing time is almost equivalent between the first embodiment and the Hasan table reference method although the processing contents are different.

以上をまとめると、第1の実施形態では、処理単位gを大きくした場合に、メモリサイズと、テーブル作成の計算量とがそれぞれ多項式的にしか増加しない。一方、ハサンのテーブル参照法では、処理単位gを大きくした場合に、メモリサイズと、テーブル作成の計算量とがそれぞれ指数関数的に増加する。   In summary, in the first embodiment, when the processing unit g is increased, the memory size and the calculation amount of table creation increase only in a polynomial manner. On the other hand, in the Hasan table reference method, when the processing unit g is increased, the memory size and the calculation amount of table creation increase exponentially.

従って、第1の実施形態においては、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。   Therefore, in the first embodiment, when the processing unit g is large, multiplication can be executed at high speed with a small memory size.

また、第1の実施形態では、ハサンのテーブル参照法とは異なり、Tテーブル作成後にはMテーブルが不要となるので、For文の実行時に必要なメモリサイズを削減することができる。   Also, in the first embodiment, unlike the Hasan table reference method, the M table is not required after the T table is created, so that the memory size required when executing the For statement can be reduced.

(第2の実施形態の概要)
第2の実施形態は、第1の実施形態の変形例であり、入力値の一方が固定値でも、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行するものである。
(Outline of the second embodiment)
The second embodiment is a modification of the first embodiment, and performs multiplication at high speed with a small memory size when the processing unit g is large even if one of the input values is a fixed value.

第2の実施形態では、図8の右欄に示すように乗算を実行する。すなわち、A(x),B(x),F(x),Mテーブルが入力される。なお、Mテーブルは、入力値A(x)が固定値であるので、M[i]=A(x)xig mod F(x)に基づき、事前に作成されている。 In the second embodiment, multiplication is executed as shown in the right column of FIG. That is, A (x), B (x), F (x), and M table are input. Note that since the input value A (x) is a fixed value, the M table is created in advance based on M [i] = A (x) xig mod F (x).

次に、T[i]=M[i]B(x) mod F(x)に基づき、Tテーブルが作成される(step 1)。なお、Tテーブルは、値Bの順番i毎に、M[i]B(x) mod F(x)の演算結果を示している。 Next, a T table is created based on T [i] = M [i] B i (x) mod F (x) (step 1). Note that the T table shows the calculation result of M [i] B i (x) mod F (x) for each order i of the values B i .

続いて、途中の計算結果P(x)に0を代入する(step 2)。さらに、For文として、全てのBについて、順番i毎のTテーブルの参照結果T[i]が累積加算される(step 3)。しかる後、P(x)=A(x)B(x) mod F(x)の計算結果が出力される。 Subsequently, 0 is substituted into the calculation result P (x) in the middle (step 2). Furthermore, as a For sentence, the reference result T [i] of the T table for every order i is cumulatively added for all B i (step 3). Thereafter, the calculation result of P (x) = A (x) B (x) mod F (x) is output.

以上のような第2の実施形態では、Mテーブルの作成処理(step 0)が省略され、予め作成したMテーブルが入力される点が第1の実施形態と異なる。また、Mテーブル入力後のアルゴリズムは第1の実施形態と同様に実行される。   The second embodiment as described above is different from the first embodiment in that the M table creation process (step 0) is omitted and a previously created M table is input. The algorithm after the M table is input is executed in the same way as in the first embodiment.

このとき、第2の実施形態と、ハサンのテーブル参照法とをメモリサイズ及び計算量について比較した結果を図11に示す。   At this time, FIG. 11 shows a result of comparing the memory size and the calculation amount between the second embodiment and the Hasan table reference method.

第2の実施形態は、メモリサイズが第1の実施形態と同一であるが、Mテーブルの作成に必要な計算量が第1の実施形態よりも削減されている。   In the second embodiment, the memory size is the same as that in the first embodiment, but the amount of calculation required for creating the M table is reduced as compared with the first embodiment.

すなわち、第2の実施形態は、第1の実施形態と同様に、処理単位gを大きくした場合に、メモリサイズと、テーブル作成の計算量とが多項式的にしか増加しないことに加え、第1の実施形態とは異なり、一方の入力値を固定値とした構成により、計算量をさらに削減することができる。しかしながら、ハサンのテーブル参照法では、前述した通り、処理単位gを大きくした場合に、メモリサイズと、テーブル作成の計算量とがそれぞれ指数関数的に増加する。   That is, in the second embodiment, in the same way as the first embodiment, when the processing unit g is increased, the memory size and the calculation amount of table creation increase only in a polynomial manner. Unlike the above embodiment, the calculation amount can be further reduced by the configuration in which one input value is a fixed value. However, in the Hasan table reference method, as described above, when the processing unit g is increased, the memory size and the calculation amount of table creation increase exponentially.

従って、第2の実施形態においては、一方の入力値が固定値であるときにも、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。   Therefore, in the second embodiment, even when one input value is a fixed value, if the processing unit g is large, multiplication can be executed at high speed with a small memory size.

以上が各実施形態の概要である。次に、本発明の各実施形態を具体的に説明する。   The above is the outline of each embodiment. Next, each embodiment of the present invention will be specifically described.

(第1の実施形態の具体的な構成)
図1は本発明の第1の実施形態に係る乗算装置の構成を示す模式図である。この乗算装置10は、第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行し、乗算結果P(x)=A(x)B(x) mod F(x)を出力するものである。
(Specific configuration of the first embodiment)
FIG. 1 is a schematic diagram showing a configuration of a multiplication apparatus according to the first embodiment of the present invention. The multiplication device 10 executes multiplication processing on a finite field based on the first input value A (x), the second input value B (x), and the third input value F (x), and the multiplication result P (x ) = A (x) B (x) mod F (x) is output.

乗算装置10は、具体的には、テーブル記憶部11、入出力部12、乗算装置制御部13、Mテーブル作成部14、Tテーブル作成部15及び乗算実行部16を備えている。   Specifically, the multiplication device 10 includes a table storage unit 11, an input / output unit 12, a multiplication device control unit 13, an M table creation unit 14, a T table creation unit 15, and a multiplication execution unit 16.

ここで、テーブル記憶部11は、各部12〜16から読出/書込可能な記憶装置であり、図2に示すように、Mテーブル及びTテーブルが記憶される。   Here, the table storage unit 11 is a storage device that can be read / written from each of the units 12 to 16, and stores an M table and a T table as shown in FIG.

ここで、Mテーブルは、後述する値B(x)の順番i毎に、M[i]=A(x)xig mod F(x)の計算結果を関連付けた参照テーブルである。ここで、値B(x)は、mビットの入力値B(x)を処理単位g毎に区切って得られる値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)である。順番iは、s−1から0までの任意の整数である。 Here, the M table is a reference table in which the calculation result of M [i] = A (x) xig mod F (x) is associated with each order i of values B i (x) described later. Here, the values B i (x) are values B s-1 (x), B s-2 (x),..., B obtained by dividing the m-bit input value B (x) for each processing unit g. i (x),..., B 1 (x), B 0 (x). The order i is an arbitrary integer from s−1 to 0.

Tテーブルは、値B(x)の順番i毎に、T[i]=M[i]B(x) mod F(x)の計算結果を関連付けた参照テーブルである。 The T table is a reference table that associates the calculation results of T [i] = M [i] B i (x) mod F (x) for each order i of the values B i (x).

入出力部12は、外部と乗算装置制御部13との間のデータの入出力機能を有しており、例えば、各入力値A(x),B(x),F(x)を乗算装置制御部13に入力する機能と、乗算装置制御部13から送出された乗算結果を出力する機能とをもっている。   The input / output unit 12 has a data input / output function between the outside and the multiplier control unit 13. For example, each input value A (x), B (x), F (x) is multiplied by the multiplier. It has a function to input to the control unit 13 and a function to output the multiplication result sent from the multiplication device control unit 13.

乗算装置制御部13は、入出力部12との間のデータの送受信機能と、各部11,12,14〜16を制御する機能とを有しており、例えば、図3のフローチャートに示す動作を実行するように、mビットの入力値B(x)を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する機能と、入力値A(x),F(x)と、値Bの個数sをMテーブル作成部14に送出する機能と、Mテーブル作成部14から処理終了の通知を受けると、値B(x),F(x)をTテーブル作成部15に送出する機能と、Tテーブル作成部15から処理終了の通知を受けると、乗算実行部16を起動する機能と、乗算実行部16から受けた乗算結果P(x)=A(x)B(x) mod F(x)を入出力部12に出力する機能とをもっている。 The multiplication device control unit 13 has a function of transmitting / receiving data to / from the input / output unit 12 and a function of controlling the units 11, 12, and 14 to 16. For example, the operation shown in the flowchart of FIG. In order to execute, the m-bit input value B (x) is divided into processing units g, and s values B s-1 (x), B s-2 (x), ..., B i (x), ..., B 1 (x), a function of creating B 0 (x), a function of sending the input values A (x), F (x), and the number s of values B i to the M table creating unit 14, When a process end notification is received from the M table creation unit 14, a function for sending the values B i (x) and F (x) to the T table creation unit 15 and a process end notification from the T table creation unit 15 are received. , A function for starting the multiplication execution unit 16 and a multiplication result P (x) = A (x) B (x) mod F (received from the multiplication execution unit 16 ) And a function of outputting to the output unit 12.

Mテーブル作成部14は、乗算装置制御部13から受けた入力値A(x),F(x)と、値B(x)の個数sとに基づき、値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルを作成してテーブル記憶部11に書き込む機能と、この書き込みの後、処理終了を乗算装置制御部13に通知する機能とをもっている。 M table creation unit 14, an input value received from the multiplication unit controller 13 A (x), F ( x), on the basis of the number s of the value B i (x), the order of the value B i (x) i A function of creating an M table composed of the calculation results of M [i] = A (x) xig mod F (x) for each and writing it to the table storage unit 11, and after this writing, the multiplication device control unit 13 and a function to notify.

Tテーブル作成部15は、乗算装置制御部13から値B(x),F(x)を受けると、テーブル記憶部11内のMテーブルを参照しながら、各B(x),F(x)に基づき、値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成してテーブル記憶部11に書き込む機能と、処理終了を乗算装置制御部13に通知する機能とをもっている。 Upon receipt of the values B i (x) and F (x) from the multiplication device control unit 13, the T table creation unit 15 refers to the M tables in the table storage unit 11 and refers to each B i (x), F ( Based on x), the table storage unit 11 creates a T table composed of the calculation results of T [i] = M [i] B i (x) mod F (x) for each order i of the values B i (x). And a function for notifying the multiplication device control unit 13 of the end of processing.

乗算実行部16は、乗算装置制御部13に起動されると、テーブル記憶部11内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する機能と、総和の計算結果を乗算結果P(x)=A(x)B(x) mod F(x)として乗算装置制御部13に出力する機能とをもっている。具体的には、乗算実行部16は、起動されると、途中の計算結果P(x)に0を代入する機能と、順番iを0に初期化する機能と、現在の順番iに基づき、テーブル記憶部11内のTテーブルを参照し、得られた計算結果T[i]を現在の計算結果P(x)に加算する機能と、現在の順番iがs−1であるか否かを判定する機能と、判定結果が否の場合(i≠s−1)、現在の順番iを+1だけ更新し、Tテーブルの参照に戻る機能と、判定の結果、順番iがs−1を示す場合(i=s−1)、現在の計算結果P(x)=T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]を乗算結果P(x)=A(x)B(x) mod F(x)として乗算装置制御部13に出力し、処理を終了する機能とをもっている。   When the multiplication execution unit 16 is activated by the multiplication device control unit 13, all the calculation results T [s-1], T [s-2],..., T [i] of the T table in the table storage unit 11 are displayed. ,..., T [1], T [0], a function for calculating the sum, and a multiplication device control unit with the result of the sum as a multiplication result P (x) = A (x) B (x) mod F (x) 13 and the function of outputting to Specifically, when activated, the multiplication execution unit 16 is activated based on the function of substituting 0 for the calculation result P (x) in the middle, the function of initializing the order i to 0, and the current order i. A function of adding the obtained calculation result T [i] to the current calculation result P (x) with reference to the T table in the table storage unit 11 and whether or not the current order i is s-1. If the determination result is negative and the determination result is negative (i ≠ s−1), the current order i is updated by +1 and the process returns to the reference to the T table. As a result of the determination, the order i indicates s−1. In the case (i = s-1), the current calculation result P (x) = T [s-1] + T [s-2] + ... + T [i] + ... + T [1] + T [0] is multiplied by the result P (X) = A (x) B (x) mod F (x) is output to the multiplier control unit 13 and the process is terminated.

なお、以上のような乗算装置10は、ハードウェア構成、又はハードウェア資源とソフトウェアとの組合せ構成のいずれでも実施可能となっている。組合せ構成のソフトウェアとしては、予めネットワーク又は記憶媒体から対応する装置のコンピュータにインストールされ、乗算装置10の機能を実現させるためのプログラムが用いられる。このように、乗算装置10がハードウェア構成又はプログラムを用いた構成で実施可能なことは、以下の各実施形態でも同様である。   Note that the multiplication device 10 as described above can be implemented with either a hardware configuration or a combination configuration of hardware resources and software. As the software of the combination configuration, a program that is installed in advance in a computer of a corresponding device from a network or a storage medium and that realizes the function of the multiplication device 10 is used. Thus, the fact that the multiplication device 10 can be implemented with a hardware configuration or a configuration using a program is the same in the following embodiments.

次に、以上のように構成された乗算装置の動作について図3のフローチャートを用いて説明する。   Next, the operation of the multiplication apparatus configured as described above will be described with reference to the flowchart of FIG.

(ST11) 乗算装置10においては、入出力部12により、入力値A(x),B(x),F(x)が乗算装置制御部13に入力される。乗算装置制御部13は、mビットの入力値B(x)を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する。しかる後、乗算装置制御部13は、入力値A(x),F(x)と、値Bの個数sをMテーブル作成部14に送出する。 (ST11) In the multiplier 10, the input values A (x), B (x), and F (x) are input to the multiplier controller 13 by the input / output unit 12. The multiplier control unit 13 divides the m-bit input value B (x) for each processing unit g, and s values B s-1 (x), B s-2 (x), ..., B i (x ,..., B 1 (x), B 0 (x) are created. Thereafter, the multiplication device control unit 13, the input value A (x), and F (x), and sends the number s of values B i to M table creation unit 14.

(ST12) Mテーブル作成部14は、入力値A(x),F(x)と、値B(x)の個数sと、次式とに基づき、値B(x)の順番i毎の次式の計算結果からなるMテーブルを作成してテーブル記憶部11に書き込む。 (ST12) The M table creation unit 14 sets the values B i (x) for each order i based on the input values A (x), F (x), the number s of values B i (x), and the following equation: M table composed of the calculation result of the following formula is created and written in the table storage unit 11.

M[i]=A(x)xig mod F(x)
なお、順番iは、個数sに基づき、s−1から0までの全ての整数(s−1,s−2,…,i,…,1,0)として得られる。
M [i] = A (x) xig mod F (x)
The order i is obtained as all integers (s-1, s-2, ..., i, ..., 1, 0) from s-1 to 0 based on the number s.

しかる後、Mテーブル作成部14は、処理終了を乗算装置制御部13に通知する。乗算装置制御部13は、この処理終了の通知を受ける。   Thereafter, the M table creation unit 14 notifies the multiplication device control unit 13 of the end of processing. The multiplier control unit 13 receives the notification of the end of the process.

(ST13) 続いて、乗算装置制御部13は、値B(x),F(x)をTテーブル作成部15に送出する。Tテーブル作成部15は、テーブル記憶部11内のMテーブルを参照しながら、各B(x),F(x)と、次式とに基づき、Tテーブルを作成してテーブル記憶部11に書き込む。 (ST13) Subsequently, the multiplier control unit 13 sends the values B i (x) and F (x) to the T table creation unit 15. The T table creation unit 15 creates a T table based on each B i (x), F (x) and the following expression while referring to the M table in the table storage unit 11 and stores it in the table storage unit 11. Write.

T[i]=M[i]Bi(x) mod F(x)
しかる後、Tテーブル作成部15は、処理終了を乗算装置制御部13に通知する。乗算装置制御部13は、この処理終了の通知を受ける。
T [i] = M [i] B i (x) mod F (x)
Thereafter, the T table creation unit 15 notifies the multiplication device control unit 13 of the end of the process. The multiplier control unit 13 receives the notification of the end of the process.

(ST14) 乗算装置制御部13は、乗算実行部16を起動する。乗算実行部16は、途中の計算結果P(x)に0を代入する。   (ST14) The multiplication device control unit 13 activates the multiplication execution unit 16. The multiplication execution unit 16 substitutes 0 for the calculation result P (x) on the way.

(ST15) 乗算実行部16は、順番iを0に初期化する。   (ST15) The multiplication execution unit 16 initializes the order i to 0.

(ST16) 乗算実行部16は、現在の順番iに基づき、テーブル記憶部11内のTテーブルを参照し、得られた計算結果T[i]を次式のように現在の計算結果P(x)に加算する。   (ST16) The multiplication execution unit 16 refers to the T table in the table storage unit 11 based on the current order i, and uses the obtained calculation result T [i] as the following calculation result P (x ).

P(x)+=T[i]
(ST17) 乗算実行部16は、現在の順番iがs−1であるか否かを判定する。
P (x) + = T [i]
(ST17) The multiplication execution unit 16 determines whether or not the current order i is s-1.

(ST18) 乗算実行部16は、ステップST17の判定結果が否の場合(i≠s−1)、現在の順番iを+1だけ更新し、ステップST16に戻る。   (ST18) When the determination result in step ST17 is negative (i ≠ s−1), the multiplication execution unit 16 updates the current order i by +1, and returns to step ST16.

(ST19) 乗算実行部16は、ステップST17の判定の結果、順番iがs−1を示す場合(i=s−1)、現在の計算結果P(x)=T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]を乗算結果P(x)=A(x)B(x) mod F(x)として乗算装置制御部13に出力し、処理を終了する。   (ST19) If the order i indicates s−1 as a result of the determination in step ST17 (i = s−1), the multiplication execution unit 16 determines the current calculation result P (x) = T [s−1] + T [ s−2] +... + T [i] +... + T [1] + T [0] is output to the multiplier control unit 13 as the multiplication result P (x) = A (x) B (x) mod F (x). The process is terminated.

なお、Tテーブルの全ての計算結果T[i](0≦i≦s−1)の総和T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]は、乗算結果P(x)=A(x)B(x) mod F(x)に相当している。すなわち、P(x)=T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]=A(x)B(x) mod F(x)となっている。   Note that the total T [s−1] + T [s−2] +... + T [i] +... + T [1] + T [[T] of all the calculation results T [i] (0 ≦ i ≦ s−1) of the T table. 0] corresponds to the multiplication result P (x) = A (x) B (x) mod F (x). That is, P (x) = T [s-1] + T [s-2] + ... + T [i] + ... + T [1] + T [0] = A (x) B (x) mod F (x) It has become.

上述したように本実施形態によれば、Mテーブルを入力値A(x)に依存して順番i毎に独立して計算される構成としたことにより、従来とは異なり、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。   As described above, according to the present embodiment, since the M table is calculated independently for each order i depending on the input value A (x), the processing unit g is large unlike the conventional case. In this case, multiplication can be executed at high speed with a small memory size.

また、上述の説明では、Tテーブルとしては、T[i]=M[i]Bi(x) mod F(x)の計算結果からなるものとしたが、メモリに余裕がある場合は、TテーブルをT[i]=M[i]Bi(x)の計算結果からなるものとし、mod F(x)の演算をP(x)=A(x)B(x) mod F(x)の計算時にまとめて行うことによってmod F(x)の計算量を削減してもよい。この場合のフローチャートは、図4に示すように、図3のステップST13のmod F(x)を除いたものとなる。 In the above description, the T table is composed of the calculation result of T [i] = M [i] B i (x) mod F (x). The table is composed of the calculation results of T [i] = M [i] B i (x), and mod F (x) is calculated by P (x) = A (x) B (x) mod F (x) It is also possible to reduce the amount of calculation of mod F (x) by carrying out all at the same time. As shown in FIG. 4, the flowchart in this case is obtained by removing mod F (x) in step ST13 of FIG.

この場合、ステップST13,ST19がそれぞれ次のステップST13’,ST19’のように実行される。   In this case, steps ST13 and ST19 are executed as the following steps ST13 'and ST19', respectively.

(ST13’) 乗算装置制御部13は、値B(x),F(x)をTテーブル作成部15に送出する。Tテーブル作成部15は、テーブル記憶部11内のMテーブルを参照しながら、各B(x),F(x)と、次式とに基づき、Tテーブルを作成してテーブル記憶部11に書き込む。 (ST13 ′) The multiplier control unit 13 sends the values B i (x) and F (x) to the T table creation unit 15. The T table creation unit 15 creates a T table based on each B i (x), F (x) and the following expression while referring to the M table in the table storage unit 11 and stores it in the table storage unit 11. Write.

T[i]=M[i]Bi(x)
(ST19’) 乗算実行部16は、ステップST17の判定の結果、順番iがs−1を示す場合(i=s−1)、現在の計算結果P(x)=T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]を入力値F(x)により剰余演算し、得られた剰余演算結果を乗算結果P(x)=A(x)B(x) mod F(x)として乗算装置制御部13に出力し、処理を終了する。
T [i] = M [i] B i (x)
(ST19 ′) As a result of the determination in step ST17, when the order i indicates s−1 (i = s−1), the multiplication execution unit 16 determines the current calculation result P (x) = T [s−1] + T. [S−2] +... + T [i] +... + T [1] + T [0] is subjected to a remainder operation with the input value F (x), and the obtained remainder operation result is multiplied by the multiplication result P (x) = A (x ) B (x) mod F (x) is output to the multiplier control unit 13 and the process is terminated.

なお、図4に示す動作の場合、Tテーブルの全ての計算結果T[i](0≦i≦s−1)の総和T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]は、乗算結果P(x)の一部P(x)’=A(x)B(x)に相当している。このため、P(x)=P(x)’mod F(x)={T[s−1]+T[s−2]+…+T[i]+…+T[1]+T[0]} mod F(x)=A(x)B(x) mod F(x)とする必要があった。   In the case of the operation shown in FIG. 4, the sum T [s−1] + T [s−2] +... + T [i] of all the calculation results T [i] (0 ≦ i ≦ s−1) of the T table. +... + T [1] + T [0] corresponds to a part P (x) ′ = A (x) B (x) of the multiplication result P (x). Therefore, P (x) = P (x) ′ mod F (x) = {T [s−1] + T [s−2] +... + T [i] +... + T [1] + T [0]} mod F (x) = A (x) B (x) mod F (x) was required.

(第2の実施形態の具体的な構成)
図5は本発明の第2の実施形態に係る乗算装置の構成を示す模式図であり、図1と同一機能部については同一符号を付してその詳しい説明を省略し、ここでは異なる部分について主に述べる。
(Specific configuration of the second embodiment)
FIG. 5 is a schematic diagram showing the configuration of the multiplication apparatus according to the second embodiment of the present invention. The same functional units as those in FIG. Mainly stated.

第2の実施形態は、第1の実施形態の変形例であり、一方の入力値A(x)が固定値の場合、予め作成したMテーブルを入力値A(x),B(x),F(x)と共に入力することにより、Mテーブル作成部14を省略した構成となっている。   The second embodiment is a modification of the first embodiment. When one input value A (x) is a fixed value, an M table created in advance is used as input values A (x), B (x), By inputting together with F (x), the M table creation unit 14 is omitted.

これに伴い、乗算装置制御部13aは、前述した乗算装置制御部13に比べ、Mテーブル作成部14に関する機能が省略されている。   Accordingly, the multiplication device control unit 13a omits the functions related to the M table creation unit 14 as compared with the multiplication device control unit 13 described above.

次に、以上のように構成された乗算装置の動作を図6のフローチャートを用いて説明する。なお、本実施形態は、前述したステップST11〜ST19のうち、ST11〜ST12の変形例のため、前述したステップST11〜ST12に代えて、ステップST11aを用いて述べる。すなわち、ステップST11aの実行後に、前述したステップST13〜ST59が実行される。   Next, the operation of the multiplier configured as described above will be described with reference to the flowchart of FIG. Since this embodiment is a modification of ST11 to ST12 among the above-described steps ST11 to ST19, step ST11a is used instead of the above-described steps ST11 to ST12. That is, steps ST13 to ST59 described above are executed after step ST11a.

始めに、Mテーブルは、入力値A(x)が固定値であるため、予め作成されている。すなわち、例えば図示しない外部装置において、一方の入力値A(x)及びF(x)と、他方の入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切って得られるs個の値B(x)の個数sとに基づき(但し、i=s−1,s−2,…,1,0)、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルが予め作成されているとする。 First, the M table is created in advance because the input value A (x) is a fixed value. That is, for example, in an external device (not shown), one input value A (x) and F (x) and the other input value B (x) (= x (s-1) g B s-1 (x) + x ( s-2) g B s-2 (x) +... + xig B i (x) +... + x g B 1 (x) + B 0 (x)) divided into processing units g Based on the number s of B i (x) (where i = s−1, s−2,..., 1, 0), M [i] = A (for each order i of the value B i (x). x) Assume that an M table composed of calculation results of x ig mod F (x) is created in advance.

(ST11a) 乗算装置10aにおいては、入出力部12により、入力値A(x),B(x),F(x),Mテーブルが乗算装置制御部13に入力される。   (ST11a) In the multiplier 10a, the input values A (x), B (x), F (x), and the M table are input to the multiplier controller 13 by the input / output unit 12.

乗算装置制御部13aは、このMテーブルをテーブル記憶部11に書き込む。また、乗算装置制御部13aは、mビットの入力値B(x)を処理単位g毎に区切り、得られた値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する。 The multiplier control unit 13a writes this M table into the table storage unit 11. Further, the multiplier control unit 13a divides the m-bit input value B (x) for each processing unit g, and obtains the obtained values B s-1 (x), B s-2 (x) ,. (X),..., B 1 (x), B 0 (x) are created.

(ST13〜ST19)ステップST11aの実行後、乗算装置10aは、前述同様に、ステップST13〜ST19の処理を実行する。   (ST13 to ST19) After the execution of step ST11a, the multiplier 10a executes the processing of steps ST13 to ST19 as described above.

上述したように本実施形態によれば、入力値A(x)に依存して順番i毎に独立して予め計算されたMテーブルを入力する構成としたことにより、従来とは異なり、一方の入力値が固定値でも、処理単位gが大きい場合に、小さいメモリサイズで高速に乗算を実行することができる。   As described above, according to the present embodiment, the M table calculated in advance independently for each order i depending on the input value A (x) is input. Even if the input value is a fixed value, when the processing unit g is large, multiplication can be executed at high speed with a small memory size.

なお、上記実施形態に記載した手法は、コンピュータに実行させることのできるプログラムとして、磁気ディスク(フロッピー(登録商標)ディスク、ハードディスクなど)、光ディスク(CD−ROM、DVDなど)、光磁気ディスク(MO)、半導体メモリなどの記憶媒体に格納して頒布することもできる。   Note that the method described in the above embodiment includes a magnetic disk (floppy (registered trademark) disk, hard disk, etc.), an optical disk (CD-ROM, DVD, etc.), a magneto-optical disk (MO) as programs that can be executed by a computer. ), And can be distributed in a storage medium such as a semiconductor memory.

また、この記憶媒体としては、プログラムを記憶でき、かつコンピュータが読み取り可能な記憶媒体であれば、その記憶形式は何れの形態であっても良い。   In addition, as long as the storage medium can store a program and can be read by a computer, the storage format may be any form.

また、上述の説明では、Tテーブルとしては、T[i]=M[i]Bi(x) mod F(x)の計算結果からなるものとしたが、メモリに余裕がある場合は、TテーブルをT[i]=M[i]Bi(x)の計算結果からなるものとし、mod F(x)の演算をP(x)=A(x)B(x) mod F(x)の計算時にまとめて行うことによってmod F(x)の計算量を削減してもよい。この場合のフローチャートは、図7に示すように、図6のステップST13のmod F(x)を除いたものとなる。この場合、乗算装置10aは、前述同様に、ステップST13’、ST14〜ST18、ST19’の処理を実行する。 In the above description, the T table is composed of the calculation result of T [i] = M [i] B i (x) mod F (x). The table is composed of the calculation results of T [i] = M [i] B i (x), and mod F (x) is calculated by P (x) = A (x) B (x) mod F (x) It is also possible to reduce the amount of calculation of mod F (x) by carrying out all at the same time. As shown in FIG. 7, the flowchart in this case is obtained by removing mod F (x) in step ST13 of FIG. In this case, the multiplying device 10a executes the processes of steps ST13 ′, ST14 to ST18, and ST19 ′ as described above.

また、記憶媒体からコンピュータにインストールされたプログラムの指示に基づきコンピュータ上で稼働しているOS(オペレーティングシステム)や、データベース管理ソフト、ネットワークソフト等のMW(ミドルウェア)等が上記実施形態を実現するための各処理の一部を実行しても良い。   In addition, an OS (operating system) running on a computer based on an instruction of a program installed in the computer from a storage medium, MW (middleware) such as database management software, network software, and the like realize the above-described embodiment. A part of each process may be executed.

さらに、本発明における記憶媒体は、コンピュータと独立した媒体に限らず、LANやインターネット等により伝送されたプログラムをダウンロードして記憶または一時記憶した記憶媒体も含まれる。   Furthermore, the storage medium in the present invention is not limited to a medium independent of a computer, but also includes a storage medium that downloads and stores or temporarily stores a program transmitted via a LAN, the Internet, or the like.

また、記憶媒体は1つに限らず、複数の媒体から上記実施形態における処理が実行される場合も本発明における記憶媒体に含まれ、媒体構成は何れの構成であっても良い。   Further, the number of storage media is not limited to one, and the case where the processing in the above embodiment is executed from a plurality of media is also included in the storage media in the present invention, and the media configuration may be any configuration.

尚、本発明におけるコンピュータは、記憶媒体に記憶されたプログラムに基づき、上記実施形態における各処理を実行するものであって、パソコン等の1つからなる装置、複数の装置がネットワーク接続されたシステム等の何れの構成であっても良い。   The computer according to the present invention executes each process in the above-described embodiment based on a program stored in a storage medium, and is a single device such as a personal computer or a system in which a plurality of devices are connected to a network. Any configuration may be used.

また、本発明におけるコンピュータとは、パソコンに限らず、情報処理機器に含まれる演算処理装置、マイコン等も含み、プログラムによって本発明の機能を実現することが可能な機器、装置を総称している。   In addition, the computer in the present invention is not limited to a personal computer, but includes an arithmetic processing device, a microcomputer, and the like included in an information processing device, and is a generic term for devices and devices that can realize the functions of the present invention by a program. .

なお、本願発明は、上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組合せにより種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。更に、異なる実施形態に亘る構成要素を適宜組合せてもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. Moreover, various inventions can be formed by appropriately combining a plurality of constituent elements disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment. Furthermore, you may combine the component covering different embodiment suitably.

本発明の第1の実施形態に係る乗算装置の構成を示すブロック図である。It is a block diagram which shows the structure of the multiplication apparatus which concerns on the 1st Embodiment of this invention. 同実施形態におけるテーブル記憶部を説明するための模式図である。It is a schematic diagram for demonstrating the table memory | storage part in the embodiment. 同実施形態における動作を説明するためのフローチャートである。It is a flowchart for demonstrating the operation | movement in the embodiment. 同実施形態における動作の変形例を説明するためのフローチャートである。It is a flowchart for demonstrating the modification of the operation | movement in the embodiment. 本発明の第2の実施形態に係る乗算装置の構成を示すブロック図である。It is a block diagram which shows the structure of the multiplication apparatus which concerns on the 2nd Embodiment of this invention. 同実施形態における動作を説明するためのフローチャートである。It is a flowchart for demonstrating the operation | movement in the embodiment. 同実施形態における動作の変形例を説明するためのフローチャートである。It is a flowchart for demonstrating the modification of the operation | movement in the embodiment. 本発明の各実施形態と従来手法とのアルゴリズムを説明するための図である。It is a figure for demonstrating the algorithm of each embodiment of this invention and a conventional method. 本発明の第1の実施形態と従来手法とのメモリサイズ及び計算量を説明するための図である。It is a figure for demonstrating the memory size and calculation amount of the 1st Embodiment of this invention and a conventional method. 本発明の各実施形態と従来手法との間でメモリサイズと処理単位との関係を示す図である。It is a figure which shows the relationship between memory size and a processing unit between each embodiment of this invention, and the conventional method. 本発明の第2の実施形態と従来手法とのメモリサイズ及び計算量を説明するための図である。It is a figure for demonstrating the memory size and calculation amount of the 2nd Embodiment of this invention and a conventional method.

符号の説明Explanation of symbols

10,10a…乗算装置、11…テーブル記憶部、12…入出力部、13,13a…乗算装置制御部、14…Mテーブル作成部、15…Tテーブル作成部、16…乗算実行部。   DESCRIPTION OF SYMBOLS 10,10a ... Multiplier, 11 ... Table memory | storage part, 12 ... Input-output part, 13, 13a ... Multiplier control part, 14 ... M table creation part, 15 ... T table creation part, 16 ... Multiplication execution part.

Claims (6)

第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行し、乗算結果P(x)=A(x)B(x) mod F(x)を出力する乗算装置であって、
前記各入力値A(x),B(x),F(x)を入力するための入力手段と、
前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段と、
前記第1入力値A(x)及び前記第3入力値F(x)と、前記値B(x)の個数sとに基づき、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルを作成する手段と、
前記作成したMテーブルを記憶するテーブル記憶手段と、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成するTテーブル作成手段と、
前記作成したTテーブルを前記テーブル記憶手段に書き込む手段と、
前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段と、
前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する出力手段と、
を備えたことを特徴とする乗算装置。
A multiplication process on a finite field is executed based on the first input value A (x), the second input value B (x), and the third input value F (x), and the multiplication result P (x) = A (x) A multiplier that outputs B (x) mod F (x),
Input means for inputting each of the input values A (x), B (x), F (x);
The second input value B (x) (= x ( s-1) g B s-1 (x) + x (s-2) g B s-2 (x) + ... + x ig B i (x) + ... + X g B 1 (x) + B 0 (x)) for each processing unit g, and s values B s-1 (x), B s-2 (x),..., B i (x),. , B 1 (x), B 0 (x),
And the first input value A (x) and the third input value F (x), on the basis of the number s of the value B i (x), M for each order i of the value B i (x) [i ] = A (x) xig mod F (x) means for creating an M table comprising the calculation results;
Table storage means for storing the created M table;
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = T table creating means for creating a T table composed of the calculation results of M [i] B i (x) mod F (x);
Means for writing the created T table into the table storage means;
Calculate the sum of all the calculation results T [s-1], T [s-2], ..., T [i], ..., T [1], T [0] of the T table in the table storage means. Means,
Output means for outputting the calculation result of the sum as the multiplication result P (x) = A (x) B (x) mod F (x);
A multiplication apparatus comprising:
第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行し、乗算結果P(x)=A(x)B(x) mod F(x)を出力する乗算装置であって、
前記第1入力値A(x)及び前記第3入力値F(x)と、前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切って得られるs個の値B(x)の個数sとに基づき(但し、i=s−1,s−2,…,1,0)、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルが予め作成された場合、このMテーブルと、前記各入力値A(x),B(x),F(x)とを入力するための入力手段と、
前記入力された第2入力値B(x)を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段と、
前記入力されたMテーブルを記憶するテーブル記憶手段と、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成するTテーブル作成手段と、
前記作成したTテーブルを前記テーブル記憶手段に書き込む手段と、
前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段と、
前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する出力手段と、
を備えたことを特徴とする乗算装置。
A multiplication process on a finite field is executed based on the first input value A (x), the second input value B (x), and the third input value F (x), and the multiplication result P (x) = A (x) A multiplier that outputs B (x) mod F (x),
The first input value A (x) and the third input value F (x), and the second input value B (x) (= x (s-1) g B s-1 (x) + x (s- 2) g B s-2 (x) +... + X ig B i (x) +... + X g B 1 (x) + B 0 (x)) is divided into processing units g and s values B i are obtained. Based on the number s of (x) (where i = s−1, s−2,..., 1, 0), M [i] = A (x) for each order i of the values B i (x). When an M table including the calculation result of x ig mod F (x) is created in advance, this M table and the input values A (x), B (x), and F (x) are input. Input means;
The input second input value B (x) is divided into processing units g, and s values B s-1 (x), B s-2 (x),..., B i (x),. Means for creating B 1 (x), B 0 (x);
Table storage means for storing the input M table;
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = T table creating means for creating a T table composed of the calculation results of M [i] B i (x) mod F (x);
Means for writing the created T table into the table storage means;
Calculate the sum of all the calculation results T [s-1], T [s-2], ..., T [i], ..., T [1], T [0] of the T table in the table storage means. Means,
Output means for outputting the calculation result of the sum as the multiplication result P (x) = A (x) B (x) mod F (x);
A multiplication apparatus comprising:
請求項1又は請求項2に記載の乗算装置において、
前記Tテーブル作成手段及び前記出力手段に代えて、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x)の計算結果からなるTテーブルを作成する手段と、
前記総和の計算結果を前記第3入力値F(x)により剰余演算し、得られた剰余演算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段と、
を備えたことを特徴とする乗算装置。
The multiplication apparatus according to claim 1 or 2,
Instead of the T table creation means and the output means,
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = Means for creating a T table comprising the calculation results of M [i] B i (x);
The calculation result of the sum is subjected to a residue operation using the third input value F (x), and the obtained residue operation result is output as the multiplication result P (x) = A (x) B (x) mod F (x). Means to
A multiplication apparatus comprising:
第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行して乗算結果P(x)=A(x)B(x) mod F(x)を出力し且つテーブル記憶手段を備えた乗算装置に用いられるプログラムであって、
前記乗算装置を、
前記各入力値A(x),B(x),F(x)を入力するための入力手段、
前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段と、
前記第1入力値A(x)及び前記第3入力値F(x)と、前記値B(x)の個数sとに基づき、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルを作成する手段、
前記作成したMテーブルを前記テーブル記憶手段に書き込む手段、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成する手段、
前記作成したTテーブルを前記テーブル記憶手段に書き込む手段、
前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段、
前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段、
として機能させるためのプログラム。
Based on the first input value A (x), the second input value B (x), and the third input value F (x), a multiplication process on a finite field is executed and the multiplication result P (x) = A (x) B (x) mod F (x) is a program that is used in a multiplication apparatus that includes table storage means,
The multiplication device;
Input means for inputting each of the input values A (x), B (x), F (x);
The second input value B (x) (= x ( s-1) g B s-1 (x) + x (s-2) g B s-2 (x) + ... + x ig B i (x) + ... + X g B 1 (x) + B 0 (x)) for each processing unit g, and s values B s-1 (x), B s-2 (x),..., B i (x),. , B 1 (x), B 0 (x),
And the first input value A (x) and the third input value F (x), on the basis of the number s of the value B i (x), M for each order i of the value B i (x) [i ] = A (x) x ig mod F (x) means for creating an M table composed of calculation results;
Means for writing the created M table into the table storage means;
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = Means for creating a T table consisting of the calculation results of M [i] B i (x) mod F (x);
Means for writing the created T table into the table storage means;
The sum of all the calculation results T [s-1], T [s-2], ..., T [i], ..., T [1], T [0] of the T table in the table storage means is calculated. means,
Means for outputting the calculation result of the sum as the multiplication result P (x) = A (x) B (x) mod F (x);
Program to function as.
第1入力値A(x)、第2入力値B(x)及び第3入力値F(x)に基づいて有限体上の乗算処理を実行して乗算結果P(x)=A(x)B(x) mod F(x)を出力し且つテーブル記憶手段を備えた乗算装置に用いられるプログラムであって、
前記乗算装置を、
前記第1入力値A(x)及び前記第3入力値F(x)と、前記第2入力値B(x)(=x(s-1)gs-1(x)+x(s-2)gs-2(x)+…+xigi(x)+…+xg1(x)+B0(x))を処理単位g毎に区切って得られるs個の値B(x)の個数sとに基づき(但し、i=s−1,s−2,…,1,0)、当該値B(x)の順番i毎のM[i]=A(x)xig mod F(x)の計算結果からなるMテーブルが予め作成された場合、このMテーブルと、前記各入力値A(x),B(x),F(x)とを入力するための入力手段、
前記入力された第2入力値B(x)を処理単位g毎に区切ってs個の値Bs-1(x),Bs-2(x),…,B(x),…,B1(x),B0(x)を作成する手段、
前記入力されたMテーブルを前記テーブル記憶手段に書き込む手段、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x) mod F(x)の計算結果からなるTテーブルを作成する手段、
前記作成したTテーブルを前記テーブル記憶手段に書き込む手段、
前記テーブル記憶手段内のTテーブルの全ての計算結果T[s−1],T[s−2],…,T[i],…,T[1],T[0]の総和を計算する手段、
前記総和の計算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段、
として機能させるためのプログラム。
Based on the first input value A (x), the second input value B (x), and the third input value F (x), a multiplication process on a finite field is executed and the multiplication result P (x) = A (x) B (x) mod F (x) is a program that is used in a multiplication apparatus that includes table storage means,
The multiplication device;
The first input value A (x) and the third input value F (x), and the second input value B (x) (= x (s-1) g B s-1 (x) + x (s- 2) g B s-2 (x) +... + X ig B i (x) +... + X g B 1 (x) + B 0 (x)) is divided into processing units g and s values B i are obtained. Based on the number s of (x) (where i = s−1, s−2,..., 1, 0), M [i] = A (x) for each order i of the values B i (x). When an M table including the calculation result of x ig mod F (x) is created in advance, this M table and the input values A (x), B (x), and F (x) are input. Input means,
The input second input value B (x) is divided into processing units g, and s values B s-1 (x), B s-2 (x),..., B i (x),. Means for creating B 1 (x), B 0 (x);
Means for writing the inputted M table into the table storage means;
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = Means for creating a T table consisting of the calculation results of M [i] B i (x) mod F (x);
Means for writing the created T table into the table storage means;
Calculate the sum of all the calculation results T [s-1], T [s-2], ..., T [i], ..., T [1], T [0] of the T table in the table storage means. means,
Means for outputting the calculation result of the sum as the multiplication result P (x) = A (x) B (x) mod F (x);
Program to function as.
請求項4又は請求項5に記載のプログラムにおいて、
前記乗算装置を、
前記Tテーブル作成手段及び前記出力手段に代えて、
前記テーブル記憶手段内のMテーブルを参照しながら、前記値B(x)及び前記第3入力値F(x)に基づき、当該値B(x)の順番i毎のT[i]=M[i]Bi(x)の計算結果からなるTテーブルを作成する手段、
前記総和の計算結果を前記第3入力値F(x)により剰余演算し、得られた剰余演算結果を前記乗算結果P(x)=A(x)B(x) mod F(x)として出力する手段、
として機能させるためのプログラム。
In the program according to claim 4 or 5,
The multiplication device;
Instead of the T table creation means and the output means,
While referring to the M table in the table storage means, based on the value B i (x) and the third input value F (x), T [i] = for each order i of the value B i (x) = Means for creating a T table composed of the calculation results of M [i] B i (x);
The calculation result of the sum is subjected to a residue operation using the third input value F (x), and the obtained residue operation result is output as the multiplication result P (x) = A (x) B (x) mod F (x). Means to
Program to function as.
JP2008109304A 2008-04-18 2008-04-18 Multiplication device and program Pending JP2009258502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008109304A JP2009258502A (en) 2008-04-18 2008-04-18 Multiplication device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008109304A JP2009258502A (en) 2008-04-18 2008-04-18 Multiplication device and program

Publications (1)

Publication Number Publication Date
JP2009258502A true JP2009258502A (en) 2009-11-05

Family

ID=41385998

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008109304A Pending JP2009258502A (en) 2008-04-18 2008-04-18 Multiplication device and program

Country Status (1)

Country Link
JP (1) JP2009258502A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06324847A (en) * 1993-05-14 1994-11-25 Nippon Telegr & Teleph Corp <Ntt> Power calculating device
JPH07200267A (en) * 1993-12-28 1995-08-04 Canon Inc Power residue operation method/circuit
JPH11212951A (en) * 1998-01-29 1999-08-06 Fujitsu Ltd Multiplication remainder arithmetic circuit
JPH11296077A (en) * 1998-04-08 1999-10-29 Nippon Telegr & Teleph Corp <Ntt> Arithmetic unit for plural generating elements using recalculation
JP2003084667A (en) * 2001-09-11 2003-03-19 Nec Corp Method and device for performing a plurality of power residue calculation to same base, and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06324847A (en) * 1993-05-14 1994-11-25 Nippon Telegr & Teleph Corp <Ntt> Power calculating device
JPH07200267A (en) * 1993-12-28 1995-08-04 Canon Inc Power residue operation method/circuit
JPH11212951A (en) * 1998-01-29 1999-08-06 Fujitsu Ltd Multiplication remainder arithmetic circuit
JPH11296077A (en) * 1998-04-08 1999-10-29 Nippon Telegr & Teleph Corp <Ntt> Arithmetic unit for plural generating elements using recalculation
JP2003084667A (en) * 2001-09-11 2003-03-19 Nec Corp Method and device for performing a plurality of power residue calculation to same base, and program

Similar Documents

Publication Publication Date Title
JP4067818B2 (en) Elliptic curve cryptography apparatus, elliptic curve cryptography program, and elliptic curve cryptography calculation method
JP6079433B2 (en) Moving average processing program and processor
US7849125B2 (en) Efficient computation of the modulo operation based on divisor (2n-1)
JP4351987B2 (en) Montgomery conversion device, arithmetic device, IC card, encryption device, decryption device, and program
JP2010152468A (en) Hash value arithmetic device, hash value arithmetic method and hash value arithmetic program
KR101666974B1 (en) Prime number generation
JP5255566B2 (en) System and method for processing data
JP2009258502A (en) Multiplication device and program
JP5953808B2 (en) Random number processing apparatus, random number processing method, and program
JP2009222778A (en) Device, method, and program for adding distributed information
JP6961950B2 (en) Storage method, storage device and storage program
JPWO2007072568A1 (en) Program processing apparatus, program processing method, program, and computer-readable recording medium
JP4202701B2 (en) Polynomial residue arithmetic unit, method and program
JP6825119B2 (en) Secret readers, secret writers, their methods, and programs
JP2007218997A (en) Prime number generation device, program and method
JP5744673B2 (en) Information processing system, information processing method, and program
JP4724200B2 (en) Power calculation apparatus and program
KR20210137612A (en) Device, method, system and computer readable storage medium for managing blockchain
JP2011081594A (en) Data processor and data processing program
JP5791562B2 (en) COMPRESSION FUNCTION OPERATION DEVICE, COMPRESSION FUNCTION OPERATION METHOD, AND PROGRAM
KR101688636B1 (en) Computation method for providing compression function for fast message hashing, and apparatus using the same
JP2009163008A (en) Pairing calculation device and program
US20220350638A1 (en) Secret multiple repetition calculation apparatus, method and program
KR20230161195A (en) Method for calculating using a zero knowledge proof-friendly one-way function, and apparatus implementing the same method
JP2006235416A (en) Device for computing scalar multiplication in elliptic curve cryptosystem, and program for the same

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Effective date: 20110607

Free format text: JAPANESE INTERMEDIATE CODE: A131

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110727

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120207