JP5713828B2 - Information processing apparatus, information processing method, and program - Google Patents
Information processing apparatus, information processing method, and program Download PDFInfo
- Publication number
- JP5713828B2 JP5713828B2 JP2011164765A JP2011164765A JP5713828B2 JP 5713828 B2 JP5713828 B2 JP 5713828B2 JP 2011164765 A JP2011164765 A JP 2011164765A JP 2011164765 A JP2011164765 A JP 2011164765A JP 5713828 B2 JP5713828 B2 JP 5713828B2
- Authority
- JP
- Japan
- Prior art keywords
- seed
- random number
- unit
- memory
- arithmetic
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0869—Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/30—Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
- H04L9/3006—Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
- H04L9/3033—Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters details relating to pseudo-prime or prime number generation, e.g. primality test
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
Description
本発明は情報処理技術に関し、特に素数生成技術に関する。 The present invention relates to information processing technology, and more particularly to a prime number generation technology.
近年の情報通信において、情報を保護するための暗号技術は必要不可欠である。この暗号技術の一つとして、デジタル署名などに用いられる公開鍵暗号がある。一般的に公開鍵暗号の鍵を生成するためには、桁の大きな素数p,qの生成を必要とする。一般的に素数は、乱数生成器にて乱数を生成し、生成された乱数が素数かどうかを判定することにより生成される。 In information communication in recent years, encryption technology for protecting information is indispensable. One of the encryption techniques is public key encryption used for digital signatures. Generally, in order to generate a key for public key cryptography, it is necessary to generate prime numbers p and q having large digits. Generally, a prime number is generated by generating a random number with a random number generator and determining whether or not the generated random number is a prime number.
安全性の観点から、素数には高品質な一様性及び予測困難性等が求められる。この要求を満たすために、乱数を生成するために物理的な雑音(熱雑音等)が蓄積されるエントロピーソースを用いることが推奨されている。エントロピーソースから取得したデータ(エントロピー)を乱数の種(シード)として乱数生成器に入力することにより、高品質な乱数が得られる(非特許文献1)。 From the viewpoint of safety, the prime number is required to have high quality uniformity and difficulty in prediction. In order to satisfy this requirement, it is recommended to use an entropy source in which physical noise (thermal noise or the like) is accumulated in order to generate a random number. High-quality random numbers can be obtained by inputting data (entropy) acquired from an entropy source to a random number generator as a seed of random numbers (Non-Patent Document 1).
生成する素数のビット長が大きいほど、素数が見つかる確率は小さくなる。大きな素数を発見するためには、乱数の生成と素数判定とを何度も繰り返す必要があるため、多くのコンピュータリソース及び時間を必要とする。この問題を解決するために、特許文献1においては、暗号処理の全てが画像処理アクセラレータであるGPUで行われる。一般にGPUは多数の演算コアで構成されており、各演算コアは並列に汎用計算ができるため、CPUよりも高速に暗号処理を行うことができることが期待される。 The larger the bit length of the prime number to be generated, the smaller the probability of finding the prime number. In order to find a large prime number, it is necessary to repeat generation of a random number and prime number determination many times, which requires a lot of computer resources and time. In order to solve this problem, in Patent Document 1, all of the cryptographic processing is performed by a GPU that is an image processing accelerator. In general, a GPU is composed of a large number of arithmetic cores, and each arithmetic core can perform general-purpose computations in parallel. Therefore, it is expected that cryptographic processing can be performed at a higher speed than the CPU.
GPUに搭載されている複数の演算ユニットを活用するには、素数の生成を多並列に行う必要がある。しかしながら特許文献1に記載の技術によれば、多並列に素数の生成を行う場合に、複数の演算ユニットが同一の乱数を生成する可能性がある。このことは、素数生成処理速度の低下をもたらしうる。 In order to utilize a plurality of arithmetic units mounted on the GPU, it is necessary to generate prime numbers in parallel. However, according to the technique described in Patent Document 1, when generating prime numbers in multiple parallels, a plurality of arithmetic units may generate the same random number. This can lead to a decrease in the prime number generation processing speed.
本発明は、複数の演算ユニットを用いた並列処理において、より高速に素数を求めることを目的とする。 An object of the present invention is to obtain a prime number at higher speed in parallel processing using a plurality of arithmetic units.
本発明の目的を達成するために、例えば、本発明の情報処理装置は以下の構成を備える。すなわち、
乱数を生成するために用いるシードを保持するメモリと、
前記メモリに格納されているシードを用いて乱数を生成する複数の演算ユニットと、
前記複数の演算ユニットのうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する指示手段とを備え、
前記複数の演算ユニットのそれぞれは、
前記指示手段により乱数発生処理の実行が指示されると、前記メモリに格納されているシードを用いて乱数を生成し、前記メモリに格納されているシードを該生成した乱数で更新する更新手段と、
前記更新手段が生成した乱数が素数であれば、該生成した乱数を出力する出力手段とを備え、
前記指示手段は、乱数発生処理の実行を指示した演算ユニットの更新手段による更新処理が完了したことを検知すると、該演算ユニットとは別の演算ユニット群のうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する
ことを特徴とする。
In order to achieve the object of the present invention, for example, an information processing apparatus of the present invention comprises the following arrangement. That is,
A memory holding seeds used to generate random numbers;
A plurality of arithmetic units that generate random numbers using seeds stored in the memory;
An instruction means for selecting any one of the plurality of arithmetic units and instructing the selected arithmetic unit to execute a random number generation process using a seed stored in the memory;
Each of the plurality of arithmetic units is
When the instruction means instructs execution of random number generation processing, the update means generates a random number using the seed stored in the memory, and updates the seed stored in the memory with the generated random number; ,
If the random number generated by the updating means is a prime number, output means for outputting the generated random number,
When the instruction unit detects that the update process by the update unit of the arithmetic unit that has instructed execution of the random number generation process is completed, the instruction unit selects any one of the arithmetic unit groups different from the arithmetic unit, and Instructing the selected arithmetic unit to execute a random number generation process using a seed stored in the memory.
複数の演算ユニットを用いた並列処理において、より高速に素数を求めることができる。 In parallel processing using a plurality of arithmetic units, a prime number can be obtained at higher speed.
以下、本発明の実施形態の一例を図面に基づいて説明する。ただし、本発明の範囲は以下の実施例に限定されるものではない。 Hereinafter, an example of an embodiment of the present invention will be described with reference to the drawings. However, the scope of the present invention is not limited to the following examples.
<システム全体構成>
図1は、本実施例に係る情報処理システム100の例を示す。情報処理システム100は、CPU101、グラフィックボード102、主メモリ105、メモリコントローラハブ106、入出力コントローラハブ107、NIC108、記憶装置109、及び外部接続ポート110を含む。
<Overall system configuration>
FIG. 1 shows an example of an
CPU101は、主メモリ105又は記憶装置109に記録されたプログラム(コンピュータプログラム)に従って、情報処理システム100の動作の少なくとも一部を制御する中央演算装置である。さらに、CPU101は物理的な雑音をビット列として取得することができる。物理的な雑音は任意のものでありうるが、例えば記憶装置109のシークタイムなどが挙げられる。
The
グラフィックボード102は、GPU103とGPUメモリ104とを含む。グラフィックボード102は通常、画像処理に特化した拡張ボードである。GPU103は、リンク118を介してGPUメモリ104に接続される。GPU103は、リンク113を介してCPU101からGPUメモリ104へと転送されたプログラムに従って、グラフィックボード102の動作の少なくとも一部を制御する演算ユニットを有する。GPUメモリ104は、GPU103を制御するプログラムを格納することができる。GPUメモリ104はまた、GPU103の動作中にデータを一時的に記憶することができる。GPUメモリ104は、例えばRAMでありうる。
The
主メモリ105は、CPU101を制御するプログラムを格納することができる。主メモリ105はまた、CPU101の動作中にデータを一時的に記憶することができる。主メモリ105は、例えばRAMでありうる。
The
メモリコントローラハブ106は、リンク113、114、115及び116を介してそれぞれCPU101、主メモリ105、グラフィックボード102及び入出力コントローラハブ107と接続されている。メモリコントローラハブ106は、主メモリ105、グラフィックボード102及び入出力コントローラハブ107の間のデータ転送を制御する。
The
入出力コントローラハブ107は、リンク117、118及び119を介してそれぞれNIC108、記憶装置109及び外部接続ポート110と接続されている。入出力コントローラハブ107は、メモリコントローラハブ106、NIC108、記憶装置109及び外部接続ポート110の間のデータ転送を制御する。
The input /
NIC108は、ネットワークに接続するための通信インターフェイスである。NIC108は例えば、有線LAN、無線LAN、又はBluetooth用の通信カード等でありうる。 The NIC 108 is a communication interface for connecting to a network. The NIC 108 can be, for example, a wired LAN, a wireless LAN, or a Bluetooth communication card.
記憶装置109は、CPU101が実行するプログラム、CPU101が処理に用いるデータ、及び外部から取得したデータ等を格納する。記憶装置は例えば、ハードディスクのような磁気記憶装置、又はSSDのようなフラッシュメモリでありうる。情報処理システム100は、複数の記憶装置109を有していてもよい。
The
外部接続ポート110は、外部機器を情報処理システム100に接続するためのポートである。外部接続ポート110は、例えばUSBポート、IEEE1394ポート、HDMIポート等でありうる。この外部接続ポート110に入力装置111を接続することで、情報処理システム100は入力装置111からデータを取得することができる。情報処理システム100は、複数の外部接続ポート110を有していてもよい。
The
入力装置111は、外部接続ポート110を介して情報処理システム100にデータを入力する機器である。入力装置111は例えば、キーボード、マウス等でありうる。出力装置112は、情報処理システム100が出力するデータを視覚的に表示する装置である。出力装置112は、グラフィックボード102が有するポートに接続されることができる。また出力装置112は、外部接続ポート110に接続されてもよい。出力装置112の例としては、例えば液晶モニタ等が挙げられる。出力装置112が接続されるポートの例としては、例えばHDMIポート等が挙げられる。
The input device 111 is a device that inputs data to the
リンク113、114、115、116、117、118、及び119はシリアルバスである。リンク113、114、115、116、117、118、及び119は例えば、PCI又はPCIエクスプレス等などのバスでありうる。
The
以上、本実施例に係る情報処理システム100として利用可能なハードウェア構成の一例を示した。以上説明された情報処理システム100は、例えば、パーソナルコンピュータ等を用いて実現することができる。しかしながら、本実施例に係る情報処理システム100は上述の構成に限定されるものではない。例えば変形例において、情報処理システム100はグラフィックボード102を含まずにGPU103を含んでいてもよい。この場合、GPU103が主メモリ105に対してデータを読み書きできるように、情報処理システム100を構成すればよい。また、CPU101にGPU103を統合してもよい。この場合にも、情報処理システム100はグラフィックボード102を有さなくてもよい。他の実施例として、CPUとGPUとの少なくとも一方として、暗号処理に特化したハードウェアである暗号アクセラレータを用いてもよい。また、CPUとGPUとの少なくとも一方として、演算処理が可能なIPコアを用いてもよい。
Heretofore, an example of the hardware configuration that can be used as the
<GPU103の構成>
以下、図2を参照してGPU103について詳しく説明する。図2は、本実施例に適用可能なGPU103の構成例を示す。図2において、GPU103は2つの演算ユニット201,202を含む。しかしながら、GPU103が含む演算ユニットの数は2つに限定されない。GPU103は、2つ以上の演算ユニットを含みうる。演算ユニット201及び202は、並列動作が可能な演算装置である。例えば演算ユニット201及び202は、それぞれ別の命令を実行することができ、また別のデータを扱うことができる。
<Configuration of
Hereinafter, the
演算ユニット201はキャッシュメモリ203を含む。演算ユニット201は、GPUメモリ104又はキャッシュメモリ203に記録されたプログラムに従って、GPU103内の動作の少なくとも一部を制御する。また、また、演算ユニット202はキャッシュメモリ204を含む。演算ユニット202は、GPUメモリ104又はキャッシュメモリ204に記録されたプログラムに従って、GPU103内の動作の少なくとも一部を制御する。キャッシュメモリ203及び204は、高速に読み書き可能な小容量メモリである。
The
<情報処理システム100の機能構成>
以下、図5を参照して、図1に係る情報処理システム100の機能構成について説明する。本実施例に係る情報処理システム100は、並列に素数の生成を行うことができる。図5に示すように、情報処理システム100は演算装置と外部演算装置とを含む。演算装置としては、例えば前述したCPU101を用いることができる。また外部演算装置としては、前述したGPU103を用いることができる。この場合、処理装置0及び処理装置1は、それぞれ演算ユニット201及び演算ユニット202に対応する。
<Functional Configuration of
Hereinafter, the functional configuration of the
しかしながら、本実施例で用いられる演算装置及び外部演算装置は、上述のCPU101及びGPU103には限られない。例えば、演算装置101又は外部演算装置103として、前述した暗号アクセラレータを用いてもよい。以下の説明では、演算装置としてCPU101を用いる。また、外部演算装置としてGPU103を用いる。
However, the arithmetic device and the external arithmetic device used in the present embodiment are not limited to the
図5に示すように、演算装置101はシード生成部501を備える。また、外部演算装置103は保存部502、制御部503、シード更新部504、乱数生成部505、及び素数判定部506を備える。また、並列に動作可能な演算ユニット201,202はそれぞれ、シード更新部504、乱数生成部505、及び素数判定部506を備える。以下、これらの各部について説明する。
As illustrated in FIG. 5, the
<シード生成部501>
以下で、シード生成部501について説明する。シード生成部501は、乱数の種となるシードの初期値を生成し、生成した初期値をGPU103に出力する。シードの生成方法としては任意の公知の方法を用いることができる。本実施例においては、シードの生成のためにエントロピーを用いる。
<
Below, the seed production |
本実施例においてエントロピーとは、物理的な雑音をビット列に変換することによって得られる値である。すなわちシード生成部501は、熱雑音などの物理的な雑音が蓄積されるエントロピーソースから、シードの生成に必要な分のエントロピーを取得する。シードの生成に必要なエントロピーは、生成する乱数のセキュリティ強度によって異なる。例えばセキュリティ強度が128bitの乱数を生成するときは、128bit以上のエントロピーが必要となる(非特許文献1を参照)。
In this embodiment, entropy is a value obtained by converting physical noise into a bit string. That is, the
シード生成部501が十分なエントロピーを取得すると、シード生成部501は、エントロピーを用いてシードを生成する。例えば、エントロピーに対してハッシュ関数を適用することにより、シードを生成することができる(非特許文献1を参照)。また、エントロピーに対してナンスなどの付加データを追加した後に、ハッシュ関数を適用してもよい(非特許文献1)。また、ハッシュ関数の代わりにブロック暗号アルゴリズムを用いることもできる(非特許文献1)。そしてシード生成部501は、生成したシードを保存部502に出力する。
When the
シード生成部501は、保存部502に格納されているシード更新回数及び限界シード更新回数に従って、シードを生成及び出力する。ここでシード更新回数とは、シードの更新回数を表す値である。シード生成部501が生成したシードを保存部502に格納する際に、シード生成部501は、保存部に格納されているシード更新回数を0に初期化する。その後、シード更新部504が保存部502に格納されているシードを更新する際に、シード更新部504は、保存部502に格納されているシード更新回数を更新する。
The
限界シード更新回数(所定回数)は、1つのシードから生成できる乱数の総数を示す。1つのシードを更新しながら多数の乱数を生成すると、乱数の周期性が知られる可能性が高くなる。そこで本実施例においては、1つのシードから生成できる乱数の数が予め定められている。限界シード更新回数は、例えばユーザが設定することができる。 The limit seed update count (predetermined count) indicates the total number of random numbers that can be generated from one seed. If a large number of random numbers are generated while updating one seed, there is a high possibility that the periodicity of the random numbers is known. Therefore, in this embodiment, the number of random numbers that can be generated from one seed is determined in advance. The limit seed update count can be set by the user, for example.
シード生成部501は、シード更新回数が限界シード更新回数を超えたと判断すると、保存部502に格納されているシードを新しいシードで置き換える。すなわち、シード生成部501は、まず保存部502のシードを削除する。次にシード生成部501は上述のようにエントロピーを用いてシードを生成し、生成したシードを保存部502に格納する。そしてシード生成部501は、保存部502に格納されているシード更新回数を0に初期化する。シード更新回数が限界シード更新回数以下の場合にも、シード生成部501は、エントロピーを用いたシードの生成処理を行ってもよい。この場合、シード更新回数が限界シード更新回数を超えたときに、シード生成部501は生成されたシードを素早く保存部502に格納することができる。
If the
<保存部502>
保存部502は、上述のように、乱数を生成するために用いるシード、シード更新回数、及び限界シード更新回数などのデータを格納(保持)することができる。
<
As described above, the
<制御部503>
以下で、制御部503について説明する。制御部503は、乱数生成部505の動作を制御する。特に制御部503は、複数の乱数生成部505のそれぞれが同一の乱数を生成しないように、乱数生成部505を制御(指示)する。本実施例において制御部503は、複数の演算ユニット群201,202のうち何れか1つを選択する。そして、選択した演算ユニットに対して、乱数発生処理の実行を指示する。
<
Hereinafter, the
具体的には制御部503は、保存部502に格納されたシード更新回数と、演算ユニット201,202に予め割り当てられた識別子とに応じて、乱数生成部505を制御する。本実施例において制御部503は、シード更新回数を演算ユニットの総数で割った余りを参照してこの制御を行う。以降、シード更新回数を演算ユニットの総数で割った余りを「シード更新回数(mod 演算ユニット総数)」と記述する。識別子とは、演算ユニット201,202を特定する数字である。識別子は、各演算ユニットに対して“0”から順に割り当てられる。本実施例において、演算ユニット201は識別子“0”を割り当てられており、演算ユニット202は識別子“1”を割り当てられている。
Specifically, the
制御部503は、保存部502に格納されているシード更新回数を参照して、1つの演算ユニットに対し、保存部502に格納されているシードを用いて乱数を生成させる。具体的には制御部503は、シード更新回数(mod 演算ユニット総数)に一致する識別子が割り当てられた演算ユニットに対し、保存部502に格納されているシードを用いて乱数を生成させる。このようにして、並列動作を行う演算ユニット201,202が同一の乱数を生成し、演算ユニット201,202が同一の乱数に対して素数判定を行うことを回避できる。
The
より一般的に、情報処理システム100がN個の演算ユニットを有している場合について説明する。この場合、それぞれの演算ユニットには1番からN番までの番号(識別子)が付される。そして、「シード更新回数(mod 演算ユニット総数)」と一致する番号を有する演算ユニットに対し、制御部503は保存部502に格納されているシードを用いて乱数を生成させる。
More generally, a case where the
<シード更新部504>
以下で、シード更新部504について説明する。シード更新部504は、保存部502に格納されているシードを更新する。またシード更新部504は、保存部502に格納されているシードを更新する際に、保存部502に格納されているシード更新回数を変更する。
<
Hereinafter, the
乱数生成器は通常、同一のシードからは同じ乱数を生成する。そこで、複数の乱数を生成するために、シードが更新される。つまりシード更新部504は、乱数生成部505が乱数を生成する度に、保存部502に格納されているシードを更新する。この際シード更新部は、乱数生成部505が生成した乱数を用いて、保存部502に格納されているシードを更新することができる(非特許文献1を参照)。例えばシード更新部504は、乱数生成部505が生成した乱数で、保存部502に格納されているシードを置換すればよい。またシード更新部504は、保存部502に格納されているシードを更新する際に、保存部502に格納されているシード更新回数を更新する。例えば、シード更新回数をインクリメントすればよく、具体的にはシード更新回数に1を加えればよい。
Random number generators typically generate the same random number from the same seed. Therefore, the seed is updated to generate a plurality of random numbers. That is, the
<乱数生成部505>
以下で、乱数生成部505について説明する。乱数生成部505は、制御部503に指示されると、保存部502に格納されているシードと、乱数生成器とを用いて乱数を生成する。そして乱数生成部505は、生成した乱数を素数判定部506に出力する。乱数生成器は、シードから乱数を生成する。乱数生成器は任意の公知の方法を用いて乱数を生成することができ、例えば、ハッシュ関数やブロック暗号アルゴリズムなどを用いることができる(非特許文献1を参照)。なお、保存部502に格納されているシード更新回数が限界シード更新回数を超えている場合には、乱数生成部505は乱数の生成を行わず、シード生成部501によって新しいシードが保存部502に格納されるのを待つ。
<
Hereinafter, the random
<素数判定部506>
以下で、素数判定部506について説明する。素数判定部506は、乱数生成部505が出力した乱数が素数であるか否かを判定する。素数判定には任意の公知の方法を用いることができ、例えばミラーラビン法を用いることができる(非特許文献2)。
<Prime
Hereinafter, the prime
素数判定部506は、乱数生成部505が出力した乱数が素数であると判断すると、素数生成が完了したことをCPU101に通知する。本実施例において素数判定部506は、乱数が素数であると判断すると、CPU101に生成された素数を転送する。また素数判定部506は、乱数が素数であると判断すると、保存部502に格納されている素数生成完了フラグをONにする。素数生成完了フラグは、素数の生成が完了した時にONとなり、素数の生成が完了していないときにOFFとなるフラグである。素数生成完了フラグを参照することにより、CPU101は素数が生成されたことを知ることができる。
If the prime
<本実施例に係る処理フロー>
以下、図3及び図4を参照して、本実施例に係る素数の生成処理のフローを説明する。本実施例に係る素数の生成処理は、CPU101での処理とGPU103での処理とに分けられる。そこで本明細書では、CPU101における処理フローと、GPU103における処理フローとについて、それぞれ説明する。
<Processing flow according to this embodiment>
Hereinafter, with reference to FIG. 3 and FIG. 4, the flow of the prime number generation process according to the present embodiment will be described. The prime number generation process according to the present embodiment is divided into a process in the
<CPU101における処理フロー>
図3は本実施例におけるCPU101で実行される処理フローを示すフローチャートである。ステップS301においてシード生成部501は、保存部502に格納されている素数生成完了フラグをOFFにする。ステップS302においてシード生成部501は、エントロピーソースにシードを作るのに十分なエントロピーが溜まっているか否かを確認する。所定量のエントロピーが溜まっていない場合、シード生成部501は所定量のエントロピーがエントロピーソースに溜まるのを待つ。所定量のエントロピーが溜まっている場合、処理はステップS303に進む。
<Processing flow in
FIG. 3 is a flowchart showing a processing flow executed by the
ステップS303においてシード生成部501は、エントロピーソースからエントロピーを取得し、上述のようにシードを生成する。ステップS304においてシード生成部501は、限界シード更新回数を設定する。具体的にはシード生成部501は、予め定められた限界シード更新回数を保存部502に格納すればよい。ステップS305においてシード生成部501は、ステップS303で生成したシードを保存部502に格納する。限界シード更新回数及び生成されたシードは、メモリコントローラハブ106を介してGPU103へと転送される。
In step S303, the
ステップS306においてシード生成部501は、GPU103において素数の生成が完了したか否かを判定する。具体的には、保存部502に格納されている素数生成完了フラグがONであるか否かを判定すればよい。素数生成完了フラグがONであれば、ステップS307においてシード生成部はメモリコントローラハブ106を介して保存部502から生成された素数を取得する。そしてシード生成部501は、GPU103の処理を停止させる。素数生成完了フラグがOFFであれば、処理はステップS308に進む。
In step S <b> 306, the
ステップS308においてシード生成部501は、シードの再生成が必要であるか否かを判定する。具体的には上述のように、シード更新回数が限界シード更新回数を超える場合に、シード生成部501はシードの再生成が必要であると判定する。シードの再生成が必要である場合、処理はステップS302に戻る。シードの再生成が必要ではない場合、処理はステップS306に戻る。
In step S308, the
<GPU103における処理フロー>
GPU103においては、GPU103の構成要素である演算ユニット201及び演算ユニット202が並列に処理を行う。演算ユニット201と202とは同じフローに従って処理を行う。したがって、本明細書においては演算ユニット201の処理フローについてのみ説明する。
<Processing flow in
In the
図4は、本実施例に係る演算ユニット201で実行される処理フローを示すフローチャートである。ステップS401において乱数生成部505は、CPU101から転送されたシードが保存部502に格納されているか否かを確認する。シードが格納されていない場合、乱数生成部505は保存部502にシードが格納されるまで待つ。シードが格納されている場合、ステップS402において乱数生成部505は、格納されているシードで乱数生成器を初期化する。
FIG. 4 is a flowchart illustrating a processing flow executed by the
ステップS403において乱数生成部505は、保存部502に格納されているシード更新回数と限界シード更新回数とを比較する。シード更新回数が限界シード更新回数を超えている場合、処理はステップS401に戻る。超えていない場合、処理はステップS404に進む。
In step S403, the random
ステップS404において乱数生成部505は、現在保存部502に格納されているシードを用いて乱数を生成してもよいかを、制御部503に問い合わせる。制御部503の詳細な処理については後述する。乱数を生成してはいけない場合、処理はステップS403に戻る。乱数を生成してもよい場合、処理はステップS405に進む。このステップS404により、複数の演算ユニットが同一のシードを用いて乱数を生成することが防止される。
In step S <b> 404, the random
ステップS405において乱数生成部505は、保存部502にシードが格納されているか否かを再び確認する。シードが格納されていない場合、処理はステップS401に戻る。シードが格納されている場合、ステップS406において乱数生成部505は、保存部502に格納されているシードを用いて乱数を生成する。
In step S <b> 405, the random
ステップS407において乱数生成部505は、ステップS406で生成された乱数を用いて、保存部502に格納されているシードを更新する。また乱数生成部505は、保存部502に格納されているシード更新回数をインクリメントする。ステップS408において素数判定部506は、ステップS406において生成された乱数が素数かどうかを判定する。生成された乱数が素数でないと判定された場合、処理はステップS403に戻る。生成された乱数が素数であると判定された場合、ステップS409において素数判定部506は保存部502に格納されている素数生成完了フラグをONにし、処理は終了する。
In step S407, the random
次に、複数の演算ユニット201,202が同一のシードを用いて乱数を生成することを防止するステップS404について詳しく説明する。上述のように、演算ユニット201は識別子として”0”を有し、演算ユニット202は識別子として”1”を有する。また、本実施例において演算ユニット総数は”2”である。したがって、「シード更新回数(mod 演算ユニット総数)」は”0”か”1”かの何れかの値を持つ。すなわち、演算ユニット201についての識別子(”0”)が、「シード更新回数(mod 演算ユニット総数)」と一致しない場合、演算ユニット202についての識別子(”1”)は、「シード更新回数(mod 演算ユニット総数)」と一致する。また、この逆も成り立つ。
Next, step S404 for preventing a plurality of
ステップS404において制御部503は、演算ユニットの識別子と「シード更新回数(mod 演算ユニット総数)」とが一致する場合に、演算ユニットに対して乱数の生成を許可する。演算ユニット201は、制御部503によって乱数の生成を許可されるまで、ステップS403〜S404を繰り返す。すなわち演算ユニット201は、演算ユニット201の識別子とシード更新回数(mod 演算ユニット総数)が一致するまで、ステップS403〜S404を繰り返す。
In step S404, the
一方で演算ユニット201が乱数の生成を許可されていない際に、演算ユニット202は乱数の生成を許可されている。従って演算ユニット202は乱数を生成し、生成された乱数を用いて保存部502に格納されているシードを更新するとともに、シード更新回数に1を加える。シード更新回数が1つ増えると、演算ユニット201の識別子とシード更新回数(mod 演算ユニット総数)が一致する。このため、演算ユニット201は制御部503によって乱数の生成を許可される。一方で、今度は演算ユニット202の識別子とシード更新回数(mod 演算ユニット総数)が不一致となる。このため、演算ユニット202は保存部502に格納されているシードが更新されるまで、乱数の生成を許可されない。
On the other hand, when the
このように、制御部503は保存部502に格納されているシード更新回数を監視する。そして制御部503は、シード更新回数の増加を検出することにより、ある演算ユニットによる乱数生成処理及びシード更新処理が終了したことを検知できる。制御部503は、ある演算ユニットによってシードが更新されたことを検出すると、別の演算ユニットに乱数の生成を許可する。このような処理により、演算ユニット201,202が同一のシードを用いて乱数を生成することを回避することができる。もっとも制御部503は、シードを更新した演算ユニットを特定する情報を参照して、別の演算ユニットに乱数の生成を許可してもよい。また制御部503は、演算ユニットが処理を行っているか否か、例えば素数判定処理を完了しているか否かを示すフラグを参照して、処理を行っていない1つの演算ユニットに対して乱数の生成を許可してもよい。このように制御部503は、様々な方法を用いて、1つのシードを用いた乱数の生成を特定の演算ユニットのみに行わせるように、演算ユニットを制御することができる。
As described above, the
以上説明したように本実施例によれば、CPUはエントロピーソースを用いてシードの生成処理を行う。また、GPUは並列にシードから乱数の生成及び素数の判定を行う。このように、エントロピーソースを持たないGPUが素数を生成することが可能となる。本実施例によれば、同一の乱数に対して複数のGPUが素数判定を行うことが回避される。このため、無駄な素数判定処理を回避することができる。さらに、負荷の大きい素数判定をGPUで並列に処理できるため、CPUの負荷を下げることができ、かつ素数生成を高速化することが可能となる。 As described above, according to the present embodiment, the CPU performs seed generation processing using an entropy source. The GPU also generates a random number from the seed and determines a prime number in parallel. In this way, a GPU that does not have an entropy source can generate a prime number. According to the present embodiment, it is avoided that a plurality of GPUs perform prime number determination for the same random number. For this reason, useless prime number determination processing can be avoided. Further, since the prime number determination with a large load can be processed in parallel by the GPU, the load on the CPU can be reduced, and the prime number generation can be speeded up.
<変形例1>
上述の実施例は一例に過ぎず、別の実施例を採用することもできる。例えば、実施例1において乱数生成部505は、保存部502に格納されているシードを用いて乱数を生成してもよいかを、制御部503に問い合わせた。しかしながら素数判定部506が、素数判定を行ってもよいかを、制御部503に問い合わせてもよい。この場合制御部503は、実施例1において乱数生成部505を制御したのと同様に、素数判定部506を制御することができる。またこの場合、乱数生成部505は問い合わせを行うことなく、保存部502に格納されているシードを用いて乱数を生成してもよい。こうすることにより、複数の演算ユニットが、同一のシードを用いて生成された同一の乱数について素数であるか否かを判定することを回避できる。
<Modification 1>
The above-described embodiment is merely an example, and another embodiment can be adopted. For example, in the first embodiment, the random
<変形例2>
各演算ユニット201,202は別々のシードを用いてもよい。つまり、演算ユニットのそれぞれに対応付けられたシードが、保存部502に格納される。この場合、シード生成部501が生成した1つのシードが、それぞれの演算ユニットによって共通に用いられてもよい。各演算ユニット201,202は、対応付けられたシードを用いて、上述のように乱数生成、シード更新、及び素数判定を行う。
<Modification 2>
Each
このとき素数判定部506は、シード更新回数(mod 演算ユニット総数)と識別子とが一致しない時には、乱数生成部505が生成した乱数が素数であるか否かを判定しない。こうすることにより、複数の演算ユニットが、同一のシードを用いて生成された同一の乱数について素数であるか否かを判定することを回避できる。
At this time, the prime
<変形例3>
乱数生成部505が、保存部502に格納されているシードを用いて乱数を生成してもよいかを、制御部503に問い合わせることは必ずしも必須ではない。例えば乱数生成部505は、保存部502に格納されているシード更新回数を確認し、保存部502に現在格納されているシードを用いて乱数を生成してもよいかを判定することができる。この判定は、制御部503と同様に行うことができる。
<Modification 3>
It is not always essential that the random
<変形例4>
各演算ユニット201,202は、ステップS408において素数を見つけた後に、その素数を用いて鍵生成処理を行ってもよい。この場合情報処理システム100は、並列に複数の鍵を生成することができる。
<Modification 4>
Each
(他の実施形態)
本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)をネットワーク又は各種記憶媒体を介してシステム或いは装置に供給する。そして、そのシステム或いは装置のコンピュータ(又はCPUやMPU等)がプログラムコードを読み出して実行する。この場合、そのプログラム、及び該プログラムを記憶した記憶媒体は本発明を構成することになる。
(Other embodiments)
The present invention is also realized by executing the following processing. That is, software (program) that implements the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media. Then, the computer (or CPU, MPU, etc.) of the system or apparatus reads and executes the program code. In this case, the program and the storage medium storing the program constitute the present invention.
Claims (7)
前記メモリに格納されているシードを用いて乱数を生成する複数の演算ユニットと、
前記複数の演算ユニットのうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する指示手段とを備え、
前記複数の演算ユニットのそれぞれは、
前記指示手段により乱数発生処理の実行が指示されると、前記メモリに格納されているシードを用いて乱数を生成し、前記メモリに格納されているシードを該生成した乱数で更新する更新手段と、
前記更新手段が生成した乱数が素数であれば、該生成した乱数を出力する出力手段とを備え、
前記指示手段は、乱数発生処理の実行を指示した演算ユニットの更新手段による更新処理が完了したことを検知すると、該演算ユニットとは別の演算ユニット群のうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する
ことを特徴とする情報処理装置。 A memory holding seeds used to generate random numbers;
A plurality of arithmetic units that generate random numbers using seeds stored in the memory;
An instruction means for selecting any one of the plurality of arithmetic units and instructing the selected arithmetic unit to execute a random number generation process using a seed stored in the memory;
Each of the plurality of arithmetic units is
When the instruction means instructs execution of random number generation processing, the update means generates a random number using the seed stored in the memory, and updates the seed stored in the memory with the generated random number; ,
If the random number generated by the updating means is a prime number, output means for outputting the generated random number,
When the instruction unit detects that the update process by the update unit of the arithmetic unit that has instructed execution of the random number generation process is completed, the instruction unit selects any one of the arithmetic unit groups different from the arithmetic unit, and An information processing apparatus that instructs a selected arithmetic unit to execute a random number generation process using a seed stored in the memory.
前記メモリは、前記取得手段によって初期値が格納されてから、シードが更新された回数を記録し、
前記回数が増加した際に、前記指示手段は前記更新処理が完了したことを検知する
ことを特徴とする、請求項1に記載の情報処理装置。 Further comprising an acquisition means for acquiring an initial value of the seed and storing it in the memory;
The memory records the number of times the seed has been updated since the initial value was stored by the acquisition means,
The information processing apparatus according to claim 1, wherein when the number of times increases, the instruction unit detects that the update process has been completed.
前記更新手段は、前記メモリに記録されている回数をNで割った余りを番号として有する演算ユニットに対して、前記乱数発生処理の実行を指示する
ことを特徴とする、請求項2に記載の情報処理装置。 The information processing apparatus includes N arithmetic units, each arithmetic unit having a number from 1 to N,
The update means instructs the execution of the random number generation process to an arithmetic unit having a number obtained by dividing the number of times recorded in the memory by N as a number. Information processing device.
前記情報処理装置の指示手段が、前記複数の演算ユニットのうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する指示工程と、
前記演算ユニットの更新手段が、前記指示工程で乱数発生処理の実行が指示されると、前記メモリに格納されているシードを用いて乱数を生成し、前記メモリに格納されているシードを該生成した乱数で更新する更新工程と、
前記演算ユニットの出力手段が、前記更新工程で生成した乱数が素数であれば、該生成した乱数を出力する出力工程とを備え、
前記指示工程では、乱数発生処理の実行を指示された演算ユニットによる更新処理が完了したことを検知すると、該演算ユニットとは別の演算ユニット群のうち何れか1つを選択し、該選択した演算ユニットに対して前記メモリに格納されているシードを用いた乱数発生処理の実行を指示する
ことを特徴とする情報処理方法。 An information processing method performed by an information processing apparatus comprising: a memory that holds a seed used for generating a random number; and a plurality of arithmetic units that generate a random number using the seed stored in the memory, wherein the information An instruction means of the processing device selects any one of the plurality of arithmetic units, and instructs the selected arithmetic unit to execute a random number generation process using a seed stored in the memory Process,
When the execution unit of the random number generation process is instructed in the instruction step, the update unit of the arithmetic unit generates a random number using the seed stored in the memory, and generates the seed stored in the memory Update process to update with random numbers,
If the random number generated in the update step is a prime number, the output unit of the arithmetic unit includes an output step of outputting the generated random number,
In the instruction step, when it is detected that the update process by the arithmetic unit instructed to execute the random number generation process is completed, one of the arithmetic unit groups different from the arithmetic unit is selected and the selected An information processing method comprising instructing an arithmetic unit to execute a random number generation process using a seed stored in the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164765A JP5713828B2 (en) | 2011-07-27 | 2011-07-27 | Information processing apparatus, information processing method, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164765A JP5713828B2 (en) | 2011-07-27 | 2011-07-27 | Information processing apparatus, information processing method, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013029618A JP2013029618A (en) | 2013-02-07 |
JP5713828B2 true JP5713828B2 (en) | 2015-05-07 |
Family
ID=47786725
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011164765A Expired - Fee Related JP5713828B2 (en) | 2011-07-27 | 2011-07-27 | Information processing apparatus, information processing method, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5713828B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9800407B2 (en) * | 2013-08-30 | 2017-10-24 | Qualcomm Incorporated | Methods and apparatuses for prime number generation and storage |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5201000A (en) * | 1991-09-27 | 1993-04-06 | International Business Machines Corporation | Method for generating public and private key pairs without using a passphrase |
US7120248B2 (en) * | 2001-03-26 | 2006-10-10 | Hewlett-Packard Development Company, L.P. | Multiple prime number generation using a parallel prime number search algorithm |
-
2011
- 2011-07-27 JP JP2011164765A patent/JP5713828B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2013029618A (en) | 2013-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104364757B (en) | Parallel processing of single data buffers | |
JP2019502211A5 (en) | ||
WO2019114122A1 (en) | Encryption method for login information, device, electronic device, and medium | |
JP5564197B2 (en) | MEMORY CONTROL DEVICE, SEMICONDUCTOR MEMORY DEVICE, MEMORY SYSTEM, AND MEMORY CONTROL METHOD | |
US20180183574A1 (en) | Efficient cryptographically secure control flow integrity protection | |
JP2016535310A (en) | Method and apparatus for generating and storing prime numbers | |
JP6044738B2 (en) | Information processing apparatus, program, and storage medium | |
US20160171030A1 (en) | Sorting an array consisting of a large number of elements | |
CN116488794B (en) | Method and device for realizing high-speed SM4 password module based on FPGA | |
JP2013138409A (en) | Information processing apparatus and method therefor | |
JP6273226B2 (en) | Encryption system, authentication system, encryption device, decryption device, authenticator generation device, verification device, encryption method, authentication method | |
JP5713828B2 (en) | Information processing apparatus, information processing method, and program | |
JP5427117B2 (en) | Message authenticator generation device, message authenticator verification device, message authenticator generation method, message authenticator verification method, and program | |
JP6348273B2 (en) | Information processing system | |
JP5728596B2 (en) | Apparatus and method for performing compression operation in hash algorithm | |
US9928370B2 (en) | Communication device, communication method, computer program product, and communication system | |
JP5744673B2 (en) | Information processing system, information processing method, and program | |
JP5530025B2 (en) | Data division apparatus and data division program | |
JP6091394B2 (en) | Information processing apparatus and encryption method | |
JP2013120558A (en) | Information processing apparatus, test method and program | |
Fournaris et al. | Running Longer To Slim Down: Post-Quantum Cryptography on Memory-Constrained Devices | |
TWI775467B (en) | Machine learning model file decryption method and user device | |
CN112487448B (en) | Encryption information processing device, method and computer equipment | |
JP2013037291A (en) | Information processing apparatus, information processing method, and computer program | |
JPWO2018211653A1 (en) | Numerical distribution device, transmission information generation device, secret calculation device, method, program recording medium, and secret calculation system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140403 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20141225 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20150209 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150310 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5713828 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |