JP2007034927A - Exponentiation arithmetic unit - Google Patents

Exponentiation arithmetic unit Download PDF

Info

Publication number
JP2007034927A
JP2007034927A JP2005220806A JP2005220806A JP2007034927A JP 2007034927 A JP2007034927 A JP 2007034927A JP 2005220806 A JP2005220806 A JP 2005220806A JP 2005220806 A JP2005220806 A JP 2005220806A JP 2007034927 A JP2007034927 A JP 2007034927A
Authority
JP
Japan
Prior art keywords
calculation
input
candidate
mod
numerical
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.)
Withdrawn
Application number
JP2005220806A
Other languages
Japanese (ja)
Inventor
Yuji Suga
祐治 須賀
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2005220806A priority Critical patent/JP2007034927A/en
Publication of JP2007034927A publication Critical patent/JP2007034927A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an exponentiation arithmetic unit capable of making a calculation with a small number of operations by reducing a prior calculation processing amount and a table size. <P>SOLUTION: In the exponentiation arithmetic unit for calculating x<SP>e</SP>from inputted two integers x and e, a prior calculation module 403 preliminarily calculates x^ä1_i} and stores the x^ä1_i} in a prior calculation numerical value storage part 404 about each of L candidate exponent strings ä1_i} (0≤i≤L-1) stored in a candidate exponent storage part 402, a dividing module 405 divides e into a plurality of numerical values äf_1} (0≤i≤F-1) so as to make j, k satisfying 1_i±1_k exist as to whether to coincide with any of candidate exponents ä1_i}, and a sequential processing module 406 uses the x^ä1_i} to sequentially update calculation results c stored in a calculation result storage part 407 about äf_i} and outputs the updated calculation results c as x<SP>e</SP>about all of the äf_i}. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は,べき乗剰余演算を行なう,べき乗演算装置に関するものである。   The present invention relates to a power arithmetic device that performs a power-residue operation.

べき乗剰余演算x(mod N)は,RSA暗号/署名をはじめElGamal暗号,DSA署名,Diffie‐Hellman鍵共有方式などで利用されている演算である。ファイルに対する署名や復号などの用途だけではなくSSLなどの通信路のセキュア化においても利用されており,通信要求に対してインタラクティブに演算を行う必要があり,処理効率は暗号処理計算時間に大きく影響する。 The power-residue operation x e (mod N) is an operation used in the ElGamal encryption, the DSA signature, the Diffie-Hellman key sharing method, etc. as well as the RSA encryption / signature. It is used not only for signing and decrypting files, but also for securing communication channels such as SSL, and it is necessary to perform computations interactively for communication requests, and the processing efficiency greatly affects cryptographic processing time. To do.

べき乗剰余演算はa)平方剰余演算x(mod N)と,b)乗算剰余演算xu(mod N)とにより構成することができる。与えられたeに対しx(mod N)を計算するために必要とするa)およびb)の乗算演算の回数を削減することにより,全体の処理時間を高速化する手法がいくつか提案されている。 The power-residue operation can be composed of a) a quadratic residue operation x 2 (mod N) and b) a multiplication residue operation xu (mod N). Several methods have been proposed for speeding up the overall processing time by reducing the number of multiplication operations a) and b) required to calculate x e (mod N) for a given e. ing.

加算鎖(addition chain)とは,a=1からはじまり最終的にa=eに至る整数の列であり,aはそれ以前に現れた数の和(つまりa=a+a(j,k<i))を満たす。例えばe=55のとき{1,2,3,6,12,13,26,27,54,55}はその例である。これはx→x→x→x→x12→x13→x26→x27→x54→x55のようにa)およびb)の演算を行うことで,x55が計算できることを表している。これは{1,2,3,4,…,52,53,54,55}のようにb)の演算だけを用いるよりも計算量を少なくすることができることを意味している。このように,与えられた指数e(上の例では55)に対し,より短い加算鎖を見つけるアルゴリズムが有益である。しかし与えられた入力eに対し,最短の(最も効率のよい)加算鎖を見つける問題はNP完全問題として知られている。そのため,理論的に最短ではないかもしれないが,計算量をできるだけ下げる様々な手法が提案されている。以下,従来例をいくつか示す。 The addition chain (Addition, chain), an integer column leading eventually a n = e starts from a 1 = 1, a i is the number of the sum appearing before that (i.e. a i = a j + a k (J, k <i)) is satisfied. For example, when e = 55, {1, 2, 3, 6, 12, 13, 26, 27, 54, 55} is an example. This by carrying out calculation of a) and b) as x → x 2 → x 3 → x 6 → x 12 → x 13 → x 26 → x 27 → x 54 → x 55, the x 55 can be calculated Represents. This means that the amount of calculation can be reduced as compared to using only the operation of b) like {1, 2, 3, 4,..., 52, 53, 54, 55}. Thus, for a given index e (55 in the above example), an algorithm that finds a shorter summing chain is useful. However, the problem of finding the shortest (most efficient) summing chain for a given input e is known as the NP complete problem. For this reason, although not theoretically the shortest, various methods have been proposed to reduce the amount of calculation as much as possible. Some conventional examples are shown below.

〔Binary Method〕
Binary Methodはある法則に基づいて構成される加算鎖によりべき乗演算を行うアルゴリズムの一つであり非特許文献1で紹介されている。
[Binary Method]
The Binary Method is one of algorithms for performing a power operation with an addition chain configured based on a certain rule, and is introduced in Non-Patent Document 1.

Binary Methodは,次のような処理を行うアルゴリズムである。与えられた指数e(kビット長)をΣi−0,…,k−1*e_i(e_iは0または1)のように2進表現しておく。入力をx,e,Nとし,出力Cはx(mod N)となるアルゴリズムは以下のとおりである。 The Binary Method is an algorithm that performs the following processing. A given exponent e (k bit length) is expressed in binary as Σ i−0 ,..., K−1 2 i * e_i (e_i is 0 or 1). The algorithm in which the inputs are x, e, N and the output C is x e (mod N) is as follows.

1)if e_(k−1)=1 then C:=x else C:=1
2)for i=k−2 downto 0
2−1)C:=C*C(mod N)
2−2)if e_i=1 then C :=C * x (mod N)
3)return C
上記において,2)のforは変数iがk−2から0まで1ずつ削減ながら2−1)及び2−2)をループ処理することを表している。図2はe=55のときBinary Methodを使って上記のようにx55(mod N)が計算される過程を表したものである。このときの加算鎖は{1,2,3,6,12,13,26,27,54,55}である。
1) if e_ (k−1) = 1 then C: = x else C: = 1
2) for i = k-2 downto 0
2-1) C: = C * C (mod N)
2-2) if e_i = 1 then C: = C * x (mod N)
3) return C
In the above, “for” in 2) indicates that the variable i is reduced by 1 from k−2 to 0 and the loop processing is performed on 2-1) and 2-2). FIG. 2 shows a process in which x 55 (mod N) is calculated as described above using the binary method when e = 55. At this time, the addition chain is {1, 2, 3, 6, 12, 13, 26, 27, 54, 55}.

〔m−ary Method〕
m−ary Method はBinary Methodを拡張させたもので,2ビット以上の処理を一度に行う方式である。入力をx,e,Nとし,出力Cはx(mod N)となるアルゴリズムは以下の通りである。ただし,与えられた指数eはkビット長であり,eはs個のr(=logm)ビット列F_0,…,F_(s−1)(ただしsはk/rを超えない整数)に分解されているとする。
[M-ary Method]
The m-ary Method is an extension of the Binary Method, and is a method for performing processing of 2 bits or more at a time. The algorithm in which the inputs are x, e, N and the output C is x e (mod N) is as follows. However, a given index e is k bits long, and e is s r (= log 2 m) bit strings F_0,..., F_ (s−1) (where s is an integer not exceeding k / r). Assume that it has been disassembled.

