JP5403982B2 - COMPUTER DEVICE, METHOD, AND PROGRAM - Google Patents
COMPUTER DEVICE, METHOD, AND PROGRAM Download PDFInfo
- Publication number
- JP5403982B2 JP5403982B2 JP2008246307A JP2008246307A JP5403982B2 JP 5403982 B2 JP5403982 B2 JP 5403982B2 JP 2008246307 A JP2008246307 A JP 2008246307A JP 2008246307 A JP2008246307 A JP 2008246307A JP 5403982 B2 JP5403982 B2 JP 5403982B2
- Authority
- JP
- Japan
- Prior art keywords
- coefficient
- power
- adic
- calculation
- computing device
- 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.)
- Expired - Fee Related
Links
Images
Description
本発明は、有限体の拡大体においてべき乗計算を行う計算装置、方法及びプログラムに関する。 The present invention relates to a calculation apparatus, method, and program for performing a power calculation in a finite field expansion field.
従来より、通信路を流れる情報を保護するために、暗号を用いる方法がある。暗号を用いる方法には、通信相手と事前に鍵を共有しておく共通鍵暗号方式がある。この方法では、鍵の共有や管理に大きな手間がかかる。一方、公開鍵暗号方式では、事前に鍵を共有することなしに安全な通信を実現できる。このため、ネットワーク・セキュリティの基盤技術として幅広く用いられている。また、情報端末の多様化が進み、小型機器においても方式や実装を工夫して公開鍵を用いた各種スキームやプロトコルが用いられるようになってきている。しかし、公開鍵暗号方式は共通鍵暗号方式と比較して、計算処理にかかるコストが大きく、計算処理より一層の高速化が求められている。公開鍵暗号方式内で使用される計算手法については様々な高速化が図られてきた。高速なべき乗計算手法に適用できる手法に循環窓法がある(特許文献1、非特許文献1参照)。
Conventionally, there is a method using encryption in order to protect information flowing through a communication path. As a method using encryption, there is a common key encryption method in which a key is shared in advance with a communication partner. This method requires a great deal of time for key sharing and management. On the other hand, in the public key cryptosystem, secure communication can be realized without sharing a key in advance. For this reason, it is widely used as a basic technology for network security. In addition, with the diversification of information terminals, various schemes and protocols using public keys have been used even in small devices by devising methods and implementations. However, the public key cryptosystem has a higher cost for the calculation process than the common key cryptosystem, and a higher speed than the calculation process is required. Various speedups have been made for the calculation methods used in the public key cryptosystem. As a method applicable to a high-speed power calculation method, there is a cyclic window method (see
ここで循環窓法について説明する。循環窓法は楕円曲線E(GF(p^m))上の点Pのスカラーk(∈Z)倍を求める演算手法である。なお段落0003〜0010で用いる記号は特に断らない限り、特許文献1に合わせた記述とするため、この他の部分で用いている記号と意味は異なる。
Here, the circulation window method will be described. The cyclic window method is a calculation method for obtaining a scalar k (εZ) times a point P on an elliptic curve E (GF (p ^ m)). Unless otherwise specified, the symbols used in paragraphs 0003 to 0010 are described in conformity with
[用語の説明]
φはフロベニウス写像であり、φ(x,y)=(x^p,y^p)と表される。楕円曲線上の点Pに対して、φ^i(P)はフロベニウス写像を用いて高速に計算できる。
[Explanation of terms]
φ is a Frobenius map and is expressed as φ (x, y) = (x ^ p, y ^ p). For a point P on the elliptic curve, φ ^ i (P) can be calculated at high speed using the Frobenius map.
非負整数であるbに対して、ベクトルvbは以下のようにB+2個の要素で表され、各要素vb,hはb=0のときvb,0=1で、b≠0のときvb,h=([b/3^(h−1)+1]mod3)−1である。
vb=(vb,0,vb,1,・・・,vb,B,vb,B+1)
ここで、B=[log3b]である。なお、[a]はaの小数点以下を切り捨てたものである。また、wH(vb)はベクトルvbの非ゼロの要素数を表すもので、
wH(vb)=Σh=0 B+1|vb,h|
である。
For b which is a non-negative integer, the vector v b is represented by B + 2 elements as follows, and each element v b, h is v b, 0 = 1 when b = 0 and b ≠ 0. v b, h = ([b / 3 ^ (h-1) +1] mod3) -1.
v b = (v b, 0 , v b, 1 ,..., v b, B , v b, B + 1 )
Here, B = [log 3 b]. Note that [a] is obtained by discarding the decimal part of a. W H (v b ) represents the number of non-zero elements of the vector v b ,
w H (v b ) = Σ h = 0 B + 1 | v b, h |
It is.
Step1:
[適当な長さwのテーブル作成]
いくつかのbを選択しておき、それぞれのbに対して
Qb=Σi=0 B−1 vb,iφ^i(P)
を計算し、テーブルとして保持しておく。
Step1:
[Create table with appropriate length w]
Several b are selected, and for each b, Qb = Σ i = 0 B−1 v b, i φ ^ i (P)
Is calculated and stored as a table.
Step2:
[p進d進展開+初期化]
kを以下のように展開し、ci,j(∈{−1,0,1})を求め、R=О、j=n’−1をセットする。ただしОはE(GF(p^m))の単位元を表す。
k=Σi=0 n’−1 Σj=0 m’−1 ci,j d^j φ^i
Step 2:
[P-adic and d-ary expansion + initialization]
k is expanded as follows to obtain c i, j (ε {−1, 0, 1}), and R = O and j = n′−1 are set. However, O represents the unit element of E (GF (p ^ m)).
k = Σ i = 0 n′−1 Σ j = 0 m′−1 c i, j d ^ j φ ^ i
Step3:
[マッチング]
選択したbの中で、wH(vb)が大きいものから順にvbの非ゼロの要素すべてに対しci+h,j=(−1)^e vb,hとなるb,e,iを探し、0≦h≦B+1の各hに対しci+h,j=ci+h,j−(−1)^e vb,hを実行し、R=R+(−1)^e vb,h φ^iとする処理を0≦i<m’のci,jがすべて0になるまでbを変えながら実行する。ただし、e={0,1}である。
Step3:
[matching]
Among the selected b, w H (v b) for all the non-zero elements to c i + h of v b in descending order, j = (- 1) ^ e v b, a h b, e, i And execute c i + h, j = c i + h, j − (− 1) ^ e v b, h for each h of 0 ≦ h ≦ B + 1, and R = R + (− 1) ^ ev v , h The process of φ ^ i is executed while changing b until c i, j of 0 ≦ i <m ′ is all 0. However, e = {0, 1}.
Step4:
[A&D]
j=j−1とし、R=R×dを実行し、
j=0となるまで、Step3とStep4を繰り返す。
Step 4:
[A & D]
j = j−1, R = R × d,
しかし、特許文献1、非特許文献1に記載された方式は以下のような問題点があった。
(1)楕円曲線上の点のスカラー倍算を想定して考案されているため有限体のべき乗算にはそのまま適用できない
(2)テーブル作成のコストでは優位であるが、テーブルの数を削減することにより、繰り返し各jについて探索をする必要がある
(3)逆元を用いた演算は楕円曲線上の特別な点を用いると高速に計算できるということを利用しているため、一般のべき乗算には適用できない
(2)については拡大次数mが小さい間はテーブルの探索コストは小さくて済むが、拡大次数mが大きくなると、探索コストも無視できなくなる。(3)については、‘(1+φ+φ^2+・・・φ^(m−1))(P)=О’(mは拡大次数)となる楕円曲線上の点Pを用いており、有限体上の任意の元に対して同様のことはいえない。このため、テーブルQbに‘−1’をかけた値を加減算することでスカラー倍算を実現する手法と同様のことは行えない。また、テーブルに負値を含めたものすべてを保持しても良いが、拡大次数mが大きくなると、それに適したテーブルサイズも大きくなるため、保持すべきテーブルの数が爆発的に(2^Bから3^B(Bはテーブルサイズ)へ)増加する。
However, the methods described in
(1) Since it is devised assuming scalar multiplication of points on an elliptic curve, it cannot be applied as it is to power multiplication of a finite field. (2) Although it is advantageous in terms of table creation cost, it reduces the number of tables. Therefore, it is necessary to repeatedly search for each j. (3) Since an operation using an inverse element uses a special point on an elliptic curve, it can be calculated at high speed. For (2), the table search cost can be small while the expansion order m is small. However, when the expansion order m is large, the search cost cannot be ignored. For (3), the point P on the elliptic curve that is “(1 + φ + φ ^ 2 +... Φ ^ (m−1)) (P) = O ′ (m is the expansion order) is used. The same is not true for any element of. For this reason, the same method as that for realizing scalar multiplication by adding and subtracting a value obtained by multiplying the table Qb by “−1” cannot be performed. In addition, all the tables including negative values may be held. However, as the expansion order m increases, the table size suitable for it increases, so the number of tables to be stored explosively (2 ^ B To 3 ^ B (B is the table size).
本発明は、上記に鑑みてなされたものであって、有限体の拡大体において行うべき乗計算の計算量を削減可能な計算装置、方法及びプログラムを提供することを目的とする。 The present invention has been made in view of the above, and an object of the present invention is to provide a calculation device, method, and program capable of reducing the amount of power calculation to be performed in a finite field expansion field.
上述した課題を解決し、本発明は、有限体の元のべき乗を計算する計算装置であって、有限体の元a(a∈Fp^m、mは自然数、‘^’はべき乗を表す)のべき乗を計算する計算装置であって、べき指数qをs毎にs進数展開して
q=Σi=0 w−1qi×s^i (0≦qi<s)
となる各係数qiを求めるs進数展開部と、各係数qiをr進数展開して
qi=Σj=0 h−1qij×r^j (0<r<s,0≦qij<r)
となる各係数qijを求めるr進数展開部と、各係数qijを用いて、べき指数qの元のべき乗を計算するべき乗計算部とを備え、前記r進数展開部は、s進数展開後の係数q y ,q (y+1) (0≦y≦w−2)について、係数q (y+1) の値の一部のs倍を係数q y に加えて、各係数q y ,q (y+1) をr進数展開することを特徴とする。
The present invention solves the above-described problem, and the present invention is a computing device that calculates the power of an element of a finite field, and the element a of the finite field (a∈Fp ^ m, m is a natural number, and `^ 'represents a power) Is a computing device for calculating a power of n and q = Σ i = 0 w−1 q i × s ^ i (0 ≦ q i <s)
And the s-adic expansion unit for determining each coefficient q i made, each coefficient q i expand r adic q i = Σ j = 0 h -1 q ij × r ^ j (0 <r <s, 0 ≦ q ij <r)
And formed by using the r-adic expansion unit for obtaining the coefficients q ij, each coefficient q ij, should a power calculation unit for calculating the original power of the exponent q, wherein r adic expansion unit after s Decimal expansion For the coefficients q y and q (y + 1) (0 ≦ y ≦ w−2), a part s times the value of the coefficient q (y + 1) is added to the coefficient q y to obtain each coefficient q y , q (y + 1) Is expanded in r notation .
また、本発明は、s進数展開部と、r進数展開部と、べき乗計算部とを備え、有限体の元a(a∈Fp^m、mは自然数、‘^’はべき乗を表す)のべき乗を計算する計算装置で実行される計算方法であって、前記s進数展開部が、べき指数qをs毎にs進数展開して
q=Σi=0 w−1qi×s^i (0≦qi<s)
となる各係数qiを求め、前記r進数展開部が、各係数qiをr進数展開してqi=Σj=0 h−1qij×r^j (0<r<s,−r<qij<r)
となる各係数qijを求め、前記べき乗計算部は、各係数qijを用いて、べき指数qの元のべき乗を計算し、前記r進数展開は、s進数展開後の係数q y ,q (y+1) (0≦y≦w−2)について、係数q (y+1) の値の一部のs倍を係数q y に加えて、各係数q y ,q (y+1) をr進数展開することを特徴とする。
In addition, the present invention includes an s-adic expansion unit, an r-adic expansion unit, and a power calculation unit, and a finite field element a (aεFp ^ m, m is a natural number, and '^' represents a power). In the calculation method executed by a computing device that calculates a power, the s-adic expansion unit expands a power exponent q for each s by s-adic and q = Σ i = 0 w−1 q i × s ^ i (0 ≦ q i <s)
Each coefficient q i is obtained, and the r-adic expansion unit expands each coefficient q i into an r-adic number to obtain q i = Σ j = 0 h−1 q ij × r ^ j (0 <r <s, − r <q ij <r)
Obtains the coefficients q ij to be, the power calculation unit, by using the coefficients q ij, the original power of the exponent q is computed should the r-adic expansion, coefficient after s-adic expansion q y, q for (y + 1) (0 ≦ y ≦ w-2), added s times of some of the values of the coefficients q (y + 1) to the coefficient q y, that each coefficient q y, q and (y + 1) expand r adic It is characterized by.
本発明によれば、有限体の拡大体において行うべき乗計算の計算量を削減可能になる。 According to the present invention, it is possible to reduce the amount of power calculation to be performed in a finite field expansion field.
以下に添付図面を参照して、この発明にかかる計算装置、方法及びプログラムの最良な実施の形態を詳細に説明する。 Exemplary embodiments of a computing device, a method, and a program according to the present invention will be described below in detail with reference to the accompanying drawings.
[第1の実施の形態]
(1)構成
まず、本実施の形態の計算装置のハードウェア構成について説明する。本実施の形態の計算装置は、装置全体を制御するCPU(Central Processing Unit)等の制御装置と、各種データや各種プログラムを記憶するROM(Read Only Memory)やRAM(Random Access Memory)等の記憶装置と、各種データや各種プログラムを記憶するHDD(Hard Disk Drive)やCD(Compact Disk)ドライブ装置等の外部記憶装置と、これらを接続するバスとを備えており、通常のコンピュータを利用したハードウェア構成となっている。また、計算装置には、情報を表示する表示装置と、ユーザの指示入力を受け付けるキーボードやマウス等の入力装置と、外部装置の通信を制御する通信I/F(interface)とが有線又は無線により各々接続される。このようなハードウェア構成において、計算装置の備えるCPUが記憶装置や外部記憶装置に記憶された各種プログラムを実行することにより実現される各種機能について説明する。図1は、計算装置の機能的構成を例示する図である。計算装置は、p進数展開部51と、r進数展開部52と、計算値記憶テーブル53と、第1計算部54と、第2計算部55とを有する。これらの各部は、CPUのプログラム実行時にRAMなどの記憶装置上に生成されるものである。計算値記憶テーブル53は、例えばHDDなどの外部記憶装置に記憶される。
[First embodiment]
(1) Configuration First, the hardware configuration of the computing device of this embodiment will be described. The computing device of this embodiment includes a control device such as a CPU (Central Processing Unit) that controls the entire device, and a storage such as a ROM (Read Only Memory) and a RAM (Random Access Memory) that store various data and various programs. Device, an external storage device such as an HDD (Hard Disk Drive) or a CD (Compact Disk) drive device for storing various data and various programs, and a bus for connecting them, and a hardware using an ordinary computer The hardware configuration. Also, the computing device includes a display device for displaying information, an input device such as a keyboard and a mouse for accepting user instruction input, and a communication I / F (interface) for controlling communication with an external device by wire or wirelessly. Each is connected. In such a hardware configuration, various functions realized by executing various programs stored in a storage device or an external storage device by a CPU included in the calculation device will be described. FIG. 1 is a diagram illustrating a functional configuration of a computing device. The calculation apparatus includes a p-
ここでまず、本実施の形態において利用する計算原理について説明する。有限体Fpの拡大体Fp^mの元であり、以下の式1で表される元bのべき乗b^pは、フロベニウス写像を用いると、式2により表される。
b=b0+b1×z+b2×z^2+b3z^3+・・・+b(m−1)×z^{m−1}・・・(1)
b^p=b0+b1z^p+b2z^{2p}+・・・+b(m−1)z^{p(m−1)}・・・(2)
これを以下の式3で表される2項式の法多項式gmで割ることにより、b^pを簡単に求めることができる。この場合はz^mを順次‘−α’で置き換えていけばよい。
gm(z)=z^{m}+α・・・(3)
First, the calculation principle used in this embodiment will be described. The power b ^ p of the element b, which is an element of the extension field Fp ^ m of the finite field Fp and expressed by the following
b = b 0 + b 1 × z +
b ^ p = b 0 + b 1 z ^ p + b 2 z ^ {2p} + ··· + b (m-1) z ^ {p (m-1)} ··· (2)
By dividing this by the binomial modulo polynomial g m expressed by the following
g m (z) = z ^ {m} + α (3)
例えば、べき乗する元として代数的トーラスの元を考える。代数的トーラスの元T6(Fp^m)はFp^m^6の部分群であるので、有限体の拡大体の元である。代数的トーラスの元の場合はFpの元の要素bnはp乗してもbnにはならないので、bn^pとしておく必要があることに注意が必要である。そして、このような元について、上述の手法を利用して高速にべき乗計算を行うことが可能となる。 For example, consider an algebraic torus element as a power element. Since the element T6 (Fp ^ m) of the algebraic torus is a subgroup of Fp ^ m ^ 6, it is an element of an extension field of a finite field. Note that in the case of an algebraic torus element, the original element b n of Fp does not become b n even if it is raised to the power of p, so it must be set as b n ^ p. And about such an element, it becomes possible to perform the exponentiation calculation at high speed using the above-mentioned method.
ここで、計算装置は、有限体の拡大体の元をa(a∈Fp^m)としてaのq乗を行うものとする説明する。p進数展開部51は、べき指数qをp進数展開する。べき指数qをp進数展開したものは、以下の式4により表される。
q=q0+q1×p+q2×p^2+・・・+q(w−1)×p^{w−1}・・・(4)
尚、qi(0≦i≦w−1)は係数であり、‘qi<p’である。
Here, it is assumed that the computing device performs a to the qth power with a (aεFp ^ m) as an element of an extension field of a finite field. The p-
q = q 0 + q 1 × p +
Note that q i (0 ≦ i ≦ w−1) is a coefficient, and “q i <p”.
r進数展開部52は、係数qiをr進数展開する。‘r=2’のとき、係数qiをr進数展開したものは、以下の式5により表される。
qi=qi0+qi1×2+qi2×2^2+・・・+qi(h−1)×2^{h−1}・・・(5)
The r-
q i = q i0 + q i1 × 2 + q i2 × 2 ^ 2 +... + q i (h−1) × 2 ^ {h−1} (5)
このとき、qij∈{0,1}(0≦i≦w−1,0≦j≦h−1)である。尚、ここでは簡単のため‘w=d×n’(wはdの倍数である)とする。dについては後述の計算値記憶テーブル53の説明において説明する。wがdの倍数とならない場合は、‘qw=0,q(w+1)=0,・・・’としてパディングすれば良い。 At this time, q ij ε {0, 1} (0 ≦ i ≦ w−1, 0 ≦ j ≦ h−1). Here, for simplicity, it is assumed that “w = d × n” (w is a multiple of d). d will be described later in the description of the calculated value storage table 53. If w is not a multiple of d, padding may be performed as 'q w = 0, q (w + 1) = 0, ...'.
図2は、元aのq乗であるa^qを視覚的に表現するために2次元の表形式で示した図である。同図においては、縦の列毎に、横の各行に示される2のべき乗の値を乗算した値が、係数qiを表している。一方、横の行毎に、縦の各列に示されるpのべき乗の値を乗算した値をSjとする。Sjは以下の式6により表される。
Sj=a^{q0j+q1j×p+q2j×p^2+・・・+q(w−1)j×p^{w−1}}・・・(6)
FIG. 2 is a diagram showing a two-dimensional table format for visually expressing a ^ q, which is the qth power of the element a. In the figure, for each vertical column, a value obtained by multiplying the power of 2 shown in each horizontal row represents the coefficient q i . On the other hand, for each horizontal row, a value obtained by multiplying the power value of p indicated in each vertical column is S j . S j is expressed by
S j = a ^ {q 0j + q 1j × p + q 2j × p ^ 2 + ··· + q (w-1) j × p ^ {w-1}} ··· (6)
第1計算部54は、計算値記憶テーブル53を参照して、各jについてSjを計算する。計算値記憶テーブル53は、Sjの値を計算するために用いるものであり、‘r=2’であるときのd個のビットの組み合わせ(b0、b1、b2、・・、b(d−1))全てについて、以下の式7により表されるT(k)の値を記憶したものである。
T(k)=a^{b0+b1×p+b2×p^2+b3×p^3+・・・+b(d−1)×p^{d−1}}・・・(7)
The
T (k) = a ^ {
尚、以降、dをwindow幅という。また、k∈{0,1}^dであり、kは、2進数表記でd個のビットの順序付き組み合わせを示すものとなる。ビットの順序付き組み合わせをビット列という。 Hereinafter, d is referred to as a window width. Further, kε {0,1} ^ d, and k represents an ordered combination of d bits in binary notation. An ordered combination of bits is called a bit string.
T(k)の値は予め計算(事前計算)されて計算値記憶テーブル53に記憶される。T(k)の事前計算においてa^pやa^{p^2}のべき乗計算を行う際には、フロベニウス写像を用いると容易に計算可能である。図3は、‘d=4’である場合の計算値記憶テーブル53を視覚的に示した図である。同図においては、p^0〜p^3について、(b0,b1,b2,b3)の全ての組み合わせのそれぞれに対応してT(k)が計算されていることが各々示されている。尚、この計算値記憶テーブル53においては、p^0〜p^3についての組み合わせに対応したT(k)の値しか記憶されていないが、p^4以降のd個のビットの組み合わせに対応する値については、T(k)の値を用いて容易に計算することができる。例えば、p^4〜p^7についての組み合わせに対応する各値は、p^0〜p^3の組み合わせについての組み合わせに対応するT(k)にp^4を各々乗算することにより求められ、p^4はフロベニウス写像を用いると容易に計算が可能である。従って、全てのSjの計算にT(k)を複数回適用することが可能であり、計算の高速化に大きく寄与する。 The value of T (k) is calculated (pre-calculated) in advance and stored in the calculated value storage table 53. When a power of a ^ p or a ^ {p ^ 2} is calculated in the prior calculation of T (k), it can be easily calculated by using the Frobenius map. FIG. 3 is a diagram visually showing the calculated value storage table 53 when “d = 4”. In the figure, it is shown that T (k) is calculated for each of all combinations of (b 0 , b 1 , b 2 , b 3 ) for p ^ 0 to p ^ 3. Has been. In this calculated value storage table 53, only the value of T (k) corresponding to the combination of p ^ 0 to p ^ 3 is stored, but it corresponds to the combination of d bits after p ^ 4. The value to be calculated can be easily calculated using the value of T (k). For example, each value corresponding to the combination of p ^ 4 to p ^ 7 is obtained by multiplying T (k) corresponding to the combination of p ^ 0 to p ^ 3 by p ^ 4, respectively. , P ^ 4 can be easily calculated using the Frobenius map. Therefore, it is possible to apply T (k) a plurality of times to all S j calculations, which greatly contributes to speeding up the calculation.
第1計算部54は、このT(k)の値を用い、各jについてSjを計算する。この結果、式6により表されるSjは、以下の式8により表される。
Sj=T(q(d−1)jq(d−2)j・・・q0j)×T(q(2d−1)jq(2d−2)j・・・qdj)^{p^d}×T(q(3d−1)jq(3d−2)j・・・q(2d)j)^{p^(2d)}×・・・×T(q(nd−1)jq(nd−2)j・・・q((n−1)d)j)^{p^{d(n−1)}}・・・(8)
The
S j = T (q (d -1) j q (d-2) j ··· q 0j) × T (q (2d-1) j q (2d-2) j ··· q dj) ^ { p ^ d} * T (q (3d-1) jq (3d-2) j ... q (2d) j ) ^ {p ^ (2d)} * ... * T (q (nd-1 ) J q (nd-2) j ... q ((n-1) d) j ) ^ {p ^ {d (n-1)}} (8)
そして、第1計算部54が全てのjについてSjを計算すると、第2計算部55は、各Sjを用いて、以下の式9により、aのq乗を計算する。
S=a^q=(((((S(h−1))^2×S(h−2))^2×S(h−3))^2×・・・)^2×S1)^2×S0・・・(9)
When the
S = a ^ q = (( (((S (h-1)) ^ 2 × S (h-2)) ^ 2 × S (h-3)) ^ 2 × ···) ^ 2 × S 1 ) ^ 2 × S 0 (9)
(2)動作
次に、本実施の形態にかかる計算装置の行うべき乗計算処理の手順について図4を用いて説明する。尚、ここでは、計算装置は、有限体の拡大体の元a(a∈Fp^m)のq乗を行うものとする。計算装置は、べき指数qをp進数展開する(ステップS1)。図5は、p進数展開の処理の詳細な手順を示すフローチャートである。計算装置は、まず、‘i=0’、‘t0=q’として(ステップS10)、係数qiを‘qi=timod p’として求め、‘ti+1=ti/p’ を求める(ステップS11)。次いで、計算装置は、iをインクリメントして、‘i=i+1’とし(ステップS12)、次いで、‘ti=0’か否かを判断する(ステップS13)。ステップS13の判断結果が否定的である場合、ステップS11に進み、ステップS13の判断結果が肯定的である場合、処理を終了する。以上のようにして、‘qi<p’である係数qiを全てのi(0≦i≦w−1)について求めて、上述の式4により表されるように、べき指数qをp進数展開する。
(2) Operation Next, a procedure of power calculation processing to be performed by the calculation apparatus according to the present embodiment will be described with reference to FIG. Here, it is assumed that the computing device performs the qth power of the element a (aεFp ^ m) of the finite field expansion field. The computing device expands the power exponent q into p-adic numbers (step S1). FIG. 5 is a flowchart showing a detailed procedure of p-adic number expansion processing. First, the computing device sets 'i = 0' and 't 0 = q' (step S10), obtains the coefficient q i as 'q i = t i mod p', and sets 't i + 1 = t i / p'. Obtained (step S11). Next, the computing device increments i to 'i = i + 1' (step S12), and then determines whether 't i = 0' (step S13). If the determination result of step S13 is negative, the process proceeds to step S11. If the determination result of step S13 is positive, the process ends. As described above, the coefficient q i satisfying “q i <p” is obtained for all i (0 ≦ i ≦ w−1), and the exponent q is expressed by p as expressed by the above-described
図4に戻り、次いで、計算装置は、係数qiをr進数展開する。(ステップS2)。図6は、r進数展開の処理の詳細な手順を示すフローチャートである。計算装置は、まず、‘j=0’、‘t0=qi’として(ステップS20)、係数qiを‘qij=timod r’として求め、‘ti+1=ti/r’を求める(ステップS21)。次いで、計算装置は、jをインクリメントして、‘j=j+1’とし(ステップS22)、次いで、‘tj=0’か否かを判断する(ステップS23)。ステップS23の判断結果が否定的である場合、ステップS21に進み、ステップS23の判断結果が肯定的である場合、処理を終了する。以上のようにして、係数qiについて、qij∈{0,1,・・・,r−1}である係数qijを全てのj(0≦j≦h−1)について求める。‘r=2’のとき、係数qiをr進数展開したものは、上述の式5により表される。計算装置は、全てのi(0≦i≦w−1)について係数qiに対する係数qijを求める。
Returning to FIG. 4, the computing device then expands the coefficient q i in r-adic. (Step S2). FIG. 6 is a flowchart showing a detailed procedure of r-adic expansion processing. First, the computing device obtains the coefficient q i as “q ij = t i mod r” by setting “j = 0” and “t 0 = q i ” (step S20), and “t i + 1 = t i / r”. Is obtained (step S21). Next, the computing device increments j to “j = j + 1” (step S22), and then determines whether or not “t j = 0” (step S23). If the determination result of step S23 is negative, the process proceeds to step S21. If the determination result of step S23 is positive, the process ends. As described above, the coefficient q i, q ij ∈ {0,1 , ···, r-1} obtained for all j the coefficients q ij is (0 ≦ j ≦ h-1 ). When 'r = 2', the coefficient q i expanded in r notation is expressed by the above-described
図4に戻り、次いで、計算装置は、計算値記憶テーブル53を参照して、係数qijにおける同一のjに対して積を計算したSjを求める(ステップS3)。図7は、Sjを計算する処理の詳細な手順を示すフローチャートである。計算装置は、まず、Sjを単位元として‘Sj=1’とし、‘l=0’とし(ステップS30)、‘v=d−1’とする(ステップS31)。次いで、計算装置は、‘k=0’とし(ステップS32)、新たなkの値として‘k=k+q(l×d+v)j×2^v’を求める(ステップS33)。dは、上述のwindow幅である。次いで、計算装置は、‘v=v−1’とし(ステップS34)、‘v=0’か否かを判断する(ステップS35)。ステップS35の判断結果が否定的である場合、ステップS33に進む。ステップS35の判断結果が肯定的である場合、計算装置は、ステップS33で求めたkの値を用いて、計算値記憶テーブル53に記憶されたT(k)の値を参照して、Sjの値を‘Sj=Sj×T(k)^(l×d)’として求める(ステップS36)。そして、計算装置は、lをインクリメントして‘l=l+1’とし(ステップS37)、‘l=n’か否かを判断する(ステップS38)。‘n=w/d’である。ステップS38の判断結果が否定的である場合、ステップS31に進み、ステップS38の判断結果が肯定的である場合、処理を終了する。以上のようにして、計算装置は、計算値記憶テーブル53を参照して各T(k)の値を取得し、T(k)を用いて乗算及びべき乗計算を行うことにより、Sjを求める。 Returning to FIG. 4, the calculation device then refers to the calculated value storage table 53 and obtains S j obtained by calculating the product for the same j in the coefficient q ij (step S < b> 3). FIG. 7 is a flowchart showing a detailed procedure of a process for calculating S j . First, the computing device sets S j as a unit element to “S j = 1”, “l = 0” (step S30), and “v = d−1” (step S31). Next, the computing device sets “k = 0” (step S32), and obtains “k = k + q (1 × d + v) j × 2 ^ v” as a new value of k (step S33). d is the window width described above. Next, the computing device sets “v = v−1” (step S34), and determines whether “v = 0” (step S35). If the determination result of step S35 is negative, the process proceeds to step S33. When the determination result of step S35 is affirmative, the calculation device refers to the value of T (k) stored in the calculation value storage table 53 using the value of k obtained in step S33, and performs the calculation of S j Is obtained as 'S j = S j × T (k) ^ (l × d)' (step S36). Then, the computing device increments l to “l = 1 + 1” (step S37), and determines whether “l = n” (step S38). 'n = w / d'. If the determination result in step S38 is negative, the process proceeds to step S31. If the determination result in step S38 is positive, the process ends. As described above, the calculation apparatus obtains the value of each T (k) with reference to the calculation value storage table 53, and performs the multiplication and power calculation using T (k), thereby obtaining S j . .
図8は、a^qを示した図2の表において、図3に示した計算値記憶テーブル53に記憶されるT(k)を用いて求められた各Sjを模式的に示した図である。同図に示されるように、各jについて、pに対して4個ずつ連続するべき指数の組み合わせについて、その積がT(k)を用いて計算されていることが示されている。 FIG. 8 is a diagram schematically showing each S j obtained using T (k) stored in the calculated value storage table 53 shown in FIG. 3 in the table of FIG. 2 showing a ^ q. It is. As shown in the figure, for each j, the product of the combinations of exponents to be consecutive with respect to p by 4 is calculated using T (k).
そして、全てのjについてSjを計算すると、図4に戻り、計算装置は各Sjを用いて、上述の式9によりaのq乗を計算する(ステップS4)。図9は、aのq乗であるSを計算する処理の詳細な手順を示すフローチャートである。計算装置は、まず、‘p<r^v’なる最小のvの値を求め(ステップS40)、次いで、‘S=Sv−1’とし、‘v=v−1’とする(ステップS41)。更に、計算装置は、‘v=v−1’とし(ステップS42)、‘S=S^{r}×Sv’とする(ステップS43)。次いで、計算装置は、‘v>0‘であるか否かを判断し(ステップS44)、当該判断結果が肯定的である場合、ステップS42に進む。ステップS44の判断結果が否定的である場合、計算装置は処理を終了する。以上のようにして、計算装置は、ステップS3で求めたSjを用いてべき乗計算及び乗算を行って、aのq乗を求める。
Then, when S j is calculated for all j, the processing returns to FIG. 4 and the calculation device calculates a to the qth power by the above-described
次に、計算装置が、上述したべき乗計算を行う前に、計算値記憶テーブル53に記憶されるT(k)の値を事前計算する処理の手順について図10を用いて説明する。計算装置は、まず、単位元として‘T(0)=1’として、‘T(1)=a’とし(ステップS50)、‘k=102’とする(ステップS51)。‘102’は二進数表記で‘1’と‘0’との順序付き組み合わせを示すビット列である。次いで、計算装置は、‘k mod 2=1’か否かを判断する(ステップS52)。ステップS52の判断結果が否定的である場合、計算装置は、‘T(k)=T(k/2)^p’とし(ステップS53)、ステップS52の判断結果が肯定的である場合、‘T(k)=T((k−1)/2)^p×a’とする(ステップS54)。
Next, a procedure of processing in which the calculation device pre-calculates the value of T (k) stored in the calculated value storage table 53 before performing the above power calculation will be described with reference to FIG. First, the computing device sets “T (0) = 1” as a unit element, sets “T (1) = a” (step S50), and sets “k = 10 2 ” (step S51). “10 2 ” is a bit string indicating an ordered combination of “1” and “0” in binary notation. Next, the computing device determines whether or not “
ここでは、計算装置はフロベニウス写像を用いてT(k)を求める。例えば、‘d=4’の場合、以下の式10〜11が成り立つ。
T(1102)=T(11002)^p・・・(10)
T(11102)=T(1102)×a・・・(11)
このため、T(k)の値の全てを乗算のみで求める必要はない。従って、計算装置は、ステップS53又はステップS54では、既に求められたT(k/2)やT((k−1)/2)の値を用いて新たなT(k)の値を求めることにより、各T(k)の値を高速に求めることができる。
Here, the calculation device obtains T (k) using the Frobenius map. For example, in the case of “d = 4”, the following
T (110 2 ) = T (1100 2 ) ^ p (10)
T (1110 2 ) = T (110 2 ) × a (11)
For this reason, it is not necessary to obtain all the values of T (k) only by multiplication. Accordingly, in step S53 or step S54, the computing device obtains a new value of T (k) using the values of T (k / 2) and T ((k-1) / 2) that have already been obtained. Thus, the value of each T (k) can be obtained at high speed.
その後、その後いずれの場合もステップS55に進み、計算装置は、‘k=k+1’とし(ステップS55)、次いで、‘k<2^d’か否かを判断する(ステップS56)。ステップS56の判断結果が肯定的である場合、ステップS52に進み、ステップS56の判断結果が否定的である場合、計算装置は、処理を終了する。以上のようにして、計算装置は、window幅dに対してd個のビットの全ての組み合わせについて、T(k)を求めてこれを計算値記憶テーブル53に記憶させる。 Thereafter, in either case, the process proceeds to step S55, where the computing device sets ‘k = k + 1’ (step S55), and then determines whether ‘k <2 ^ d’ (step S56). When the determination result of step S56 is affirmative, the process proceeds to step S52, and when the determination result of step S56 is negative, the computing device ends the process. As described above, the calculation apparatus obtains T (k) for all combinations of d bits with respect to the window width d and stores them in the calculated value storage table 53.
以上のようにして、ある特殊な場合の有限体の拡大体のp乗はフロベニウス写像を高速に計算できることを利用して、べき指数qを標数pでp進数展開し、p進数展開後の各係数qiについてr進数展開する。そして、d個のビットの全ての組み合わせについてべき乗計算の値を事前計算して記憶させ、記憶した値を用いて、Sjを計算することにより、計算量を削減することが可能になる。このようなべき乗計算の方法は、例えば、公開鍵暗号に用いて好適である。 As described above, the p-th power of an extension field of a finite field in a special case can be obtained by calculating the Frobenius map at high speed, expanding the power exponent q in p-adic with characteristic p, An r-adic expansion is performed for each coefficient q i . Then, it is possible to reduce the amount of calculation by pre-calculating and storing a power calculation value for all combinations of d bits and calculating S j using the stored value. Such a power calculation method is suitable, for example, for public key cryptography.
[第2の実施の形態]
次に、計算装置の第2の実施の形態について説明する。なお、上述の第1の実施の形態と共通する部分については、同一の符号を使用して説明したり、説明を省略したりする。
[Second Embodiment]
Next, a second embodiment of the computing device will be described. In addition, about the part which is common in the above-mentioned 1st Embodiment, it demonstrates using the same code | symbol or abbreviate | omits description.
(1)構成
計算装置の有するp進数展開部51及びr進数展開部52の構成は上述の第1の実施の形態と同様である。計算値記憶テーブル53の作成方法及び第1計算部54の構成は上述の第1の実施の形態と異なる。上述の第1の実施の形態においては、T(k)の値を予め計算して計算値記憶テーブル53に記憶させることにより計算値記憶テーブル53を予め作成し、第1計算部54は、当該計算値記憶テーブル53を参照して、Sjを計算した。本実施の形態においては、T(k)の値を事前に計算するのではなく、第1計算部54がSjを計算する過程で、T(k)の値を随時求めてこの値を計算値記憶テーブル53に随時記憶させることにより計算値記憶テーブル53を作成しながら、各jについてSjを計算する。尚、上述の第1の実施の形態に係るT(k)と区別するため、以降、T’(k)と表記する。
(1) Configuration The configurations of the p-
(2)動作
次に、本実施の形態にかかる計算装置の行うべき乗計算処理の手順について図11を用いて説明する。ステップS1〜S2は上述の第1の実施の形態と同様である。ステップS3´では、計算装置は、計算値記憶テーブル53を作成しながら、各jについてSjを計算する。図12は、ステップS3´の処理の詳細な手順を示すフローチャートである。なお、ここではbは最大長さwのビット列であり、bには左から順に下位のビットが保存され、‘b=b||{0}’であるとする(||はビットの連結)。計算装置は、まず、‘T’(1)=a’とし、‘t=0’とし、‘Sj=1’とする(ステップS60)。次いで、計算装置は、‘qtj=1’であるか否かを判断し(ステップS61)、当該判断結果が肯定的である場合(ステップS61:YES)、‘b=1’とし、‘s=t’とする(ステップS62)。そして、計算装置は、‘t=t+1’とし(ステップS63)、次いで、‘t<w’であるか否かを判断する(ステップS64)。当該判断結果が肯定的である場合(ステップS64:YES)、計算装置は、‘qtj=1’であるか否かを判断する(ステップS65)。当該判断結果が肯定的である場合(ステップS65:YES)、計算装置は、T’(b||1)が計算値記憶テーブル53に記憶されているか否かを判断する(ステップS66)。当該判断結果が否定的である場合(ステップS66:NO)、計算装置は、以下の式12によりT’(b||1)を計算して、これを計算値記憶テーブル53に記憶させる(ステップS67)。
T’(b||1)=T’(b)×a^{p^(t−s)}・・・(12)
次いで、計算装置は、以下の式13によりSjを計算する(ステップS68)。
Sj=Sj×T’(b||1)^{p^s}・・・(13)
そして、計算装置は、tをインクリメントして‘t=t+1’とし(ステップS71)、次いで、‘t<w’であるか否かを判断する(ステップS72)。当該判断結果が肯定的である場合、ステップS61に戻る。ステップS72の判断結果が否定的である場合、処理を終了する。
(2) Operation Next, a procedure of power calculation processing performed by the calculation apparatus according to the present embodiment will be described with reference to FIG. Steps S1 and S2 are the same as those in the first embodiment. In step S3 ′, the calculation device calculates S j for each j while creating the calculated value storage table 53. FIG. 12 is a flowchart showing a detailed procedure of the process in step S3 ′. Here, b is a bit string of the maximum length w, and lower bits are stored in b sequentially from the left, and 'b = b || {0}' (|| is a concatenation of bits). . First, the computing device sets “T” (1) = a ”,“ t = 0 ”, and“ S j = 1 ”(step S60). Next, the computing device determines whether or not “q tj = 1” (step S61). If the determination result is affirmative (step S61: YES), “b = 1” and “s = T '(step S62). Then, the computing device sets “t = t + 1” (step S63), and then determines whether or not “t <w” (step S64). If the determination result is affirmative (step S64: YES), the computing device determines whether or not “q tj = 1” (step S65). If the determination result is affirmative (step S65: YES), the calculation apparatus determines whether T ′ (b || 1) is stored in the calculated value storage table 53 (step S66). When the determination result is negative (step S66: NO), the calculation device calculates T ′ (b || 1) by the following expression 12 and stores it in the calculated value storage table 53 (step) S67).
T ′ (b || 1) = T ′ (b) × a ^ {p ^ (ts)} (12)
Next, the calculation device calculates S j by the following equation 13 (step S68).
S j = S j × T ′ (b || 1) ^ {p ^ s} (13)
The computing device increments t to “t = t + 1” (step S71), and then determines whether or not “t <w” (step S72). If the determination result is affirmative, the process returns to step S61. If the determination result of step S72 is negative, the process ends.
ステップS66の判断結果が肯定的である場合、計算装置は、‘b=b||qtj’とすることによりビットqtjをbに連結し(ステップS70)、上述のステップS63に進む。即ち、‘qtj=0’である場合は、次に対象となるビット列についての処理に移る。 If the determination result in step S66 is affirmative, the computing device concatenates the bit q tj to b by setting 'b = b || q tj ' (step S70), and proceeds to step S63 described above. That is, when 'q tj = 0', the process proceeds to the next bit string to be processed.
ステップS64の判断結果が否定的である場合、計算装置は、以下の式13によりSjを計算して(ステップS69)、処理を終了する。
Sj=Sj×T’(b||1)^{p^s}・・・(13)
When the determination result of step S64 is negative, the calculation apparatus calculates S j by the following expression 13 (step S69) and ends the process.
S j = S j × T ′ (b || 1) ^ {p ^ s} (13)
以上のようにして、計算装置は、ステップS3´で全てのjについてSjを計算すると、ステップS4で上述の第1の実施の形態と同様にして、aのq乗を計算する。 As described above, when the calculation device calculates S j for all j in step S3 ′, the calculation device calculates a to the qth power in the same manner as in the first embodiment described above in step S4.
以上のように、各Sjを計算する過程で求められたT’(k)の値を再利用して新たなT’(k)の計算値記憶テーブル53に随時記憶させることにより、事前計算を行う必要がなく、aのq乗を高速に計算することが可能になる。 As described above, the value of T ′ (k) obtained in the process of calculating each S j is reused and stored in the new T ′ (k) calculated value storage table 53 as needed, so that the prior calculation is performed. It is possible to calculate a to the qth power at high speed.
[第3の実施の形態]
次に、計算装置の第3の実施の形態について説明する。なお、上述の第1の実施の形態又は第2の実施の形態と共通する部分については、同一の符号を使用して説明したり、説明を省略したりする。
[Third embodiment]
Next, a third embodiment of the computing device will be described. In addition, about the part which is common in the above-mentioned 1st Embodiment or 2nd Embodiment, it demonstrates using the same code | symbol or abbreviate | omits description.
本実施の形態においてはSliding Window法と同様の概念を利用する。この場合、先頭の値が‘0’とならないようにd個のビットの組み合わせを選択する。dは上述のwindow幅である。なぜなら、べき指数における係数qijの値が‘0’である場合、当該係数との乗算の結果は‘0’であるため、乗算の必要がないからである。このため、‘0’が先頭となる場合にはこの値をスキップして先頭が‘1’となるビットの組み合わせを選択することにより、Sjを計算する際にT(k)を用いる個数nを‘w/d’より小さくすることが可能になり、さらに計算量を削減することが可能になる。 In the present embodiment, the same concept as the sliding window method is used. In this case, a combination of d bits is selected so that the leading value does not become “0”. d is the window width described above. This is because when the value of the coefficient q ij in the power exponent is “0”, the result of multiplication with the coefficient is “0”, so there is no need for multiplication. For this reason, when “0” is at the head, this value is skipped and a combination of bits with the head at “1” is selected, whereby the number n using T (k) when calculating S j Can be made smaller than 'w / d', and the amount of calculation can be further reduced.
本実施の形態にかかるべき乗計算処理全体の手順は図4に示したとおりであり、第1の実施の形態と同様である。本実施の形態においては、ステップS3におけるSjを計算する処理の詳細な手順が第1の実施の形態と異なる。図13は、本実施の形態においてSjを計算する処理の詳細な手順を示すフローチャートである。計算装置は、まず、Sjを単位元として‘Sj=1’とし、‘l=0’とし(ステップS80)、次いで、‘qij=0’か否かを判断する(ステップS81)。当該判断結果が否定的である場合、計算装置は、‘t=1’とし、‘k=1’とし(ステップS82)、次いで、新たなkの値として‘k=k+q(l+t)j×2^t’を求める(ステップS83)。次いで、計算装置は、‘t=t+1’とし(ステップS84)、‘l+t=n’か否かを判断する(ステップS85)。ステップS85の判断結果が肯定的である場合、ステップS87に進み、ステップS85の判断結果が否定的である場合、計算装置は、次いで、‘t=d’か否かを判断する(ステップS86)。ステップS86の判断結果が肯定的である場合、ステップS83に進み、ステップS86の判断結果が否定的である場合、ステップS87に進む。ステップS87では、計算装置は、ステップS83で求めたkの値を用いて、計算値記憶テーブル53に記憶されたT(k)の値を参照して、Sjの値を‘Sj=Sj×T(k)^l’として求める(ステップS87)。そして、計算装置は、‘l=l+d’とし(ステップS88)、‘l<n’か否かを判断する(ステップS89)。‘n=w/d’である。ステップS89の判断結果が否定的である場合、ステップS81に進み、ステップS89の判断結果が肯定的である場合、処理を終了する。また、ステップS81の判断結果が肯定的である場合、計算装置は、‘l=l+1’として(ステップS90)、ステップS81に進む。以上のようにして、計算装置は、T(k)を用いる際のビット列について、先頭の値が‘0’とならないようにd個のビットの組み合わせを選択し、選択したビット列に対応するT(k)の値を計算値記憶テーブル53において参照して、Sjを求める。 The procedure of the whole power calculation process according to the present embodiment is as shown in FIG. 4 and is the same as that of the first embodiment. In the present embodiment, the detailed procedure of the process of calculating S j in step S3 is different from that of the first embodiment. FIG. 13 is a flowchart showing a detailed procedure of the process of calculating S j in the present embodiment. First, the computing device sets “S j = 1” and “l = 0” using S j as a unit element (step S80), and then determines whether “q ij = 0” (step S81). When the determination result is negative, the computing device sets “t = 1”, sets “k = 1” (step S82), and then sets “k = k + q (l + t) j × 2 as a new value of k. ^ T 'is obtained (step S83). Next, the computing device sets “t = t + 1” (step S84), and determines whether or not “l + t = n” (step S85). If the determination result in step S85 is affirmative, the process proceeds to step S87. If the determination result in step S85 is negative, the calculation device then determines whether or not 't = d' (step S86). . If the determination result of step S86 is affirmative, the process proceeds to step S83, and if the determination result of step S86 is negative, the process proceeds to step S87. In step S87, the computing device, using the value of k obtained in step S83, the with reference to the value of the calculated value storage table 53 in the stored T (k), S the value of j 'S j = S It is obtained as j × T (k) ^ l ′ (step S87). Then, the computing device sets “l = l + d” (step S88), and determines whether “l <n” (step S89). 'n = w / d'. If the determination result in step S89 is negative, the process proceeds to step S81. If the determination result in step S89 is affirmative, the process ends. If the determination result in step S81 is affirmative, the computing device sets “l = 1 + 1” (step S90) and proceeds to step S81. As described above, the computing device selects a combination of d bits so that the leading value does not become “0” for the bit string when using T (k), and T (corresponding to the selected bit string). The value of k) is referred to in the calculated value storage table 53, and S j is obtained.
図14は、a^qを示した図2の表において、図3に示した計算値記憶テーブル53に記憶されるT(k)を用いて求められた各Sjを模式的に示した図である。同図に示されるように、各jについて、pに対して4個ずつ連続するべき指数の組み合わせについて先頭が‘0’にならない4個のビットの組み合わせが選択され、その組み合わせに対応するT(k)を用いて計算されていることが示されている。 FIG. 14 is a diagram schematically showing each S j obtained by using T (k) stored in the calculated value storage table 53 shown in FIG. 3 in the table of FIG. 2 showing a ^ q. It is. As shown in the figure, for each j, a combination of four bits that does not start with “0” is selected for a combination of exponents that should be consecutive four for p, and T ( k).
次に、計算装置が、上述のべき乗計算を行う前に、計算値記憶テーブル53に記憶されるT(k)の値を事前計算する処理の手順について図15を用いて説明する。計算装置は、まず、‘T(1)=a’とし(ステップS100)、‘k=112’とする(ステップS101)。次いで、計算装置は、‘T(k)=T((k−1)/2)^p×a’とする(ステップS102)。その後、計算装置は、‘k=k+2’とし(ステップS103)、次いで、‘k<2^d’か否かを判断する(ステップS104)。ステップS104の判断結果が肯定的である場合、ステップS102に進み、ステップS104の判断結果が否定的である場合、計算装置は、処理を終了する。以上のようにして、計算装置は、d個のビットの組み合わせのうち、先頭のビットが‘0’でない組み合わせについてT(k)を求めてこれを計算値記憶テーブル53に記憶させる。 Next, a procedure of processing for precalculating the value of T (k) stored in the calculated value storage table 53 before the calculation device performs the above power calculation will be described with reference to FIG. Computing device, first, a 'T (1) = a' ( step S100), and 'k = 11 2' (step S101). Next, the computing device sets “T (k) = T ((k−1) / 2) ^ p × a” (step S102). Thereafter, the computing device sets “k = k + 2” (step S103), and then determines whether or not “k <2 ^ d” (step S104). When the determination result of step S104 is affirmative, the process proceeds to step S102, and when the determination result of step S104 is negative, the calculation apparatus ends the process. As described above, the calculation apparatus obtains T (k) for a combination whose leading bit is not “0” among the combinations of d bits, and stores this in the calculated value storage table 53.
以上のような構成によれば、計算装置が有限体の拡大体において行うべき乗計算の計算量をより効果的に削減することができる。 According to the configuration as described above, it is possible to more effectively reduce the amount of calculation of the power calculation performed by the computing device in the finite field expansion field.
[第4の実施の形態]
次に、計算装置の第4の実施の形態について説明する。なお、上述の第1の実施の形態乃至第3の実施の形態と共通する部分については、同一の符号を使用して説明したり、説明を省略したりする。
[Fourth embodiment]
Next, a fourth embodiment of the computing device will be described. In addition, about the part which is common in the above-mentioned 1st Embodiment thru | or 3rd Embodiment, it demonstrates using the same code | symbol or abbreviate | omits description.
(1)構成
本実施の形態においては、計算装置のr進数展開部52は、p進展開後の係数qy,qy+1(0≦y≦w−2)について、係数qy+1の下位数ビット分を係数qyの項に振り分ける、即ち、係数qy+1の値の一部のp倍を係数qyに加えて、係数qy,qy+1をr進数展開する。
(1) Configuration In this embodiment, the r-
pが‘p≠r^n(r^{n−1}≦p<r^n、nは自然数)’を満たす場合、qをp進数展開した後の係数qi(式4参照)は、‘qi<r^n’を満たしている。ここで、便宜上、‘r=2’として説明を進める。‘r≠2’の場合でも概念としては同じである。例えば、‘p=9’、‘q=48’とする。このとき、qをp進数展開すると、以下の式15が成り立つ。
q=q0+q1×p=3+5×9(=3×p^0+5×p^1)・・・(15)
このとき、‘q0=3’,‘q1=5’である。このq0、q1を2進表記で各々表すと、‘q0=(112)’、‘q1=(1012)’となる。‘qi<p’のため、‘11=(10112)’や‘14=(11102)’などとなるqiは通常存在しない。ここではqiの表現として(11102)などの、‘qi≧p’となる表現をあえて許すことにより、係数qiの表現の幅を持たせ、結果的に計算回数が少なくなるように係数qiの表現を選択することにより、係数qiをr進数展開する。
When p satisfies 'p ≠ r ^ n (r ^ {n-1} ≦ p <r ^ n, n is a natural number)', a coefficient q i (see Equation 4) after q is expanded to a p-adic number is “q i <r ^ n” is satisfied. Here, for the sake of convenience, the description will be made assuming that “r = 2”. Even when “r ≠ 2”, the concept is the same. For example, 'p = 9' and 'q = 48'. At this time, when q is expanded to the p-adic number, the following Expression 15 is established.
q = q 0 + q 1 × p = 3 + 5 × 9 (= 3 × p ^ 0 + 5 × p ^ 1) (15)
At this time, 'q 0 = 3' and 'q 1 = 5'. When q 0 and q 1 are expressed in binary notation, respectively, “q 0 = (11 2 )” and “q 1 = (101 2 )” are obtained. Since 'q i <p', there is usually no q i such as '11 = (1011 2 ) 'or '14 = (1110 2 )'. Here, the expression of q i , such as (1110 2 ), is allowed to be expressed as “q i ≧ p”, so that the range of expression of the coefficient q i is increased, and as a result, the number of calculations is reduced. by selecting the representation of the coefficients q i, the coefficient q i expand r Decimal.
上記の例では‘q0=12=(11002)’、‘q1=4=(1002)’としても、‘q=q0×p^0+q1×p^1’は満たされる上、ビット長の増加もない。図16は、‘i=4’、‘r=2’及び‘h=14’のとき、係数q4,q5について、係数q5を2進数展開したときの係数q5(0)が‘1’である場合のa^qを2次元の表形式で示した図である。同図においては、係数q4を2進数展開したときの係数q4(0), q4(13)は各々‘0’である。図17は、図4における係数q5(0)を係数q4の係数に振り分け、係数q4(0), q4(13)を各々‘1’にし、係数q5(0)を‘0’にした状態を示す図である。このように、係数qi+1の値の一部のp倍を係数qiに加えても、a^pの計算結果は、図16に示した場合と図17に示した場合とで同じである。このような計算原理を利用して、本実施の形態においては、r進数展開部52は、p進数展開後の係数qiについて、‘1’の出現頻度を減らせる場合に限り‘qi≧p’となるよう係数qiを最適化して、r進数展開する。
In the above example, even if 'q 0 = 12 = (1100 2 )' and 'q 1 = 4 = (100 2 )', 'q = q 0 × p ^ 0 + q 1 × p ^ 1' is satisfied, There is no increase in bit length. 16, 'i = 4', when the 'r = 2' and 'h = 14', the
図18は、本実施の形態にかかる係数最適化処理の手順を示すフローチャートである。計算装置は、‘k=0’とし(ステップS110)、‘qk+p<r^n’であるか否かを判断する(ステップS111)。当該判断結果が肯定的である場合、計算装置は、‘q(k+1)0=1’であるか否かを判断する(ステップS112)。当該判断結果が肯定的である場合、次いで、計算装置は、qkの場合に‘1’が出現する個数と、‘qk+p’の場合に‘1’が出現する個数とを比較し、前者が後者以上であるか否かを判断する(ステップS113)。即ち、‘qk+p’とすることにより、qkの場合と比べて‘1’が出現する個数が増えるか否かを計算装置は判断する。そして、ステップS113の判断結果が肯定的である場合、即ち、‘1’が出現する個数が増えない場合、計算装置は、‘qk=qk+p’とし、‘q(k+1)0=q(k+1)0−1’とし(ステップS114)、ステップS115に進む。ステップS111,S112又はS113の判断結果が否定的である場合も、ステップS115に進む。ステップS115では、計算装置は、kをインクリメントして‘k=k+1’とする。そして、計算装置は、‘k<n’か否かを判断する(ステップS116)。ステップS116の判断結果が肯定的である場合、ステップS111に進み、ステップS116の判断結果が否定的である場合、当該係数最適化処理を終了する。このように、‘qk+p’とすることにより、qkの場合と比べて‘1’が出現する個数が増えない場合には、計算装置は、‘qk=qk+p’として、各qijを計算し直す。以上のようにして、計算装置は、‘qi+p<r^n’且つ‘q(i+1)0=1’となるiを検索して、係数qiを最適化する。 FIG. 18 is a flowchart showing a procedure of coefficient optimization processing according to the present embodiment. The computing device sets 'k = 0' (step S110), and determines whether or not 'q k + p <r ^ n' (step S111). If the determination result is affirmative, the computing device determines whether or not 'q (k + 1) 0 = 1' (step S112). If the determination result is positive, then the computing device compares the number and the number of '1' appears in the case of q k, which is the case of 'q k + p''1' appears, It is determined whether the former is greater than or equal to the latter (step S113). That is, by setting “q k + p”, the calculation device determines whether the number of occurrences of “1” increases as compared to the case of q k . If the determination result in step S113 is affirmative, that is, if the number of occurrences of “1” does not increase, the computing device sets “q k = q k + p”, and “q (k + 1) 0 = q (K + 1) 0 −1 ′ is set (step S114), and the process proceeds to step S115. If the determination result in step S111, S112 or S113 is negative, the process proceeds to step S115. In step S115, the computing device increments k to “k = k + 1”. Then, the computing device determines whether or not “k <n” (step S116). If the determination result in step S116 is affirmative, the process proceeds to step S111. If the determination result in step S116 is negative, the coefficient optimization process ends. As described above, when the number of occurrences of “1” does not increase by setting “q k + p” as compared with the case of q k , the calculation device sets each of “q k = q k + p” as Recalculate q ij . As described above, the computing device searches for i where 'q i + p <r ^ n' and 'q (i + 1) 0 = 1', and optimizes the coefficient q i .
以上の最適化処理の後、計算装置は、上述の第1の実施の形態又は第2の実施の形態において説明したステップS2以降の処理を行えば良い。このような本実施の形態における構成を第1の実施の形態や第2の実施の形態と組み合わせた場合、計算値記憶テーブル53を参照する際のWindow幅の先頭又は後尾に存在する‘1’を‘0’に変換できると、‘1’の出現頻度を減らして乗算の回数を削減できる可能性が高い。このため、Window幅の先頭又は後尾になり易い係数qdや係数q(2d)に注目すると高い効果が期待できる。従って、本実施の形態における構成によって、p進数展開及びr進数展開後のビットの配列をべき指数の値を変えずに計算量が少なくなるよう最適化することで、効果的に計算量を削減することが可能になる。 After the above optimization processing, the computing device may perform the processing after step S2 described in the first embodiment or the second embodiment. When such a configuration in the present embodiment is combined with the first embodiment or the second embodiment, '1' existing at the head or tail of the window width when referring to the calculated value storage table 53 Can be converted to '0', there is a high possibility that the number of multiplications can be reduced by reducing the appearance frequency of '1'. Therefore, when attention is paid to easily coefficient becomes the first or tail of the Window width q d and coefficient q (2d) can be expected more effective. Therefore, the configuration in this embodiment optimizes the bit arrangement after p-adic expansion and r-adic expansion so as to reduce the calculation amount without changing the exponent value, thereby effectively reducing the calculation amount. It becomes possible to do.
尚、上述においてはビット長を増やさないよう処理を行うように構成したが、ビット長の増加を許せば、‘(q0,q1)=(21,3),(30,2),(39,1)’等も表現としては取り得る。 In the above description, the processing is performed so as not to increase the bit length. However, if the increase in the bit length is allowed, '(q 0 , q 1 ) = (21, 3), (30, 2), ( 39,1) 'etc. can also be taken as expressions.
他の例として、‘p=19’,‘q=216’である場合について説明する。このとき、‘q=7+11×19’なので‘(q0,q1)=(7,11)’であるが、‘(q0,q1)=(64,8)’とすると、係数として‘1’が出現する個数は6個から2個に減少する。しかしながらpは5ビットで表現できるのに対して、q0を表現するのに7ビット必要となる。このため、このように表現を変換した場合、表現を変換する前に比べて、第1の実施の形態におけるステップ5の処理を2回多く繰り返す必要がある。しかし、最終的な目的はべき乗計算処理全体の処理量を削減することであるから、このような変換を複数回行って、全体として乗算の回数が削減できるように制御できれば良い。‘(q0,q1)=(64,8)’とした場合には、べき乗計算処理全体として乗算の回数が4回以上削減可能である。乗算の回数を減少させられるか否かについては実験的に決定され得る。例えば、べき指数が予め与えられていて、オフラインでの事前計算ができるような環境において、このようなビット長を長くした変換を行うことができれば、べき乗計算処理全体の計算量を削減することができる。
As another example, a case where 'p = 19' and 'q = 216' will be described. At this time, since “q = 7 + 11 × 19”, it is “(q 0 , q 1 ) = (7, 11)”, but if “(q 0 , q 1 ) = (64, 8)”, the coefficient is The number of occurrences of “1” decreases from 6 to 2. However p whereas can be represented by 5 bits, the 7 bits are required to represent q 0. For this reason, when the expression is converted in this way, it is necessary to repeat the process of
[第5の実施の形態]
次に、計算装置の第5の実施の形態について説明する。なお、上述の第1の実施の形態乃至第4の実施の形態と共通する部分については、同一の符号を使用して説明したり、説明を省略したりする。
[Fifth embodiment]
Next, a fifth embodiment of the computing device will be described. In addition, about the part which is common in the above-mentioned 1st Embodiment thru | or 4th Embodiment, it demonstrates using the same code | symbol or abbreviate | omits description.
本実施の形態にかかるべき乗計算処理全体の手順は図4に示したとおりであり、第1の実施の形態と同様である。本実施の形態においては、ステップS3におけるSjを計算する処理の詳細な手順も第3の実施の形態と同様である。第3の実施の形態と異なるのは計算値記憶テーブルの作成方法である。ここでは計算値記憶テーブルの作成方法について説明する。 The procedure of the whole power calculation process according to the present embodiment is as shown in FIG. 4 and is the same as that of the first embodiment. In the present embodiment, the detailed procedure of the process of calculating S j in step S3 is the same as that of the third embodiment. What is different from the third embodiment is a method of creating a calculated value storage table. Here, a method of creating a calculated value storage table will be described.
ここで用いる計算値記憶テーブルの作成方法はデータ圧縮等で用いられるBPE法と類似の概念を用いる。BPE法の概念は出現頻度の高い2バイトの文字列を、使用していない1バイト文字に置き換える操作を繰り返すことである。 The calculation value storage table used here uses a concept similar to the BPE method used in data compression or the like. The concept of the BPE method is to repeat an operation of replacing a 2-byte character string having a high appearance frequency with an unused 1-byte character.
べき乗計算においては繰り返し出現する係数列に対応する乗算結果を予めテーブルとして保持しておけば、全体の乗算回数を削減できる。ただし、データ圧縮と異なるのは乗算をすべきなのは係数が‘1’のときであるため、係数が‘0’の場合は扱わなくても良い場合が存在することである。このため、ここでは‘0’以外で始まり‘0’以外で終わる系列を1つの「文字列」とみなし、この「文字列」が複数回出現するような系列に対応する乗算結果を記憶した計算値記憶テーブルを計算装置は作成する。計算値記憶テーブルに記憶する値のデータ長が長ければ長いほど乗算回数を削減できるものと考えられるが、長いデータ長の値を記憶する計算値記憶テーブルを作成するためにBPE法の概念を適用する。すなわち、‘0’以外の係数あるいは「文字」で始まり次の‘0’以外の係数あるいは「文字」まで(例えば(1,1),(1,0,0,1),(C,0,1)など)を1つの「文字列」として扱い、複数回出現する「文字列」を別の「文字」に便宜的に置き換えていくことを繰り返すことで、計算値記憶テーブルを計算装置は作成する。これを本実施の形態における作成方針とする。ここで「文字」は係数列または係数列と「文字」を束ねたものを表し、「文字列」は係数列あるいは「文字」の組み合わせの列であるものとする。 In the power calculation, if multiplication results corresponding to repeated coefficient sequences are stored in advance as a table, the total number of multiplications can be reduced. However, the difference from data compression is that the coefficient should be multiplied when the coefficient is ‘1’, and therefore there is a case where it is not necessary to handle when the coefficient is ‘0’. For this reason, here, a sequence that starts with a value other than “0” and ends with a value other than “0” is regarded as one “character string”, and the multiplication result corresponding to the series in which this “character string” appears multiple times is stored. The calculation device creates a value storage table. The longer the data length of the value stored in the calculated value storage table, the more the number of multiplications can be reduced. However, the concept of the BPE method is applied to create a calculated value storage table for storing a long data length value. To do. That is, a coefficient other than “0” or “character” starts with a coefficient other than “0” or “character” (for example, (1, 1), (1, 0, 0, 1), (C, 0, 1) etc.) is treated as one “character string”, and the calculation device creates a calculated value storage table by repeatedly replacing “character string” that appears multiple times with another “character” for convenience. To do. This is the creation policy in this embodiment. Here, “character” represents a coefficient string or a combination of coefficient strings and “characters”, and “character string” is a coefficient string or a combination of “characters”.
図19は、本実施の形態にかかる計算値記憶テーブルを作成する処理の手順を示すフローチャートである。ここでは具体例として、‘h=1’、‘w=10’、‘r=2’の場合を考える。‘(q00,・・・,q90)=(1,1,0,1,0,0,1,1,0,1)’であった場合、これを上述の作成方針に従って計算装置は変換する。まず計算装置は、この係数列の中で頻度の高い係数列を探す(ステップS201)。この結果、ここでは、(1,1)という係数列(「文字列」)が見つかる。計算装置はこれを新たな「文字」‘A’に置き換える(ステップS202)。
(q00,・・・,q90)=(A,0,1,0,0,A,0,1)
FIG. 19 is a flowchart of a process procedure for creating a calculated value storage table according to the present embodiment. Here, as a specific example, consider the case of 'h = 1', 'w = 10', and 'r = 2'. If '(q 00 ,..., Q 90 ) = (1,1,0,1,0,0,1,1,0,1)', this is calculated by the computing device according to the above-mentioned creation policy. Convert. First, the computing device searches for a coefficient sequence having a high frequency in the coefficient sequence (step S201). As a result, a coefficient sequence (“character string”) of (1,1) is found here. The computer replaces this with a new “character” “A” (step S202).
(Q 00 ,..., Q 90 ) = (A, 0, 1, 0, 0, A, 0, 1)
次いで、計算装置は、変換後の係数列に対して、頻度の高い「文字列」を探すと(ステップS203)、ここでは、(A,0,1)が見つかる(ステップS203:Yes)。また、これ以外に同じ「文字列」が存在しないのでステップS201からステップS202に進んで、これを‘B’と計算装置は置き換える。この結果、
(q00,・・・,q90)=(B,0,1,0,0,B)
となる。ここで2度以上同一の「文字列」が出現することはない(ステップS203:No)ので、「文字列」を係数列で表すと
A:(1,1)
B:(A,0,1)(=(1,1,0,1))
となる。これを第3の実施の形態で示した計算値記憶テーブルのようなテーブル表現に変換すると、
A:T(11)=a^(1+p)
B:T(1101)=a^(1+p^2+p^3)
となる。計算装置はこれを求めて計算値記憶テーブル53に記憶させる(ステップS204)。
Next, when the computing device searches for a frequently-used “character string” in the converted coefficient string (step S203), here, (A, 0, 1) is found (step S203: Yes). In addition, since there is no other “character string” other than the above, the process proceeds from step S201 to step S202, and “B” is replaced with “B”. As a result,
(Q 00 ,..., Q 90 ) = (B, 0, 1, 0, 0, B)
It becomes. Here, the same “character string” does not appear twice or more (step S203: No). Therefore, when “character string” is represented by a coefficient string, A: (1, 1)
B: (A, 0, 1) (= (1, 1, 0, 1))
It becomes. When this is converted into a table expression like the calculated value storage table shown in the third embodiment,
A: T (11) = a ^ (1 + p)
B: T (1101) = a ^ (1 + p ^ 2 + p ^ 3)
It becomes. The calculation device obtains this and stores it in the calculated value storage table 53 (step S204).
以上のような構成によれば、計算装置が有限体の拡大体において行うべき乗計算の計算量をより効果的に削減することができる。 According to the configuration as described above, it is possible to more effectively reduce the amount of calculation of the power calculation performed by the computing device in the finite field expansion field.
[変形例]
なお、本発明は前記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、前記実施形態に開示されている複数の構成要素の適宜な組み合わせにより、種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。さらに、異なる実施形態にわたる構成要素を適宜組み合わせてもよい。また、以下に例示するような種々の変形が可能である。
[Modification]
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, constituent elements over different embodiments may be appropriately combined. Further, various modifications as exemplified below are possible.
<変形例1>
上述した各実施の形態において、計算装置で実行される各種プログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成しても良い。当該各種プログラムを、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD(Digital Versatile Disk)等のコンピュータで読み取り可能な記録媒体に記録して提供するように構成しても良い。
<
In each of the above-described embodiments, various programs executed by the computing device may be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. The various programs are recorded in a computer-readable recording medium such as a CD-ROM, a flexible disk (FD), a CD-R, and a DVD (Digital Versatile Disk) in an installable or executable format file. You may comprise so that it may provide.
<変形例2>
上述の第1の実施の形態又は第3の実施の形態においては、T(k)の値について、計算装置自体が事前計算を行って計算値記憶テーブル53に予め記憶させるように構成した。しかし、計算装置は、他の情報処理装置が計算したT(k)の値を取得して、これを計算値記憶テーブル53に記憶させるようにしても良い。T(k)の値の取得は、通信I/Fを介して通信により行うようにしても良いし、コンピュータで読み取り可能な記録媒体等からの読み出しにより行うようにしても良い。
<
In the first embodiment or the third embodiment described above, the value of T (k) is preliminarily calculated and stored in the calculated value storage table 53 in advance. However, the calculation apparatus may acquire the value of T (k) calculated by another information processing apparatus and store it in the calculation value storage table 53. Acquisition of the value of T (k) may be performed by communication via the communication I / F, or may be performed by reading from a computer-readable recording medium or the like.
また、上述の第1の実施の形態又は第3の実施の形態においては、Window幅を‘4’としたが、これに限らず、Window幅は‘2’以上且つ‘w’以下であれば良い。 In the first embodiment or the third embodiment described above, the window width is set to “4”. However, the present invention is not limited to this, and the window width is not less than “2” and not more than “w”. good.
<変形例3>
上述の第1の実施の形態又は第2の実施の形態においては、べき指数が同じであるべき乗計算を複数行う場合、先のべき乗計算の際に行ったp進数展開の結果及びr進数展開の結果のうち少なくとも一方を再利用して、後のべき乗計算を行うようにしても良い。この場合、例えば、図2に示したような、p進数展開後及びr進数展開後の各係数qijの値をHDDなどの外部記憶装置に記憶させておけばこれを後のべき乗計算の際に再利用することが可能である。
<
In the first embodiment or the second embodiment described above, when a plurality of power calculations with the same power exponent are performed, the result of the p-adic expansion and the r-adic expansion performed in the previous power calculation are performed. At least one of the results may be reused to perform the later power calculation. In this case, for example, if the values of the coefficients q ij after p-adic expansion and after r-adic expansion are stored in an external storage device such as an HDD as shown in FIG. Can be reused.
また、元が同じであるべき乗計算を複数行う場合、先のべき乗計算の過程で得られる計算結果の一部又は全部を再利用して、後のべき乗計算を行うようにしても良い。この場合、例えば、計算値記憶テーブル53を後のべき乗計算の際に再利用することができる。 In addition, when a plurality of power calculations that should have the same element are performed, some or all of the calculation results obtained in the process of the previous power calculation may be reused to perform the subsequent power calculation. In this case, for example, the calculated value storage table 53 can be reused in the later power calculation.
以上のように、複数のべき乗算においてべき指数又は元が同じであれば、共通の計算結果を共用することにより、計算量を効果的に削減することができる。 As described above, if power exponents or elements in a plurality of power multiplications are the same, the amount of calculation can be effectively reduced by sharing a common calculation result.
<変形例4>
上述の第2の実施の形態においては、bの値の上限を定めるように構成しても良い。このような構成によれば、計算値記憶テーブル53への記憶と各Sjの計算とをより効果的に行うことができる。
<
In the second embodiment described above, an upper limit of the value of b may be determined. According to such a configuration, storage in the calculated value storage table 53 and calculation of each S j can be performed more effectively.
<変形例5>
上述の各実施の形態においては、べき乗を高速に計算可能な計算手法としてフロベニウス写像を用いたが、これに限らない。
<
In each of the above-described embodiments, the Frobenius map is used as a calculation method capable of calculating the power at a high speed. However, the present invention is not limited to this.
51 p進数展開部
52 r進数展開部
53 計算値記憶テーブル
54 第1計算部
55 第2計算部
51 p-adic expansion unit 52 r-
Claims (15)
べき指数qをs進数展開して
q=Σi=0 w−1qi×s^i (0≦qi<s)
となる各係数qiを求めるs進数展開部と、
各係数qiをr進数展開して
qi=Σj=0 h−1qij×r^j (0<r<s,0≦qij<r)
となる各係数qijを求めるr進数展開部と、
各係数qijを用いて、べき乗を計算するべき乗計算部とを備え、
前記r進数展開部は、s進数展開後の係数qy,q(y+1)(0≦y≦w−2)について、係数q(y+1)の値の一部のs倍を係数qyに加えて、各係数qy,q(y+1)をr進数展開する
ことを特徴とする計算装置。 A computing device for calculating a power of a finite element a (a∈Fp ^ m, m is a natural number, and `^ 'is a power),
Q = Σ i = 0 w−1 q i × s ^ i (0 ≦ q i <s)
An s-adic expansion unit for obtaining each coefficient q i
Each coefficient q i expand r adic q i = Σ j = 0 h -1 q ij × r ^ j (0 <r <s, 0 ≦ q ij <r)
An r-adic expansion unit for obtaining each coefficient q ij such that
A power calculator that calculates a power using each coefficient q ij ,
Wherein r adic number expansion unit, coefficient after s-adic expansion q y, q (y + 1 ) for (0 ≦ y ≦ w-2 ), added s times of some of the values of the coefficients q (y + 1) to the coefficient q y And calculating each coefficient q y , q (y + 1) by r-adic number.
各jについて、
Sj=Πi=0 w−1a^{qij×s^i}
を計算する第1計算部と、
各jについて計算されたSjを用いて、べき指数qの元aのべき乗として
a^q=(((((S(h−1))^r×S(h−2))^r×S(h−3))^r×・・・)^r×S1)^r×S0
を計算する第2計算部とを有する
ことを特徴とする請求項1に記載の計算装置。 The power calculator is
For each j
S j = Π i = 0 w−1 a ^ {q ij × s ^ i}
A first calculation unit for calculating
Using S j calculated for each j, a ^ q = (((((((S (h-1) )) ^ r * S (h-2) ) ^ r * S (h-3)) ^ r × ···) ^ r × S 1) ^ r × S 0
The calculation apparatus according to claim 1, further comprising: a second calculation unit that calculates.
前記第1計算部は、前記記憶手段に記憶された値を用いて、各jについてS The first calculation unit uses the value stored in the storage unit to calculate S for each j. jj を計算するCalculate
ことを特徴とする請求項2に記載の計算装置。The computing apparatus according to claim 2, wherein:
前記第1計算部は、各jについてS The first calculation unit performs S for each j. jj を計算するときに、u個の連続する係数列qWhen u are calculated, u consecutive coefficient sequences q kjkj ,・・・,q, ..., q (k+u−1)j(K + u-1) j (0≦k<(w−1))の各係数の値と、前記記憶手段に記憶された前記係数列qThe value of each coefficient (0 ≦ k <(w−1)) and the coefficient sequence q stored in the storage means ijij ,・・・,q, ..., q (i+u−1)j(I + u-1) j の各係数の値とが一致する場合は、前記記憶手段に記憶された前記‘a^(qWhen the values of the respective coefficients match, the ‘a ^ (q ijij +q+ Q (i+1)j(I + 1) j ×s+・・・+qXs + ... + q (i+u−1)j(I + u-1) j ×s^{i+u−1})’の値を用いるXs ^ {i + u-1}) 'value is used
ことを特徴とする請求項2に記載の計算装置。The computing apparatus according to claim 2, wherein:
前記第1計算部は、d≧2に対して、0でない係数q The first calculation unit calculates a coefficient q that is not 0 for d ≧ 2. ujuj と0でない係数qAnd non-zero coefficient q (u+d−1)j(U + d-1) j を含む同一のjに対するd個の連続する係数列qD consecutive coefficient sequences q for the same j including ujuj ,・・・,q, ..., q (u+d−1)j(U + d-1) j と各係数の値が同一のd個の連続する係数列qAnd d consecutive coefficient sequences q having the same value of each coefficient (u+t)(j+v)(U + t) (j + v) ,・・・,q, ..., q (u+t+d−1)(j+v)(U + t + d-1) (j + v) が存在する場合には、前記記憶手段に記憶された値を用いて各jについてSjを計算するIs calculated for each j using the value stored in the storage means
ことを特徴とする請求項2に記載の計算装置。The computing apparatus according to claim 2, wherein:
前記s進数展開部は、べき指数qをp進数展開して
q=Σi=0 w−1qi×p^i (0≦qi<p)
となる各係数qiを求める
ことを特徴とする請求項1乃至5のいずれか一項に記載の計算装置。 s in the s-adic expansion is the characteristic p of the element a of the finite field,
The s-adic expansion unit expands a power exponent q to a p-adic number, and q = Σ i = 0 w−1 q i × p ^ i (0 ≦ q i <p)
Become computing device according to any one of claims 1 to 5, characterized in that determining the coefficients q i.
ことを特徴とする請求項1乃至6のいずれか一項に記載の計算装置。 The power calculation unit uses the Frobenius map and each said coefficient q ij, computing device according to any one of claims 1 to 6, wherein the calculating the power of said source.
前記べき乗計算部は、各前記係数qijを用いて、前記拡大体の元のべき乗を計算する
ことを特徴とする請求項1乃至7のいずれか一項に記載の計算装置。 The finite field is an expanded field expanded by a binomial expression,
The power calculation unit uses each of said coefficients q ij, computing device according to any one of claims 1 to 7, characterized in that to calculate the original power of the extension field.
前記べき乗計算部は、各前記係数qijを用いて、前記拡大体の元のべき乗を計算する
ことを特徴とする請求項1乃至7のいずれか一項に記載の計算装置。 The finite field is an expanded field expanded by a circular polynomial,
The power calculation unit uses each of said coefficients q ij, computing device according to any one of claims 1 to 7, characterized in that to calculate the original power of the extension field.
ことを特徴とする請求項1乃至9のいずれか一項に記載の計算装置。 Wherein r adic number expansion unit, for each coefficient q i, computing device according to any one of claims 1 to 9, characterized in that the binary expansion.
ことを特徴とする請求項1乃至10のいずれか一項に記載の計算装置。 When calculating a plurality of powers that should have the same power exponent, the s-adic expansion unit uses a part or all of the result of the s-adic expansion when calculating the previous power, when calculating the subsequent power. The computing device according to claim 1, wherein the power exponent q is expanded to an s-adic number.
ことを特徴とする請求項1乃至11のいずれか一項に記載の計算装置。 In the case of calculating a plurality of powers that should have the same power exponent, the r-adic expansion unit uses a part or all of the result of the r-adic expansion in the previous power calculation in the subsequent power calculation. 12. The calculation apparatus according to claim 1, wherein each coefficient q i is expanded to an r-adic number.
ことを特徴とする請求項1乃至12のいずれか一項に記載の計算装置。 If the original is a plurality calculates the power is the same, the power calculation unit that uses a part or all of the calculation results obtained during the previous power calculations, calculating the power of pre Kimoto The computing device according to claim 1, wherein
前記s進数展開部が、べき指数qをs進数展開して
q=Σi=0 w−1qi×s^i (0≦qi<s)
となる各係数qiを求め、
前記r進数展開部が、各係数qiをr進数展開して
qi=Σj=0 h−1qij×r^j (0<r<s,0≦qij<r)
となる各係数qijを求め、
前記べき乗計算部は、各係数qijを用いて、べき指数qの元のべき乗を計算し、
前記r進数展開は、s進数展開後の係数qy,q(y+1)(0≦y≦w−2)について、係数q(y+1)の値の一部のs倍を係数qyに加えて、各係数qy,q(y+1)をr進数展開する
ことを特徴とする計算方法。 A computing device that includes an s-adic expansion unit, an r-adic expansion unit, and a power calculation unit, and calculates a power of a finite field element a (a∈Fp ^ m, m represents a natural number, and `^ 'represents a power) A calculation method executed in
The s-adic expansion unit expands a power exponent q into an s-adic number and q = Σ i = 0 w−1 q i × s ^ i (0 ≦ q i <s)
Find each coefficient q i
The r-adic expansion unit expands each coefficient q i into an r-adic number, and q i = Σ j = 0 h−1 q ij × r ^ j (0 <r <s, 0 ≦ q ij <r)
Find each coefficient q ij such that
The power calculation unit calculates an original power of a power exponent q using each coefficient q ij ,
In the r-adic expansion, for the coefficients q y , q (y + 1) (0 ≦ y ≦ w−2) after the s-adic expansion, a part s times the value of the coefficient q (y + 1) is added to the coefficient q y. A calculation method characterized by expanding each coefficient q y , q (y + 1) to an r-adic number.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008246307A JP5403982B2 (en) | 2008-09-25 | 2008-09-25 | COMPUTER DEVICE, METHOD, AND PROGRAM |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008246307A JP5403982B2 (en) | 2008-09-25 | 2008-09-25 | COMPUTER DEVICE, METHOD, AND PROGRAM |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2010078833A JP2010078833A (en) | 2010-04-08 |
| JP5403982B2 true JP5403982B2 (en) | 2014-01-29 |
Family
ID=42209379
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008246307A Expired - Fee Related JP5403982B2 (en) | 2008-09-25 | 2008-09-25 | COMPUTER DEVICE, METHOD, AND PROGRAM |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5403982B2 (en) |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR0138277B1 (en) * | 1995-01-07 | 1998-07-01 | 김광호 | Exponential computation method |
| CN101809638A (en) * | 2007-08-09 | 2010-08-18 | 国立大学法人冈山大学 | Arithmetic operation method and arithmetic operation device |
-
2008
- 2008-09-25 JP JP2008246307A patent/JP5403982B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2010078833A (en) | 2010-04-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9537653B2 (en) | Encryption key generating apparatus and computer program product | |
| US12587361B2 (en) | Encryption processing apparatus and encryption processing method | |
| WO2018211675A1 (en) | Bit decomposition secure computation apparatus, bit combining secure computation apparatus, method and program | |
| JP3542278B2 (en) | Montgomery reduction device and recording medium | |
| US12368573B2 (en) | Encryption processing device and encryption processing method | |
| JP5147085B2 (en) | Calculation method and calculation device | |
| JP5403982B2 (en) | COMPUTER DEVICE, METHOD, AND PROGRAM | |
| CN108418687B (en) | Rapid modular reduction method and medium suitable for SM2 algorithm | |
| JP2000293507A (en) | Apparatus and method for generating expression data in finite field operation | |
| JP5752337B1 (en) | Information processing system, information processing method, and program | |
| JP5175983B2 (en) | Arithmetic unit | |
| US20240214201A1 (en) | Encryption processing apparatus and encryption processing method | |
| JP4398904B2 (en) | Random number sequence generation device, random number sequence generation method, arithmetic processing device, arithmetic processing method and program | |
| JP5225115B2 (en) | NAF converter | |
| JP5927323B1 (en) | Matrix action device, matrix action method, and program | |
| JP2004166274A (en) | Base conversion method and base conversion device in finite field | |
| KR100954843B1 (en) | Block indexing-based elliptic curve cryptography method in sensor mote, apparatus and recording medium recording the same | |
| JP5840086B2 (en) | Reduction device, reduction method, and program | |
| JP2007034927A (en) | Power arithmetic unit | |
| JP5606516B2 (en) | NAF converter | |
| US20260019231A1 (en) | Encryption processing apparatus and encryption processing method | |
| JP2007034177A (en) | Exponentiation arithmetic unit | |
| JP7191804B2 (en) | SAFETY EVALUATION DEVICE, SAFETY EVALUATION METHOD AND SAFETY EVALUATION PROGRAM | |
| JP5975682B2 (en) | Arithmetic apparatus, arithmetic method, and program | |
| WO2022145057A1 (en) | Decoding device, decoding method, and program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110323 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130301 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130326 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130527 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130611 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130812 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130910 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130919 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20131008 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131029 |
|
| LAPS | Cancellation because of no payment of annual fees |