0)w=2,…,m−1についてx(mod N)を事前に計算しておく
1)C:=x{F_(s−1)}(mod N)とおく。
0) Calculate x w (mod N) in advance for w = 2,..., M−1 1) Let C: = x {F_ (s−1)} (mod N).

2)for i=s−2 downto 0
2−1)C:=C (mod N)
2−2)if F_i ≠0 then C:=C * x{F_i} (mod N)
3)return C
m−ary Method は,m=4のときQuaternary Method と呼ばれる。e=55のときのQuaternary Methodの処理を図3に示す。eを2進数表示すると(110111)であるが,これをr=2ビットずつに分解すると,(11 01 11)であり,図3に示されている通りに処理される。このときの加算鎖は{1,2,3,6,12,13,26,52,55}であり,Binary Methodに比べて加算鎖の長さが1つ短いため,x55を計算するための剰余演算が少なくて済むことを意味している。
2) for i = s-2 downto 0
2-1) C: = C m (mod N)
2-2) if F_i ≠ 0 then C : = C * x ∧ {F_i} (mod N)
3) return C
m-ary Method is called Quaternary Method when m = 4. FIG. 3 shows the processing of the Quaternary Method when e = 55. When e is expressed in binary, it is (110111) 2 , but when this is broken down into r = 2 bits, it is (11 01 11) 2 and is processed as shown in FIG. At this time, the addition chain is {1, 2, 3, 6, 12, 13, 26, 52 , 55 }, and the length of the addition chain is one shorter than the binary method, and therefore x 55 is calculated. This means that there is less remainder operation.

〔Constant Length Nonzero Windows(登録商標)(CLNW)〕
m−ary Methodの拡張のひとつとして,Constant Length Nonzero Windows(登録商標)(CLNW)がある。CLNCはSliding Windows(登録商標) Methods/Techniquesと呼ばれることもある。本アルゴリズムはNWとZWという2つのステートを行き交うことで構成され,初期状態はZWにおかれるとする。NWは,入力eの先頭から1ビットずつチェックし,もし0でない場合にはZWにステートが移される。ZWでは,あらかじめ定められた固定長のビット数分,入力eから入手し,m−ary Methodにおけるステップ2と同様の処理を行う。その後,先頭1ビットをチェックして0の場合にはNWにステートを移動させ,1の場合にはもう一度同じ処理を行う。
[Constant Length Nonzero Windows (registered trademark) (CLNW)]
One of the extensions of the m-ary Method is Constant Length Nonzero Windows (registered trademark) (CLNW). CLNC is sometimes referred to as Sliding Windows (registered trademark) Methods / Techniques. This algorithm is configured by moving between two states NW and ZW, and the initial state is assumed to be in ZW. The NW checks one bit at a time from the beginning of the input e. If it is not 0, the state is transferred to the ZW. In ZW, a predetermined number of fixed-length bits are obtained from the input e, and the same processing as step 2 in the m-ary method is performed. Thereafter, the first 1 bit is checked, and if it is 0, the state is moved to NW, and if it is 1, the same processing is performed again.

m−ary MethodのアルゴリズムをベースにCLNWを説明する。入力eに対し,可変長データF_0,…,F_(s−1)を,あ)F_iはすべて0で構成される,い)F_iはrビットでF_i=0ではない,の2条件のいずれかを満たすように分割する。F_iに対するビット長をL(F_i)と記載するとき,CLNWの処理は以下のように行われる。   CLNW will be explained based on the m-ary Method algorithm. For the input e, variable length data F_0,..., F_ (s-1), a) F_i is composed of all 0s, i) F_i is r bits and F_i = 0 is not one of the two conditions Divide to satisfy. When the bit length for F_i is described as L (F_i), the CLNW processing is performed as follows.

0)w=1,2,…,m−1についてx(mod N)を事前に計算しておく
1)C:=x{F_(s−1)}(mod N)とおく。
0) Calculate x w (mod N) in advance for w = 1, 2,..., M−1 1) Let C: = x {F_ (s−1)} (mod N).

2)for i=s−2 downto 0
2−1)C:=CL(F_i) (mod N)
2−2)if F_i ≠0 then C:=C * x{F_i} (mod N)
3)return C
入力e=(111001010001)に対しCLNCを適用した場合(r=3)には,(111 00 101 0 001)と分割される。ここでr=3のCLNCでは事前計算として{3,5,7}という奇数べきに対する演算結果,つまりX^eを計算するためにX^3,X^5,X^7を事前計算する必要がある。
2) for i = s-2 downto 0
2-1) C: = C ∧ L (F_i) (mod N)
2-2) if F_i ≠ 0 then C : = C * x ∧ {F_i} (mod N)
3) return C
When CLNC is applied to the input e = (111001010001) 2 (r = 3), it is divided into (111 00 101 0 001) 2 . Here, in the CLNC of r = 3, it is necessary to pre-calculate X ^ 3, X ^ 5, and X ^ 7 in order to calculate the calculation result for the odd power of {3, 5, 7}, that is, X ^ e. There is.

〔Variable Length Nonzero Windows(登録商標)(VLNC)〕
上記で紹介したアルゴリズムにおいては,入力eを固定長に分割して逐次処理を行うが,入力eを可変長に分割する手法も考えられる。Variable Length Nonzero Windows(登録商標)(VLNC)はその一例であり,r(ただしr=log2m)以下のビット長で奇数のべき,つまり,{1,3,5,...,m−1}に対してのみ事前計算を行う方式である。入力eに対し,可変長データF_0,…,F_(s−1)を,あ)F_iはすべて0で構成される,い)F_iはrビット以下で,先頭ビットと最後尾ビットが1である,の2条件のいずれかを満たすように分割する。F_iに対するビット長をL(F_i)と記載するとき,VLNC処理は以下のように行われる。
[Variable Length Nonzero Windows (registered trademark) (VLNC)]
In the algorithm introduced above, the input e is divided into fixed lengths for sequential processing, but a method of dividing the input e into variable lengths is also conceivable. Variable Length Non-Windows (registered trademark) (VLNC) is an example, and it should be an odd number with a bit length of r (where r = log 2 m) or less, that is, {1, 3, 5,. . . , M−1} are pre-computed. For the input e, variable length data F_0,..., F_ (s-1), a) F_i is composed of all 0s, i) F_i is less than r bits, and the first bit and the last bit are 1. Are divided so as to satisfy one of the two conditions. When the bit length for F_i is described as L (F_i), the VLNC processing is performed as follows.

0)w=1,3,…,m−1についてx(mod N)を事前に計算しておく
1)C:=x{F_(s−1)}(mod N)とおく。
0) Calculate x w (mod N) in advance for w = 1, 3,..., M−1 1) Let C: = x {F_ (s−1)} (mod N).

2)for i=s−2 downto 0
2−1)C:=CL(F_i) (mod N)
2−2)if F_i ≠0 then C:=C * x{F_i} (mod N)
3)return C
m−ary Methodに比べ事前計算量が少ない(奇数のべきのみ計算するため),ビットが0の箇所をスキップすることができるためステップ2における計算量を削減することができる,というメリットがある。
2) for i = s-2 downto 0
2-1) C: = C ∧ L (F_i) (mod N)
2-2) if F_i ≠ 0 then C : = C * x ∧ {F_i} (mod N)
3) return C
Compared to the m-ary Method, there is a merit that the amount of pre-computation is small (because only odd powers are calculated), and the portion where the bit is 0 can be skipped, so that the amount of calculation in Step 2 can be reduced.

入力e=(111001010001)に対しVLNCを適用した場合(r=3)には,(111 00 101 000 1)と分割される。 When VLNC is applied to input e = (111001010001) 2 (r = 3), it is divided into (111 00 101 000 1) 2 .

〔Adaptive m−ary method〕
非特許文献2では,上記で紹介したアルゴリズムにおける事前計算を入力eの解析後に必要なものだけを行う手法が紹介されている。例として入力e=(0001000100010001)を考える。このときr=4のm−ary methodを適用した場合には(0001 0001 0001 0001)と分割されるが,M^eを計算する場合には事前計算であるM^2,M^3,・・・,M^15は不要であり無駄な処理となっている。このように入力eの形により必要なデータだけを事前計算しておくことで,計算コストを下げる効果がある。
D.E.Knuth.The Art of Computer Programming:Seminumerical Algorithms,volume 2,Reading,MA:Addison−Wesley,Second edition,1981. High−Speed RSA Implementation,RSA Laboratories,1994.
[Adaptive m-ary method]
Non-Patent Document 2 introduces a method of performing only the necessary pre-calculation in the algorithm introduced above after analyzing the input e. As an example, consider input e = (0001000100010001) 2 . At this time, when the m-ary method of r = 4 is applied, it is divided into (0001 0001 0001 0001) 2. However, when calculating M ^ e, M ^ 2, M ^ 3, which are pre-calculations, are divided. ... M ^ 15 is unnecessary and is a wasteful process. Thus, precalculating only necessary data according to the form of the input e has the effect of reducing the calculation cost.
D. E. Knuth. The Art of Computer Programming: Seminal Algorithms, volume 2, Reading, MA: Addison-Wesley, Second edition, 1981. High-Speed RSA Implementation, RSA Laboratories, 1994.

上述した従来技術において,Binary Methodは事前計算を行う必要がなく,事前計算結果を格納するテーブルを持つ必要がないというメリットを持つ。しかしeを2進数表示したとき,1が立っているビットの個数が多い場合,計算処理を増大させてしまう欠点がある。m−ary methodやCLNC,VLNCでは,Binary Methodにくらべ計算量を少なくする利点があるが,テーブル参照を行うための事前計算処理の計算量が増大するデメリットがある。一方,Adaptive m−ary methodでは,m−ary method,CLNC,VLNCなどのように入力eをストリームとして逐次的に処理していく方式とは異なり,いったん入力eをすべて走査してから事前計算に必要なデータを生成する必要がある。一般的に,入力eに合わせるように分割処理,加算鎖を計算する処理のロジックは複雑であり,事前に入力eが判明しておらずeがダイナミックに変化する場合には不向きである。また計算コスト評価においては,「事前計算に必要なデータ生成」に関わる処理を無視した上で効率性を論じており,実装する場合には理論値と大きな隔たりがあると考えられる。   In the above-described prior art, the binary method does not need to perform pre-calculation and has an advantage that it is not necessary to have a table for storing the pre-calculation result. However, when e is displayed in binary, if the number of bits with 1 standing is large, there is a disadvantage that the calculation processing is increased. The m-ary method, CLNC, and VLNC have the advantage of reducing the amount of calculation compared to the binary method, but have the disadvantage of increasing the amount of calculation of the pre-calculation processing for performing table reference. On the other hand, in the adaptive m-ary method, unlike the method of sequentially processing the input e as a stream, such as m-ary method, CLNC, VLNC, etc., once the input e is scanned, the calculation is performed in advance. It is necessary to generate the necessary data. In general, the logic of the division processing and the processing for calculating the addition chain so as to match the input e is complicated, and is not suitable when the input e is not known in advance and e changes dynamically. In calculation cost evaluation, efficiency is discussed after ignoring the processing related to "data generation necessary for pre-calculation", and when implemented, it is thought that there is a big difference from the theoretical value.

本発明は,m−ary method,CLNC,VLNCにおいて必要される事前計算処理のすべてを計算するのではなく,その一部分のみの算出を行っておき,入力eを走査しながら必要になった箇所を埋めていくという方式を採用する。このハイブリッド方式が本発明において特徴的な点であり,本発明により,事前計算処理量とテーブルサイズの削減と,従来方式に比べて少ない演算回数で計算可能というメリットを持つべき乗計算方式を提供する。また,Adaptive m−ary methodのようにいったん入力eをすべて走査してから事前計算に必要なデータを生成する処理や,うまく入力eに合わせるように加算鎖を計算する複雑なロジックは不要なため,実装方法が容易であるばかりか,入力eがその都度ダイナミックに変化する場合にも適している。   The present invention does not calculate all the pre-calculation processes required in the m-ary method, CLNC, and VLNC, but calculates only a part of them and scans the input e to find the necessary portions. Adopt the method of filling. This hybrid method is a characteristic feature of the present invention, and the present invention provides a power calculation method that has the advantages of reducing the amount of pre-calculation processing and the table size, and being able to calculate with a smaller number of operations than the conventional method. . In addition, the process of generating all necessary data for pre-calculation after scanning all the input e, such as Adaptive m-ary method, and the complicated logic to calculate the addition chain to match the input e well are unnecessary. This is not only easy to implement, but also suitable when the input e changes dynamically each time.

以上説明したように本発明によれば,eを2進数表示した際のビット列内にある特徴を持つビット列が登場することを想定して,それらのビット列を候補指数として,それらに関してのみ事前計算を行うことで,事前計算処理量を削減し,従来方式に比べて少ない演算回数で計算することができるべき乗計算方式を提供することができる。   As described above, according to the present invention, assuming that a bit string having a characteristic in the bit string when e is displayed in binary number appears, the bit string is set as a candidate index, and pre-calculation is performed only on them. By doing so, it is possible to provide a power calculation method capable of reducing the amount of pre-calculation processing and calculating with a smaller number of operations compared to the conventional method.

また事前計算しておく数値の数が少なくなるので,事前計算数値を記憶するためのテーブルサイズをおさえるメリットもあわせ持ち,テーブル参照のためのメモリ領域を削減することができる。   In addition, since the number of numerical values to be pre-calculated is reduced, it has the advantage of reducing the table size for storing the pre-calculated numerical values, and the memory area for table reference can be reduced.

次に、本発明の詳細を実施例の記述に従って説明する。   Next, details of the present invention will be described in accordance with the description of the embodiments.

以下,図面を参照して,本発明の実施例を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

本発明は,例えば,図1に示すような情報処理装置(ホストコンピュータ)100に適用される。本実施例の情報処理装置100は,パーソナルコンピュータ等のコンピュータを含み,べき乗演算機能を実現する。   The present invention is applied to an information processing apparatus (host computer) 100 as shown in FIG. The information processing apparatus 100 according to the present embodiment includes a computer such as a personal computer and realizes a power operation function.

すなわち,情報処理装置100は,図1に示すように,公衆回線等のモデム118,表示部としてのモニタ102,CPU103,ROM104,RAM105,HD106,ネットワークのネットワーク接続部107,CD108,FD109,DVD110,プリンタ115のインターフェース(I/F)117,及び操作部としてのマウス112やキーボード113等のインターフェース(I/F)111が,バス116を介して互いに通信可能に接続された構成としている。   That is, as shown in FIG. 1, the information processing apparatus 100 includes a modem 118 such as a public line, a monitor 102 as a display unit, a CPU 103, a ROM 104, a RAM 105, an HD 106, a network connection unit 107, a CD 108, an FD 109, a DVD 110, An interface (I / F) 117 of the printer 115 and an interface (I / F) 111 such as a mouse 112 and a keyboard 113 as an operation unit are connected to each other via a bus 116 so as to communicate with each other.

マウス112及びキーボード113は,ユーザが情報処理装置100に対する各種指示等を入力するための操作部である。この入力情報(操作情報)は,インターフェース111を介して情報処理装置100内に取り込まれる。   The mouse 112 and the keyboard 113 are operation units for the user to input various instructions to the information processing apparatus 100. This input information (operation information) is taken into the information processing apparatus 100 via the interface 111.

情報処理装置100での各種情報(文字情報や画像情報等)は,プリンタ115により印刷出力できるようになされている。   Various information (character information, image information, etc.) in the information processing apparatus 100 can be printed out by the printer 115.

モニタ102は,ユーザへの各種指示情報や,文字情報或いは画像情報等の各種情報の表示を行う。   The monitor 102 displays various instruction information to the user and various information such as character information or image information.

CPU103は,情報処理装置100全体の動作制御を司る。すなわち,CPU103は,HD(ハードディスク)106等から処理プログラム(ソフトウェアプログラム)を読み出して実行することで,情報処理装置100全体を制御する。特に,本実施形態では,CPU103は,べき乗演算プログラムを,HD106等から読み出して実行することで,後述する処理を実施する。   The CPU 103 controls the operation of the entire information processing apparatus 100. That is, the CPU 103 controls the entire information processing apparatus 100 by reading and executing a processing program (software program) from the HD (hard disk) 106 or the like. In particular, in the present embodiment, the CPU 103 reads out and executes a power calculation program from the HD 106 or the like, thereby executing processing to be described later.

ROM104は,べき乗演算プログラム等の各種処理プログラムや,処理プログラムで利用される各種データ等を記憶する。   The ROM 104 stores various processing programs such as a power calculation program and various data used by the processing programs.

RAM105は,CPU103での各種処理のために一時的に処理プログラムや処理対象の情報を格納するための作業用エリア等として使用される。   The RAM 105 is used as a work area or the like for temporarily storing a processing program and information to be processed for various processes in the CPU 103.

HD106は,大容量記憶装置の一例としての構成要素であり,文字情報や画像情報,或いは各種処理の実行時にRAM105等へ転送される処理プログラム等を保存する。   The HD 106 is a component as an example of a large-capacity storage device, and stores character information, image information, a processing program transferred to the RAM 105 or the like when various processes are executed, and the like.

CD(CDドライブ)108は,外部記憶媒体の一例としてのCD(CD−R)に記憶されたデータを読み込み,また,当該CDへデータを書き出す機能を有する。   The CD (CD drive) 108 has a function of reading data stored in a CD (CD-R) as an example of an external storage medium and writing data to the CD.

FD(フレキシブルディスクドライブ)109は,CD108と同様に,外部記憶媒体の一例としてのFDに記憶されたデータを読み込み,また,当該FDへデータを書き出す機能を有する。   Similar to the CD 108, the FD (flexible disk drive) 109 has a function of reading data stored in an FD as an example of an external storage medium and writing data to the FD.

DVD(ディジタルビデオディスクドライブ)110は,CD108やFD109と同様に,外部記憶媒体の一例としてのDVDに記憶されたデータを読み込み,また,当該DVDへデータを書き出す機能を有する。   Similar to the CD 108 and the FD 109, the DVD (digital video disk drive) 110 has a function of reading data stored in a DVD as an example of an external storage medium and writing data to the DVD.

尚,CD,FD,DVD等の外部記憶媒体に対して,例えば,編集用のプログラム或いはプリンタドライバが記憶されている場合,これらをHD106へインストールし,必要に応じてRAM105へ転送するように構成してもよい。   For example, when an editing program or a printer driver is stored in an external storage medium such as a CD, FD, or DVD, these are installed in the HD 106 and transferred to the RAM 105 as necessary. May be.

インターフェース(I/F)111は,マウス112やキーボード113によるユーザからの入力を受け付けるためのものである。   The interface (I / F) 111 is for receiving input from the user through the mouse 112 and the keyboard 113.

モデム118は,通信モデムであり,インターフェース(I/F)119を介して,例えば公衆回線等を通じて外部のネットワークに接続される。   The modem 118 is a communication modem, and is connected to an external network through an interface (I / F) 119 through, for example, a public line.

ネットワーク接続部107は,インターフェース(I/F)114を介して外部のネットワークに接続される。   The network connection unit 107 is connected to an external network via an interface (I / F) 114.

図4は,図1の情報処理装置100において,特徴とする機能(べき乗演算機能)に着目して図示したものである。情報処理装置100は,図4に示すように,候補指数格納部402,事前計算モジュール403,事前計算数値格納部404,分割モジュール405,逐次処理モジュール406及び計算結果格納部407を有する。各モジュール403,405,406は,CPU103が所定のプログラムを実行することで実現される機能単位(モジュール)を表わす。各格納部402,404,407はRAM105やHD106に格納され必要に応じて読み出し,書き出しがなされる。   FIG. 4 illustrates the function (power calculation function) that is characteristic in the information processing apparatus 100 of FIG. As illustrated in FIG. 4, the information processing apparatus 100 includes a candidate index storage unit 402, a pre-calculation module 403, a pre-calculation numerical value storage unit 404, a division module 405, a sequential processing module 406, and a calculation result storage unit 407. Each module 403, 405, 406 represents a functional unit (module) realized by the CPU 103 executing a predetermined program. The storage units 402, 404, and 407 are stored in the RAM 105 and the HD 106, and are read and written as necessary.

情報処理装置100に対しては,外部から入力値x,N(400)及びe(401)が入力される。情報処理装置100は,入力値からべき乗剰余演算を行い結果としてc=x(mod N)(408)を出力する装置である。 Input values x, N (400), and e (401) are input to the information processing apparatus 100 from the outside. The information processing apparatus 100 is an apparatus that performs a power-residue operation from an input value and outputs c = x e (mod N) (408) as a result.

候補指数格納部402には,あらかじめ,パラメータr(後述)に対して以下の2条件を満たす数値の列である候補指数列{l_i}(0≦i≦L−1)が含まれている。   The candidate index storage unit 402 includes in advance a candidate index sequence {l_i} (0 ≦ i ≦ L−1), which is a numerical sequence satisfying the following two conditions for the parameter r (described later).

あ)候補指数列{l_i}は加算鎖を構成する(つまり,l_0=1からはじまり最終的にl_(L−1)に至る整数の列であり,l_iはそれ以前に現れた数の和(つまりl_i=l_j+l_k(j,k<i))を満たす),
い)任意の(2^r)−1以下の正数gに対して,gは候補指数列{l_i}(0≦i≦L−1)に含まれるか,またはg=l_j+l_kを満たす0≦j,k≦L−1が存在する。事前計算モジュール403は,入力値(400)と候補指数格納部402から事前計算を行い,事前計算結果を,例えばHD106にある,事前計算数値格納部404に格納する。m−ary methodではw∈{1,2,3,・・・,(2^r)−1}に対してx^w(mod N)を事前計算しておくが,本実施例ではw∈{l_i}(0≦i≦L−1)に対してx^w(mod N)を事前計算しておく。前述した2つの条件 あ)、い)を満たす場合には,gが候補指数列{l_i}に含まれない場合でもg=l_j+l_kを満たす0≦j,k≦L−1が存在するため,x^g=x^(l_j+l_k)=(x^l_j)*(x^l_k)という式から1回の乗算でx^gを得ることができることがわかる。分割モジュール405は,入力値401を分割し,入力値401および分割された数値を,例えばHD106に格納する。逐次処理モジュール406は,例えばHD106にある計算結果格納部407を逐次処理して,計算結果408を例えばHD106に格納する。計算結果はモニタ102,FD109,ネットワークI/F114,プリンタ115などを通して出力される。
A) Candidate index sequence {l_i} constitutes an addition chain (that is, an integer sequence starting from l_0 = 1 to finally l_ (L−1), where l_i is the sum of the numbers appearing before that ( That is, l_i = 1_j + l_k (j, k <i)) is satisfied),
I) For any positive number g less than or equal to (2 ^ r) -1, g is included in the candidate index sequence {l_i} (0 ≦ i ≦ L−1) or 0 ≦ satisfies g = l_j + l_k j, k ≦ L−1 exists. The pre-calculation module 403 performs pre-calculation from the input value (400) and the candidate index storage unit 402, and stores the pre-calculation result in the pre-calculation numerical value storage unit 404 in the HD 106, for example. In the m-ary method, x ^ w (mod N) is pre-calculated for w∈ {1, 2, 3,... (2 ^ r) -1}. X ^ w (mod N) is pre-calculated for {l_i} (0 ≦ i ≦ L−1). If the above two conditions a) and i) are satisfied, even if g is not included in the candidate index sequence {l_i}, 0 ≦ j and k ≦ L−1 satisfying g = l_j + l_k exist. It can be seen that x ^ g can be obtained by a single multiplication from the formula ^ g = x ^ (l_j + l_k) = (x ^ l_j) * (x ^ l_k). The division module 405 divides the input value 401 and stores the input value 401 and the divided numerical values in the HD 106, for example. The sequential processing module 406 sequentially processes the calculation result storage unit 407 in the HD 106, for example, and stores the calculation result 408 in the HD 106, for example. The calculation result is output through the monitor 102, the FD 109, the network I / F 114, the printer 115, and the like.

図5は,図4に示した構成を持つ情報処理装置100におけるべき乗剰余演算の処理手順を説明するためのフローチャートである。例えば,CPU103は,図3のフローチャートに対応する処理プログラムを読み出して実行する。これにより,情報処理装置100は次のように動作する。   FIG. 5 is a flowchart for explaining a power-residue calculation processing procedure in the information processing apparatus 100 having the configuration shown in FIG. For example, the CPU 103 reads and executes a processing program corresponding to the flowchart of FIG. Thereby, the information processing apparatus 100 operates as follows.

ステップS500:
入力された入力値e(kビット長)をΣi−0,…,k−1*e_i(e_iは0または1)のように2進表現しておく。入力値x,N,eは例えばHD106に格納される。
Step S500:
The inputted input value e (k bit length) is expressed in binary as Σ i−0 ,..., K−1 2 i * e_i (e_i is 0 or 1). The input values x, N, e are stored in the HD 106, for example.

ステップS501:
入力値x,Nから,候補指数格納部402にあるL個の候補指数列{l_i}(0≦i≦L−1)のそれぞれに対し,x{l_i}を事前に計算し,事前計算数値格納部404に格納する。
Step S501:
Input value x, the N, for each of the L candidate index columns in the candidate exponent storage unit 402 {l_i} (0 ≦ i ≦ L-1), calculated in advance x {l_i}, precomputed Stored in the numerical value storage unit 404.

ステップS502:
指数e(ビット長k)をビット長rの複数の数値{f_i}(0≦i≦F−1)に分割する。このときf_iのビット長をb_iとすると,k=Σi−0,…,F−1b_iとなるように分割しておく。ここでパラメータrは入力eのビット長に依存して変化する整数であり,例えば図10のようなテーブルから参照される。
Step S502:
The exponent e (bit length k) is divided into a plurality of numerical values {f_i} (0 ≦ i ≦ F−1) having a bit length r. At this time, if the bit length of f_i is b_i, it is divided so that k = Σ i− 0 ,..., F−1 b_i. Here, the parameter r is an integer that varies depending on the bit length of the input e, and is referenced from, for example, a table as shown in FIG.

ステップS503:
まず計算結果格納部407に,C:=xf_0(mod N)とおく。このときf_0が候補指数列{l_i}に含まれないならば以下の処理2−1)から2−3)の処理(ただしi=0として扱う)を行う。次にf_i(0≦i≦F−1)ごとに次のような逐次処理を行う。
Step S503:
First, C: = x f — 0 (mod N) is set in the calculation result storage unit 407. At this time, if f_0 is not included in the candidate index sequence {l_i}, the following processes 2-1) to 2-3) (however, i = 0) are performed. Next, the following sequential processing is performed for each f_i (0 ≦ i ≦ F−1).

for i=1 to F−1
1)C:= C(2b_i)(mod N)
2)if f_iが{l_i}に含まれない then

2−1)g=l_j+l_kを満たす0≦j,k≦L−1を算出
2−2)xf_i=(x^l_j)*(x^l_k)(mod N)を算出
2−3)xf_iを{l_i}に追加する

3)if f_i≠0 then C:=C * xf_i (mod N)
ステップS504:
ステップS503で得られた出力値c=x(mod N)を外部に出力する。
for i = 1 to F-1
1) C: = C ∧ ( 2 ∧ b_i) (mod N)
2) if f_i is not included in {l_i}
{
2-1) g = l_j + l_k satisfy 0 ≦ j, calculates k ≦ L-1 2-2) x ∧ f_i = (x ^ l_j) * (x ^ l_k) (mod N) calculated 2-3) x Add to {L_i} the f_i}
3) if f_i ≠ 0 then C : = C * x ∧ f_i (mod N)
Step S504:
The output value c = x e (mod N) obtained in step S503 is output to the outside.

ここでステップ503処理2−1)では,図6のような,1入力で2つの値を出力する「指数テーブル」を持つことが想定される。この指数テーブルはたとえば候補指数格納部402に格納される。例としてr=4,L=6,{l_i}={1, 2, 3, 4, 5, 10}の場合の指数テーブルを示す。input=3の場合のoutputには“NULL”が格納されているが,これはすでに候補指数列{l_i}に3が含まれx^3が事前計算されていることを示している。またinput=6の場合のoutputには“1,5”が格納されているが,これは候補指数列{l_i}に6が含まれおらず,x^1とx^5は事前計算されているため(x^1)*(x^5)(mod N)という乗算でx^6を得ることができる(処理2−2))ことを示している。処理2−3)では同時に指数テーブルの書き換えが行われる。上記例でx^6を算出した場合には図6をから図7へ書き換えが行われる。図7においてinput=6の場合のoutputを“NULL”と変更することで,以降のループでx^6を必要とした際に候補指数列{l_i}から取得することができる。   Here, in step 503 process 2-1), it is assumed to have an “exponential table” for outputting two values with one input as shown in FIG. This exponent table is stored in the candidate exponent storage unit 402, for example. As an example, an index table in the case of r = 4, L = 6, {l_i} = {1, 2, 3, 4, 5, 10} is shown. “NULL” is stored in output when input = 3, and this indicates that 3 is already included in the candidate index sequence {l_i} and x ^ 3 is pre-calculated. In the case of input = 6, “1, 5” is stored in the output, but this is not included in the candidate index sequence {l_i}, and x ^ 1 and x ^ 5 are pre-calculated. Therefore, x ^ 6 can be obtained by multiplication of (x ^ 1) * (x ^ 5) (mod N) (processing 2-2)). In the process 2-3), the exponent table is rewritten at the same time. When x ^ 6 is calculated in the above example, rewriting from FIG. 6 to FIG. 7 is performed. In FIG. 7, by changing the output in the case of input = 6 to “NULL”, x ^ 6 can be obtained from the candidate exponent string {l_i} in the subsequent loop.

図8はe=(1010 0110 0001 0110) ,r=4,L=6,{l_i}={1, 2, 3, 4, 5, 10}の場合の適用例である。eの先頭からrビット(ここでは4ビット)を取得しながらm−ary methodと同様に処理を行っている。まず先頭4ビット(1010) は候補指数列{l_i}に含まれるためステップ503処理2)をスキップし,すでに事前計算されたx^10を用いてステップ503処理3)を行う。次の4ビット(0110) は候補指数列{l_i}に含まれないため指数テーブルを参照することにより,事前計算された2つの値x^1,x^5から(x^1)*(x^5)(mod N)という乗算からx^6(mod N)を得て,指数テーブル変更とx^6(mod N)を候補指数列{l_i}に追加する。その後ステップ503処理3)を行う。次の4ビット(0001) ではステップ503処理2)をスキップして処理3)が行われる。最後の4ビット(0110) はすでにx^6が計算されているためステップ503処理2)をスキップすることができ処理3)が行われる。m−ary method(r=4)ではx^2からx^15までの14の事前計算を行う必要があったが,この例では,x^2,x^3,x^4,x^5,x^10の事前計算と,x^6の中途計算,つまり合計6の事前計算のみでx^eの計算を終えていることがわかり,より効率的であることが示された。 FIG. 8 shows an application example when e = (1010 0110 0001 0110) 2 , r = 4, L = 6, {l_i} = {1, 2, 3, 4, 5, 10}. Processing is performed in the same manner as the m-ary method while acquiring r bits (here, 4 bits) from the beginning of e. First, since the first 4 bits (1010) 2 are included in the candidate exponent string {l_i}, step 503 process 2) is skipped, and step 503 process 3) is performed using x ^ 10 already calculated. Since the next 4 bits (0110) 2 are not included in the candidate exponent string {l_i}, by referring to the exponent table, the two pre-computed values x ^ 1, x ^ 5 are converted into (x ^ 1) * ( x ^ 6 (mod N) is obtained from the multiplication x ^ 5) (mod N), and the exponent table change and x ^ 6 (mod N) are added to the candidate exponent string {l_i}. Thereafter, step 503 processing 3) is performed. In the next 4 bits (0001) 2 , step 503 processing 2) is skipped and processing 3) is performed. Since x ^ 6 has already been calculated for the last 4 bits (0110) 2, step 503 processing 2) can be skipped and processing 3) is performed. In the m-ary method (r = 4), it was necessary to perform 14 pre-calculations from x ^ 2 to x ^ 15. In this example, x ^ 2, x ^ 3, x ^ 4, x ^ 5 , X ^ 10 and x ^ 6 midway calculation, i.e., a total of six pre-calculations, indicate that the calculation of x ^ e has been completed, indicating that it is more efficient.

図9は指数テーブルと候補指数列{l_i}をひとつのテーブルで記述した例である。入力iに対して2つの出力の値を持っており,第2列目は図6,図7のような指数テーブルのoutputと同じ値である2つの整数であり,第3列目はx^iの値である。候補指数列への追加を行う場合にこのテーブルを用いることができる。例えば前述した例である「x^1,x^5から(x^1)*(x^5)(mod N)という乗算からx^6を得て,指数テーブル変更とx^6を候補指数列{l_i}に追加する」場合を考えると,第2列目は“NULL”を格納し,第3列目はx^6(mod N)を格納する。   FIG. 9 shows an example in which the index table and the candidate index string {l_i} are described in one table. The input i has two output values, the second column is two integers having the same value as the output of the exponent table as shown in FIGS. 6 and 7, and the third column is x ^. The value of i. This table can be used when adding to the candidate index sequence. For example, from the example “x ^ 1, x ^ 5 to (x ^ 1) * (x ^ 5) (mod N)", x ^ 6 is obtained from the multiplication, and the exponent table change and x ^ 6 are set as candidate indices. Considering the case of “add to column {l_i}”, the second column stores “NULL” and the third column stores x ^ 6 (mod N).

前述したように,m−ary methodにおいて“一部のみを計算し必要に応じて算出する方式”を採用することで事前処理の無駄を省き,演算処理時間を短縮することができる。   As described above, by adopting “a method in which only a part is calculated and calculated as necessary” in the m-ary method, it is possible to eliminate the waste of pre-processing and shorten the calculation processing time.

外部から入力値Nが入力されない場合にはべき乗演算c=xを行うが,これはべき乗剰余演算の特殊な場合と考えられるため,本実施形態では,べき乗剰余演算x(mod N)を行う装置の説明のみを行った。外部から入力値Nが入力されない場合にべき乗演算c=xを出力する方式は本発明の実施形態に含まれることはいうまでもない。 When the input value N is not input from the outside, the exponentiation operation c = x e is performed. Since this is considered to be a special case of the exponentiation remainder calculation, in this embodiment, the exponentiation remainder calculation x e (mod N) is calculated. Only a description of the equipment to be performed was given. It goes without saying that a method of outputting a power operation c = x e when no input value N is input from the outside is included in the embodiment of the present invention.

第1の実施例では,x^g(mod N)が事前計算されていない場合には必要なときに随時演算を行っているが,その際には指数テーブルを用いて,初期状態の候補指数列{l_i}(0≦i≦L−1)においてg=l_j+l_kを満たす0≦j,k≦L−1が存在するようなl_jとl_kの整数を取得している。これら数値をgに対する加算予備値と呼び,第1予備値l_j,第2予備値l_kで構成されているとする。このとき(x^l_j)*(x^l_k)(mod N)という乗算を行いx^g(mod N)を得ているが,乗算演算が2乗演算の場合とそうでない場合によって計算量が異なることが非特許文献2に記載されており,2乗演算は,異なる数値どうしの乗算にくらべ,計算量が少ないことが知られている。そこで指数テーブルにおける予備値において,第1予備値と第2予備値が同じになるように構成することで,x^gの演算における演算量を削減することができる。   In the first embodiment, when x ^ g (mod N) is not pre-computed, calculation is performed as needed, but in that case, an index table is used to select candidate indices in the initial state. An integer of l_j and l_k is obtained such that 0 ≦ j and k ≦ L−1 satisfying g = l_j + l_k exist in the column {l_i} (0 ≦ i ≦ L−1). These numerical values are called addition preliminary values for g, and are composed of a first preliminary value l_j and a second preliminary value l_k. At this time, x ^ g (mod N) is obtained by multiplying (x ^ l_j) * (x ^ l_k) (mod N), but the amount of calculation depends on whether the multiplication operation is a square operation or not. The difference is described in Non-Patent Document 2, and it is known that the square calculation has a smaller amount of calculation than multiplication of different numerical values. Therefore, by configuring the spare value in the exponent table so that the first spare value and the second spare value are the same, it is possible to reduce the amount of computation in the calculation of x ^ g.

例として図6に記載の指数テーブルから図10のようにできるだけ第1予備値と第2予備値が同じになるように再構成して指数テーブルを示す。図6と図10では,inputが6と8の箇所で異なっており,それぞれ図10においては6=3+3,8=4+4が成り立つことから第1予備値と第2予備値が同じになるように構成されていることがわかる。このように2乗演算による処理の高速化が可能となる。   As an example, the index table is reconstructed from the index table shown in FIG. 6 so that the first reserve value and the second reserve value are as similar as possible as shown in FIG. 6 and 10 are different at locations where the inputs are 6 and 8. In FIG. 10, 6 = 3 + 3 and 8 = 4 + 4 hold, so that the first reserve value and the second reserve value are the same. It can be seen that it is configured. In this way, it is possible to speed up the processing by the square calculation.

また,同様にgが偶数で,x^g(mod N)を算出する場合,指数テーブルにおける予備値を参照して予備値による乗算演算を行うよりも,g/2が候補指数列に含まれているかチェックを行い,存在する場合にはx^(g/2)の2乗演算を行う処理を優先させることで,処理の高速化が可能となる。   Similarly, when g is an even number and x ^ g (mod N) is calculated, g / 2 is included in the candidate exponent string rather than performing a multiplication operation with the reserve value by referring to the reserve value in the exponent table. If it exists, the processing speed can be increased by giving priority to the process of performing the square operation of x ^ (g / 2).

上記実施例では候補指数列として正数のみを扱っていたが,この制限事項をなくし負数も考慮することで演算を行う場合について説明する。実施例1の候補指数はr=4,L=6,{l_i}={1, 2, 3, 4, 5, 10}であった。これらの数値の和は1から15までの整数を網羅するが,ここに負数を入れた場合には,乗算演算の代わりに逆数演算を行うことで演算量を減らすことができる。例として上記例と同じr=4の場合の指数候補を示す。L=7,{l_i}={1, 2, 3, 6, 12, -1, -2}は負数2つを含む候補指数である。正数だけを抜き出した{1, 2, 3, 6, 12}は加算鎖を為しており,負数はその加算鎖のうち絶対値が同じものを選択している。この例における指数テーブルは図11で示されており,図12はその模式図である。−1,−2の項目が増加しており,outputにはべき数が10と11の箇所で利用されていることがわかる。例えばg^10の演算にはg^(−2)*g^12の乗算を行えばよい。   In the above embodiment, only positive numbers are dealt with as candidate index sequences. However, a case will be described in which calculation is performed by eliminating this restriction and taking negative numbers into account. The candidate index of Example 1 was r = 4, L = 6, {l_i} = {1, 2, 3, 4, 5, 10}. The sum of these numerical values covers integers from 1 to 15, but when a negative number is entered here, the amount of calculation can be reduced by performing reciprocal calculation instead of multiplication. As an example, index candidates in the case of r = 4 as in the above example are shown. L = 7, {l_i} = {1, 2, 3, 6, 12, −1, −2} is a candidate index including two negative numbers. {1, 2, 3, 6, 12}, which extracts only positive numbers, forms an addition chain, and the negative number selects the addition chain with the same absolute value. The index table in this example is shown in FIG. 11, and FIG. 12 is a schematic diagram thereof. It can be seen that the items of −1 and −2 are increasing, and the power is used at the places where the power numbers are 10 and 11. For example, the calculation of g ^ 10 may be performed by multiplying g ^ (-2) * g ^ 12.

負数指数の計算には拡張ユークリッド互除法を用い,x^g(mod N)からx^(―g)(mod N)の計算を行う。上記例では,g^(−1)とg^(−2)の計算に用いられる。拡張ユークリッド互除法は乗算演算に比べ非常に計算量が少なくて済むことから本方式は有効である。上記例では指数候補演算において5回の乗算演算と2回の逆数演算を行っているが,図6においては6回の乗算演算が必要であった。   For the calculation of the negative exponent, an extended Euclidean algorithm is used, and x ^ (-g) (mod N) is calculated from x ^ g (mod N). In the above example, g ^ (-1) and g ^ (-2) are used for calculation. This method is effective because the extended Euclidean algorithm requires much less computation than the multiplication operation. In the above example, five multiplication operations and two reciprocal operations are performed in the index candidate calculation, but in FIG. 6, six multiplication operations are required.

入力された e の長さ(ここではkビットとおく)によってパラメータrを変化させることがある。m−ary methodでは総演算量の平均が2^r−2+k−r+(k/r−1)(1−2^(−r))で算出される。パラメータkに対してこの値を最小にするパラメータrを決めることができる。本発明においても同様の手法をとることができるが,以下rが3から6の場合の,指数テーブルの例を示す。これらのテーブルは事前演算量を少なくするように設計されている。   The parameter r may be changed depending on the length of input e (here, k bits). In the m-ary method, the average of the total calculation amount is calculated by 2 ^ r-2 + kr- (k / r-1) (1-2 ^ (-r)). A parameter r that minimizes this value for the parameter k can be determined. The same technique can be used in the present invention, but an example of an exponent table when r is 3 to 6 will be shown below. These tables are designed to reduce the amount of pre-computation.

r=3の場合:{1, 2, 3, 4}
r=4の場合:{1, 2, 3, 6, 12, -1, -2}(図11)
r=5の場合:{1, 2, 3, 4, 7, 14, 21, 28, -1, -2}(図13)
r=6の場合:{1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, -1,-2,-3,-4}(図14)
(その他の実施例)
本発明は,複数の機器(例えばホストコンピュータ等)から構成されるシステムの一部として適用しても,一つの機器からなるものの一部に適用してもよい。
When r = 3: {1, 2, 3, 4}
When r = 4: {1, 2, 3, 6, 12, -1, -2} (FIG. 11)
When r = 5: {1, 2, 3, 4, 7, 14, 21, 28, -1, -2} (FIG. 13)
When r = 6: {1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, -1, -2, -3, -4} (FIG. 14)
(Other examples)
The present invention may be applied as a part of a system composed of a plurality of devices (for example, a host computer) or a part of a system composed of one device.

また,上述した実施例の機能を実現するべく各種のデバイスを動作させるように,該各種デバイスと接続された装置或いはシステム内のコンピュータに対し,上記実施例の機能を実現するためのソフトウェアのプログラムコードを供給し,そのシステム或いは装置のコンピュータ(CPU或いはMPU)に格納されたプログラムに従って上記各種デバイスを動作させることによって実施したものも,本発明の範疇に含まれる。   In addition, a software program for realizing the functions of the above-described embodiments for an apparatus connected to the various devices or a computer in the system so as to operate the various devices so as to realize the functions of the above-described embodiments. Implementations by supplying a code and operating the various devices according to a program stored in a computer (CPU or MPU) of the system or apparatus are also included in the scope of the present invention.

また,この場合,上記ソフトウェアのプログラムコード自体が上述した実施例の機能を実現することになり,そのプログラムコード自体は本発明を構成する。そのプログラムコードの伝送媒体としては,プログラム情報を搬送波として伝搬させて供給するためのコンピュータネットワーク(LAN,インターネット等のWAN,無線通信ネットワーク等)システムにおける通信媒体(光ファイバ等の有線回線や無線回線等)を用いることができる。   In this case, the program code of the software itself realizes the functions of the above-described embodiments, and the program code itself constitutes the present invention. As a transmission medium of the program code, a communication medium (wired line such as an optical fiber or wireless line) in a computer network (LAN, WAN such as the Internet, wireless communication network, etc.) system for propagating and supplying program information as a carrier wave Etc.) can be used.

さらに,上記プログラムコードをコンピュータに供給するための手段,例えばかかるプログラムコードを格納した記録媒体は本発明を構成する。かかるプログラムコードを記憶する記録媒体としては,例えばフレキシブルディスク,ハードディスク,光ディスク,光磁気ディスク,CD−ROM,磁気テープ,不揮発性のメモリカード,ROM等を用いることができる。   Further, means for supplying the program code to the computer, for example, a recording medium storing the program code constitutes the present invention. As a recording medium for storing the program code, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

また,コンピュータが供給されたプログラムコードを実行することにより,上述の実施例の機能が実現されるだけでなく,そのプログラムコードがコンピュータにおいて稼働しているOS(オペレーティングシステム)或いは他のアプリケーションソフト等と共同して上述の実施の形態の機能が実現される場合にもかかるプログラムコードは本発明の実施の形態に含まれることはいうまでもない。   Further, by executing the program code supplied by the computer, not only the functions of the above-described embodiments are realized, but also the OS (operating system) or other application software in which the program code is running on the computer, etc. Needless to say, the program code is also included in the embodiment of the present invention even when the functions of the above-described embodiment are realized in cooperation with the embodiment.

さらに,供給されたプログラムコードがコンピュータの機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに格納された後,そのプログラムコードの指示に基づいてその機能拡張ボードや機能拡張ユニットに備わるCPU等が実際の処理の一部又は全部を行い,その処理によって上述した実施の形態の機能が実現される場合にも本発明に含まれることはいうまでもない。   Further, after the supplied program code is stored in the memory of the function expansion board of the computer or the function expansion unit connected to the computer, the CPU of the function expansion board or function expansion unit is provided based on the instruction of the program code. Needless to say, the present invention includes the case where the functions of the above-described embodiment are realized by performing part or all of the actual processing.

実施形態の情報処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the information processing apparatus of embodiment. 従来例であるBinary Methodでの処理を表す図である。It is a figure showing the process by the Binary Method which is a prior art example. 従来例であるm−ary Method(m=4)での処理を表す図である。It is a figure showing the process by the m-ary Method (m = 4) which is a prior art example. 第1の実施の形態における情報処理装置の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the information processing apparatus in 1st Embodiment. 第1の実施の形態におけるべき乗剰余演算の処理手順を説明するためのフローチャートである。It is a flowchart for demonstrating the process procedure of the power-residue calculation in 1st Embodiment. 第1の実施の形態における初期状態の指数テーブルを表す図である。It is a figure showing the index table of the initial state in 1st Embodiment. 第1の実施の形態における変更後の指数テーブルを表す図である。It is a figure showing the index table after the change in 1st Embodiment. 第1の実施の形態における逐次計算の例を示す図である。It is a figure which shows the example of the sequential calculation in 1st Embodiment. 第1の実施の形態における指数テーブルと候補指数列をひとつのテーブルで記述した例を表す図である。It is a figure showing the example which described the index table and candidate index sequence in 1st Embodiment by one table. 第2の実施の形態における指数テーブルを表す図である。It is a figure showing the index | exponent table in 2nd Embodiment. 第3の実施の形態における指数テーブルを表す図である。It is a figure showing the index | exponent table in 3rd Embodiment. 第3の実施の形態における指数テーブルを模式化した図である。It is the figure which modeled the index table in 3rd Embodiment. 第4の実施の形態における指数テーブルを表す図である。It is a figure showing the index | exponent table in 4th Embodiment. 第4の実施の形態における指数テーブルを表す図である。It is a figure showing the index | exponent table in 4th Embodiment.

符号の説明Explanation of symbols

100 情報処理装置
102 モニタ
103 CPU
104 ROM
105 RAM
106 HD
107 ネットワーク接続部
108 CDドライブ
109 FDドライブ
110 DVDドライブ
111 インターフェース
112 マウス
113 キーボード
114 インターフェース
115 プリンタ
116 バス
117 インターフェース
118 モデム
119 インターフェース
400 入力値 x,N
401 入力値 e
402 候補指数格納部
403 事前計算モジュール
404 事前計算数値格納部
405 分割モジュール
406 逐次処理モジュール
407 計算結果格納部
408 計算結果 c
100 Information processing apparatus 102 Monitor 103 CPU
104 ROM
105 RAM
106 HD
107 Network Connection 108 CD Drive 109 FD Drive 110 DVD Drive 111 Interface 112 Mouse 113 Keyboard 114 Interface 115 Printer 116 Bus 117 Interface 118 Modem 119 Interface 400 Input Value x, N
401 Input value e
402 Candidate index storage unit 403 Pre-calculation module 404 Pre-calculation numerical value storage unit 405 Division module 406 Sequential processing module 407 Calculation result storage unit 408 Calculation result c

Claims (1)

2つの整数xおよびeからxを計算するべき乗演算装置において,
2つの整数xおよびeを入力する入力手段と,
rビットで表現されるL個の候補指数{l_i}(0≦i≦L−1)を格納する候補指数格納手段と,
前記候補指数格納手段に格納されている候補指数{l_i}のそれぞれに対し,入力された整数xからx{l_i}を事前に計算しておく事前計算手段と,
事前計算された数値x{l_i}を格納する事前計算数値格納手段と,
入力された整数eを複数の数値{f_i}(0≦i≦F−1)に分割する分割手段と,
計算結果cを格納する計算結果格納手段と,
分割された数値{f_i}(0≦i≦F−1)について,事前計算された数値x{l_i}を用いて計算結果cを逐次更新する逐次処理手段と,
全ての前記数値{f_i}について更新後の計算結果cをxとして出力する出力手段と
前記候補指数{l_i}は,l_0=1からはじまり最終的にl_(L−1)に至る整数の列であり,l_iはそれ以前に現れた数の和(つまりl_i=l_j+l_k(j,k<i))を満たし,任意の(2^r)−1以下の正数gに対して,gは{l_i}(0≦i≦L−1)に含まれるか,またはg=l_j±l_kを満たす0≦j,k≦L−1が存在することを特徴とするべき乗演算装置。
In a power arithmetic unit that calculates x e from two integers x and e,
An input means for inputting two integers x and e;
candidate index storage means for storing L candidate indices {l_i} (0 ≦ i ≦ L−1) represented by r bits;
For each of the candidate exponent stored in the candidate index storage means {L_i}, and pre-calculating means to be calculated in advance x {l_i} from the input integer x,
A pre-calculated numerical storage means for storing precomputed numerical x {l_i},
A dividing means for dividing the input integer e into a plurality of numerical values {f_i} (0 ≦ i ≦ F−1);
A calculation result storage means for storing the calculation result c;
For divided numerical {f_i} (0 ≦ i ≦ F-1), and sequential processing means for sequentially updating a calculation result c using precomputed numerical x {l_i},
Output means for outputting the updated calculation result c as x e for all the numerical values {f_i}, and the candidate index {l_i} is an integer sequence starting from l_0 = 1 and finally reaching l_ (L−1) And l_i satisfies the sum of the numbers that appeared before (ie, l_i = 1_j + l_k (j, k <i)), and for any positive number g less than (2 ^ r) −1, g is { l_i} (0 ≦ i ≦ L−1) or 0 ≦ j, k ≦ L−1 satisfying g = l_j ± l_k exists.
JP2005220806A 2005-07-29 2005-07-29 Exponentiation arithmetic unit Withdrawn JP2007034927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005220806A JP2007034927A (en) 2005-07-29 2005-07-29 Exponentiation arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005220806A JP2007034927A (en) 2005-07-29 2005-07-29 Exponentiation arithmetic unit

Publications (1)

Publication Number Publication Date
JP2007034927A true JP2007034927A (en) 2007-02-08

Family

ID=37794072

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005220806A Withdrawn JP2007034927A (en) 2005-07-29 2005-07-29 Exponentiation arithmetic unit

Country Status (1)

Country Link
JP (1) JP2007034927A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245917A (en) * 2019-08-14 2022-03-25 日本电信电话株式会社 Secret normalization index function calculation system, secret normalization index function calculation device, secret normalization index function calculation method, secret neural network calculation system, secret neural network learning system, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114245917A (en) * 2019-08-14 2022-03-25 日本电信电话株式会社 Secret normalization index function calculation system, secret normalization index function calculation device, secret normalization index function calculation method, secret neural network calculation system, secret neural network learning system, and program
CN114245917B (en) * 2019-08-14 2023-12-05 日本电信电话株式会社 Secret normalized exponential function calculation system, apparatus, method, and recording medium

Similar Documents

Publication Publication Date Title
JPWO2005015526A1 (en) Elliptic curve encryption device, elliptic curve encryption method, and elliptic curve encryption program
JP4034585B2 (en) Elliptic curve calculation device and elliptic curve calculation method
CN113467750A (en) Large integer bit width division circuit and method for SRT algorithm with radix of 4
US20070053506A1 (en) Elliptic curve encryption processor, processing method of the processor using elliptic curves, and program for causing a computer to execute point scalar multiplication on elliptic curves
JP2000010479A (en) Montgomery reduction apparatus and recording medium
JP5147085B2 (en) Calculation method and calculation device
JP5175983B2 (en) Arithmetic unit
JP3833412B2 (en) Expression data generation apparatus and method in finite field operation
JP2007034927A (en) Exponentiation arithmetic unit
WO2015173870A1 (en) Information processing system, information processing method, and program
JP4398904B2 (en) Random number sequence generation device, random number sequence generation method, arithmetic processing device, arithmetic processing method and program
JP2007034177A (en) Exponentiation arithmetic unit
JP2007286380A (en) Finite commutative group operation method, device, and program for the same
CN114868175A (en) Final power calculation device, pairing operation device, encryption processing device, final power calculation method, and final power calculation program
JP4202701B2 (en) Polynomial residue arithmetic unit, method and program
US7337203B2 (en) Exponent calculation apparatus and method, and program
JP5403982B2 (en) COMPUTER DEVICE, METHOD, AND PROGRAM
JP2004271792A (en) Device and program for scalar multiplying operation on elliptic curve
JP4203944B2 (en) Elliptic curve calculation device and elliptic curve calculation method
WO2022145057A1 (en) Decoding device, decoding method, and program
JP4861272B2 (en) Elliptic curve cryptographic operation apparatus, method, and program
JP4629972B2 (en) Vector computing device, divided value computing device, elliptic curve scalar multiplication device, elliptic cryptography computing device, vector computing method, program, and computer-readable recording medium recording the program
JP6293681B2 (en) Multi-scalar multiplication operation device, multi-scalar multiplication operation method, program
JP2001194996A (en) Division device for polynomial
JP3390966B2 (en) Remainder arithmetic device modulo square number and program recording medium therefor

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20081007