JP2013029618A - Information processing device, information processing method and program - Google Patents

Information processing device, information processing method and program Download PDF

Info

Publication number
JP2013029618A
JP2013029618A JP2011164765A JP2011164765A JP2013029618A JP 2013029618 A JP2013029618 A JP 2013029618A JP 2011164765 A JP2011164765 A JP 2011164765A JP 2011164765 A JP2011164765 A JP 2011164765A JP 2013029618 A JP2013029618 A JP 2013029618A
Authority
JP
Japan
Prior art keywords
random number
seed
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.)
Granted
Application number
JP2011164765A
Other languages
Japanese (ja)
Other versions
JP5713828B2 (en
Inventor
Ayuta Kawazu
鮎太 河津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2011164765A priority Critical patent/JP5713828B2/en
Publication of JP2013029618A publication Critical patent/JP2013029618A/en
Application granted granted Critical
Publication of JP5713828B2 publication Critical patent/JP5713828B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public 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/3033Public 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

Abstract

PROBLEM TO BE SOLVED: To more quickly find out a prime number in parallel processing using a plurality of arithmetic units.SOLUTION: Any one of a plurality of arithmetic units is selected and execution of random number generation processing using a seed stored in a memory is instructed to the selected arithmetic unit. Each of the plurality of arithmetic units, when the execution of random number generation processing is instructed, generates a random number by using the seed stored in the memory, updates the seed stored in the memory by the generated random number, and when the generated random number is a prime number, outputs the generated random number. When completion of updating processing by the arithmetic unit instructed to execute the random number generation processing is detected, another arithmetic unit out of the arithmetic unit group different from the arithmetic unit concerned is selected, and the execution of random number generation processing using the seed stored in the memory is instructed to the selected arithmetic unit.

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.

特開2007−233381号公報JP 2007-233381 A

NIST,“Recommendation for Random Number Generation Using Deterministic Random Bit Generators,SP800−90”NIST, “Recommendation for Random Number Generation Using Deterministic Random Bit Generators, SP800-90” NIST,“DIGITAL SIGNATURE STANDARD(DSS), FIPS186−2”NIST, “DIGITAL SIGNATURE STANDARD (DSS), FIPS 186-2”

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.

実施例1におけるシステムの全体構成を説明する図である。1 is a diagram illustrating an overall configuration of a system according to a first embodiment. 実施例1におけるGPUの構成を示す図である。It is a figure which shows the structure of GPU in Example 1. FIG. 実施例1におけるCPUの処理フローを説明する図である。It is a figure explaining the processing flow of CPU in Example 1. FIG. 実施例1におけるGPUの処理フローを説明する図である。It is a figure explaining the processing flow of GPU in Example 1. FIG. 実施例1におけるシステム全体の機能構成を説明する図である。1 is a diagram illustrating a functional configuration of an entire system in Embodiment 1. FIG.

以下、本発明の実施形態の一例を図面に基づいて説明する。ただし、本発明の範囲は以下の実施例に限定されるものではない。   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 information processing system 100 according to the present embodiment. The information processing system 100 includes a CPU 101, graphic board 102, main memory 105, memory controller hub 106, input / output controller hub 107, NIC 108, storage device 109, and external connection port 110.

CPU101は、主メモリ105又は記憶装置109に記録されたプログラム(コンピュータプログラム)に従って、情報処理システム100の動作の少なくとも一部を制御する中央演算装置である。さらに、CPU101は物理的な雑音をビット列として取得することができる。物理的な雑音は任意のものでありうるが、例えば記憶装置109のシークタイムなどが挙げられる。   The CPU 101 is a central processing unit that controls at least part of the operation of the information processing system 100 in accordance with a program (computer program) recorded in the main memory 105 or the storage device 109. Furthermore, the CPU 101 can acquire physical noise as a bit string. The physical noise may be arbitrary, and for example, the seek time of the storage device 109 may be mentioned.

グラフィックボード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 graphic board 102 includes a GPU 103 and a GPU memory 104. The graphic board 102 is usually an expansion board specialized for image processing. The GPU 103 is connected to the GPU memory 104 via the link 118. The GPU 103 includes an arithmetic unit that controls at least a part of the operation of the graphic board 102 in accordance with a program transferred from the CPU 101 to the GPU memory 104 via the link 113. The GPU memory 104 can store a program for controlling the GPU 103. The GPU memory 104 can also temporarily store data during operation of the GPU 103. The GPU memory 104 may be a RAM, for example.

主メモリ105は、CPU101を制御するプログラムを格納することができる。主メモリ105はまた、CPU101の動作中にデータを一時的に記憶することができる。主メモリ105は、例えばRAMでありうる。   The main memory 105 can store a program for controlling the CPU 101. The main memory 105 can also temporarily store data during operation of the CPU 101. The main memory 105 can be a RAM, for example.

メモリコントローラハブ106は、リンク113、114、115及び116を介してそれぞれCPU101、主メモリ105、グラフィックボード102及び入出力コントローラハブ107と接続されている。メモリコントローラハブ106は、主メモリ105、グラフィックボード102及び入出力コントローラハブ107の間のデータ転送を制御する。   The memory controller hub 106 is connected to the CPU 101, the main memory 105, the graphic board 102, and the input / output controller hub 107 via links 113, 114, 115, and 116, respectively. The memory controller hub 106 controls data transfer among the main memory 105, the graphic board 102, and the input / output controller hub 107.

入出力コントローラハブ107は、リンク117、118及び119を介してそれぞれNIC108、記憶装置109及び外部接続ポート110と接続されている。入出力コントローラハブ107は、メモリコントローラハブ106、NIC108、記憶装置109及び外部接続ポート110の間のデータ転送を制御する。   The input / output controller hub 107 is connected to the NIC 108, the storage device 109, and the external connection port 110 through links 117, 118, and 119, respectively. The input / output controller hub 107 controls data transfer among the memory controller hub 106, the NIC 108, the storage device 109, and the external connection port 110.

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 storage device 109 stores programs executed by the CPU 101, data used for processing by the CPU 101, data acquired from the outside, and the like. The storage device can be, for example, a magnetic storage device such as a hard disk, or a flash memory such as an SSD. The information processing system 100 may include a plurality of storage devices 109.

外部接続ポート110は、外部機器を情報処理システム100に接続するためのポートである。外部接続ポート110は、例えばUSBポート、IEEE1394ポート、HDMIポート等でありうる。この外部接続ポート110に入力装置111を接続することで、情報処理システム100は入力装置111からデータを取得することができる。情報処理システム100は、複数の外部接続ポート110を有していてもよい。   The external connection port 110 is a port for connecting an external device to the information processing system 100. The external connection port 110 can be, for example, a USB port, an IEEE 1394 port, an HDMI port, or the like. The information processing system 100 can acquire data from the input device 111 by connecting the input device 111 to the external connection port 110. The information processing system 100 may have a plurality of external connection ports 110.

入力装置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 information processing system 100 via the external connection port 110. The input device 111 can be, for example, a keyboard, a mouse, or the like. The output device 112 is a device that visually displays data output from the information processing system 100. The output device 112 can be connected to a port included in the graphic board 102. The output device 112 may be connected to the external connection port 110. Examples of the output device 112 include a liquid crystal monitor. Examples of ports to which the output device 112 is connected include an HDMI port.

リンク113、114、115、116、117、118、及び119はシリアルバスである。リンク113、114、115、116、117、118、及び119は例えば、PCI又はPCIエクスプレス等などのバスでありうる。   The links 113, 114, 115, 116, 117, 118, and 119 are serial buses. The links 113, 114, 115, 116, 117, 118, and 119 may be buses such as PCI or PCI Express, for example.

以上、本実施例に係る情報処理システム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 information processing system 100 according to the present embodiment has been shown. The information processing system 100 described above can be realized using, for example, a personal computer. However, the information processing system 100 according to the present embodiment is not limited to the above-described configuration. For example, in a modification, the information processing system 100 may include the GPU 103 without including the graphic board 102. In this case, the information processing system 100 may be configured so that the GPU 103 can read and write data from and to the main memory 105. Further, the GPU 103 may be integrated with the CPU 101. Also in this case, the information processing system 100 may not have the graphic board 102. As another embodiment, a cryptographic accelerator that is hardware specialized for cryptographic processing may be used as at least one of the CPU and the GPU. In addition, an IP core capable of arithmetic processing may be used as at least one of the CPU and the GPU.

<GPU103の構成>
以下、図2を参照してGPU103について詳しく説明する。図2は、本実施例に適用可能なGPU103の構成例を示す。図2において、GPU103は2つの演算ユニット201,202を含む。しかしながら、GPU103が含む演算ユニットの数は2つに限定されない。GPU103は、2つ以上の演算ユニットを含みうる。演算ユニット201及び202は、並列動作が可能な演算装置である。例えば演算ユニット201及び202は、それぞれ別の命令を実行することができ、また別のデータを扱うことができる。
<Configuration of GPU 103>
Hereinafter, the GPU 103 will be described in detail with reference to FIG. FIG. 2 shows a configuration example of the GPU 103 applicable to the present embodiment. In FIG. 2, the GPU 103 includes two arithmetic units 201 and 202. However, the number of arithmetic units included in the GPU 103 is not limited to two. The GPU 103 can include two or more arithmetic units. The arithmetic units 201 and 202 are arithmetic devices capable of parallel operation. For example, the arithmetic units 201 and 202 can execute different instructions and can handle different data.

演算ユニット201はキャッシュメモリ203を含む。演算ユニット201は、GPUメモリ104又はキャッシュメモリ203に記録されたプログラムに従って、GPU103内の動作の少なくとも一部を制御する。また、また、演算ユニット202はキャッシュメモリ204を含む。演算ユニット202は、GPUメモリ104又はキャッシュメモリ204に記録されたプログラムに従って、GPU103内の動作の少なくとも一部を制御する。キャッシュメモリ203及び204は、高速に読み書き可能な小容量メモリである。   The arithmetic unit 201 includes a cache memory 203. The arithmetic unit 201 controls at least a part of the operation in the GPU 103 according to a program recorded in the GPU memory 104 or the cache memory 203. Further, the arithmetic unit 202 includes a cache memory 204. The arithmetic unit 202 controls at least a part of the operation in the GPU 103 according to a program recorded in the GPU memory 104 or the cache memory 204. The cache memories 203 and 204 are small-capacity memories that can be read and written at high speed.

<情報処理システム100の機能構成>
以下、図5を参照して、図1に係る情報処理システム100の機能構成について説明する。本実施例に係る情報処理システム100は、並列に素数の生成を行うことができる。図5に示すように、情報処理システム100は演算装置と外部演算装置とを含む。演算装置としては、例えば前述したCPU101を用いることができる。また外部演算装置としては、前述したGPU103を用いることができる。この場合、処理装置0及び処理装置1は、それぞれ演算ユニット201及び演算ユニット202に対応する。
<Functional Configuration of Information Processing System 100>
Hereinafter, the functional configuration of the information processing system 100 according to FIG. 1 will be described with reference to FIG. The information processing system 100 according to the present embodiment can generate prime numbers in parallel. As shown in FIG. 5, the information processing system 100 includes an arithmetic device and an external arithmetic device. As the arithmetic device, for example, the CPU 101 described above can be used. Further, the GPU 103 described above can be used as the external arithmetic device. In this case, the processing device 0 and the processing device 1 correspond to the arithmetic unit 201 and the arithmetic unit 202, respectively.

しかしながら、本実施例で用いられる演算装置及び外部演算装置は、上述の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 CPU 101 and the GPU 103 described above. For example, the cryptographic accelerator described above may be used as the arithmetic device 101 or the external arithmetic device 103. In the following description, the CPU 101 is used as the arithmetic device. Further, the GPU 103 is used as an external arithmetic device.

図5に示すように、演算装置101はシード生成部501を備える。また、外部演算装置103は保存部502、制御部503、シード更新部504、乱数生成部505、及び素数判定部506を備える。また、並列に動作可能な演算ユニット201,202はそれぞれ、シード更新部504、乱数生成部505、及び素数判定部506を備える。以下、これらの各部について説明する。   As illustrated in FIG. 5, the arithmetic device 101 includes a seed generation unit 501. The external computing device 103 includes a storage unit 502, a control unit 503, a seed update unit 504, a random number generation unit 505, and a prime number determination unit 506. The arithmetic units 201 and 202 that can operate in parallel include a seed update unit 504, a random number generation unit 505, and a prime number determination unit 506, respectively. Hereinafter, each of these parts will be described.

<シード生成部501>
以下で、シード生成部501について説明する。シード生成部501は、乱数の種となるシードの初期値を生成し、生成した初期値をGPU103に出力する。シードの生成方法としては任意の公知の方法を用いることができる。本実施例においては、シードの生成のためにエントロピーを用いる。
<Seed generator 501>
Below, the seed production | generation part 501 is demonstrated. The seed generation unit 501 generates an initial value of a seed that becomes a seed of random numbers, and outputs the generated initial value to the GPU 103. Any known method can be used as a seed generation method. In this embodiment, entropy is used for seed generation.

本実施例においてエントロピーとは、物理的な雑音をビット列に変換することによって得られる値である。すなわちシード生成部501は、熱雑音などの物理的な雑音が蓄積されるエントロピーソースから、シードの生成に必要な分のエントロピーを取得する。シードの生成に必要なエントロピーは、生成する乱数のセキュリティ強度によって異なる。例えばセキュリティ強度が128bitの乱数を生成するときは、128bit以上のエントロピーが必要となる(非特許文献1を参照)。   In this embodiment, entropy is a value obtained by converting physical noise into a bit string. That is, the seed generation unit 501 acquires entropy for the generation of seeds from an entropy source in which physical noise such as thermal noise is accumulated. The entropy required for seed generation varies depending on the security strength of the generated random number. For example, when generating a random number having a security strength of 128 bits, entropy of 128 bits or more is required (see Non-Patent Document 1).

シード生成部501が十分なエントロピーを取得すると、シード生成部501は、エントロピーを用いてシードを生成する。例えば、エントロピーに対してハッシュ関数を適用することにより、シードを生成することができる(非特許文献1を参照)。また、エントロピーに対してナンスなどの付加データを追加した後に、ハッシュ関数を適用してもよい(非特許文献1)。また、ハッシュ関数の代わりにブロック暗号アルゴリズムを用いることもできる(非特許文献1)。そしてシード生成部501は、生成したシードを保存部502に出力する。   When the seed generation unit 501 acquires sufficient entropy, the seed generation unit 501 generates a seed using entropy. For example, a seed can be generated by applying a hash function to entropy (see Non-Patent Document 1). Further, a hash function may be applied after adding additional data such as nonce to entropy (Non-Patent Document 1). Also, a block cipher algorithm can be used instead of the hash function (Non-Patent Document 1). Then, the seed generation unit 501 outputs the generated seed to the storage unit 502.

シード生成部501は、保存部502に格納されているシード更新回数及び限界シード更新回数に従って、シードを生成及び出力する。ここでシード更新回数とは、シードの更新回数を表す値である。シード生成部501が生成したシードを保存部502に格納する際に、シード生成部501は、保存部に格納されているシード更新回数を0に初期化する。その後、シード更新部504が保存部502に格納されているシードを更新する際に、シード更新部504は、保存部502に格納されているシード更新回数を更新する。   The seed generation unit 501 generates and outputs a seed according to the seed update count and limit seed update count stored in the storage unit 502. Here, the seed update count is a value representing the seed update count. When the seed generated by the seed generation unit 501 is stored in the storage unit 502, the seed generation unit 501 initializes the number of seed updates stored in the storage unit to zero. Thereafter, when the seed update unit 504 updates the seed stored in the storage unit 502, the seed update unit 504 updates the seed update count stored in the storage unit 502.

限界シード更新回数(所定回数)は、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 seed generation unit 501 determines that the number of seed updates has exceeded the limit seed update number, the seed generation unit 501 replaces the seed stored in the storage unit 502 with a new seed. That is, the seed generation unit 501 first deletes the seed of the storage unit 502. Next, the seed generation unit 501 generates a seed using entropy as described above, and stores the generated seed in the storage unit 502. Then, the seed generation unit 501 initializes the number of seed updates stored in the storage unit 502 to zero. Even when the seed update count is less than or equal to the limit seed update count, the seed generation unit 501 may perform seed generation processing using entropy. In this case, when the seed update count exceeds the limit seed update count, the seed generation unit 501 can quickly store the generated seed in the storage unit 502.

<保存部502>
保存部502は、上述のように、乱数を生成するために用いるシード、シード更新回数、及び限界シード更新回数などのデータを格納(保持)することができる。
<Storage unit 502>
As described above, the storage unit 502 can store (hold) data such as a seed used to generate a random number, the number of seed updates, and the number of limit seed updates.

<制御部503>
以下で、制御部503について説明する。制御部503は、乱数生成部505の動作を制御する。特に制御部503は、複数の乱数生成部505のそれぞれが同一の乱数を生成しないように、乱数生成部505を制御(指示)する。本実施例において制御部503は、複数の演算ユニット群201,202のうち何れか1つを選択する。そして、選択した演算ユニットに対して、乱数発生処理の実行を指示する。
<Control unit 503>
Hereinafter, the control unit 503 will be described. The control unit 503 controls the operation of the random number generation unit 505. In particular, the control unit 503 controls (instructs) the random number generation unit 505 so that each of the plurality of random number generation units 505 does not generate the same random number. In the present embodiment, the control unit 503 selects one of the plurality of arithmetic unit groups 201 and 202. Then, the selected arithmetic unit is instructed to execute random number generation processing.

具体的には制御部503は、保存部502に格納されたシード更新回数と、演算ユニット201,202に予め割り当てられた識別子とに応じて、乱数生成部505を制御する。本実施例において制御部503は、シード更新回数を演算ユニットの総数で割った余りを参照してこの制御を行う。以降、シード更新回数を演算ユニットの総数で割った余りを「シード更新回数(mod 演算ユニット総数)」と記述する。識別子とは、演算ユニット201,202を特定する数字である。識別子は、各演算ユニットに対して“0”から順に割り当てられる。本実施例において、演算ユニット201は識別子“0”を割り当てられており、演算ユニット202は識別子“1”を割り当てられている。   Specifically, the control unit 503 controls the random number generation unit 505 according to the number of seed updates stored in the storage unit 502 and the identifier assigned to the arithmetic units 201 and 202 in advance. In the present embodiment, the control unit 503 performs this control with reference to the remainder obtained by dividing the number of seed updates by the total number of arithmetic units. Hereinafter, a remainder obtained by dividing the number of seed update times by the total number of arithmetic units is described as “seed update number (mod arithmetic unit total number)”. The identifier is a number that identifies the arithmetic units 201 and 202. The identifier is assigned to each arithmetic unit in order from “0”. In this embodiment, the arithmetic unit 201 is assigned the identifier “0”, and the arithmetic unit 202 is assigned the identifier “1”.

制御部503は、保存部502に格納されているシード更新回数を参照して、1つの演算ユニットに対し、保存部502に格納されているシードを用いて乱数を生成させる。具体的には制御部503は、シード更新回数(mod 演算ユニット総数)に一致する識別子が割り当てられた演算ユニットに対し、保存部502に格納されているシードを用いて乱数を生成させる。このようにして、並列動作を行う演算ユニット201,202が同一の乱数を生成し、演算ユニット201,202が同一の乱数に対して素数判定を行うことを回避できる。   The control unit 503 refers to the seed update count stored in the storage unit 502 and causes one arithmetic unit to generate a random number using the seed stored in the storage unit 502. Specifically, the control unit 503 generates a random number using a seed stored in the storage unit 502 for an arithmetic unit to which an identifier that matches the seed update count (mod arithmetic unit total number) is assigned. In this way, it is possible to avoid that the arithmetic units 201 and 202 performing the parallel operation generate the same random number and the arithmetic units 201 and 202 perform the prime number determination on the same random number.

より一般的に、情報処理システム100がN個の演算ユニットを有している場合について説明する。この場合、それぞれの演算ユニットには1番からN番までの番号(識別子)が付される。そして、「シード更新回数(mod 演算ユニット総数)」と一致する番号を有する演算ユニットに対し、制御部503は保存部502に格納されているシードを用いて乱数を生成させる。   More generally, a case where the information processing system 100 has N arithmetic units will be described. In this case, each arithmetic unit is assigned a number (identifier) from No. 1 to No. N. Then, the control unit 503 generates a random number using the seed stored in the storage unit 502 for the arithmetic unit having a number that matches the “seed update count (mod arithmetic unit total number)”.

<シード更新部504>
以下で、シード更新部504について説明する。シード更新部504は、保存部502に格納されているシードを更新する。またシード更新部504は、保存部502に格納されているシードを更新する際に、保存部502に格納されているシード更新回数を変更する。
<Seed update unit 504>
Hereinafter, the seed update unit 504 will be described. The seed update unit 504 updates the seed stored in the storage unit 502. The seed update unit 504 changes the number of seed updates stored in the storage unit 502 when updating the seed stored in the storage unit 502.

乱数生成器は通常、同一のシードからは同じ乱数を生成する。そこで、複数の乱数を生成するために、シードが更新される。つまりシード更新部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 seed update unit 504 updates the seed stored in the storage unit 502 every time the random number generation unit 505 generates a random number. At this time, the seed update unit can update the seed stored in the storage unit 502 using the random number generated by the random number generation unit 505 (see Non-Patent Document 1). For example, the seed update unit 504 may replace the seed stored in the storage unit 502 with the random number generated by the random number generation unit 505. Further, when updating the seed stored in the storage unit 502, the seed update unit 504 updates the number of times of seed update stored in the storage unit 502. For example, the seed update count may be incremented, and specifically, 1 may be added to the seed update count.

<乱数生成部505>
以下で、乱数生成部505について説明する。乱数生成部505は、制御部503に指示されると、保存部502に格納されているシードと、乱数生成器とを用いて乱数を生成する。そして乱数生成部505は、生成した乱数を素数判定部506に出力する。乱数生成器は、シードから乱数を生成する。乱数生成器は任意の公知の方法を用いて乱数を生成することができ、例えば、ハッシュ関数やブロック暗号アルゴリズムなどを用いることができる(非特許文献1を参照)。なお、保存部502に格納されているシード更新回数が限界シード更新回数を超えている場合には、乱数生成部505は乱数の生成を行わず、シード生成部501によって新しいシードが保存部502に格納されるのを待つ。
<Random number generator 505>
Hereinafter, the random number generation unit 505 will be described. When instructed by the control unit 503, the random number generation unit 505 generates a random number using the seed stored in the storage unit 502 and a random number generator. Then, the random number generation unit 505 outputs the generated random number to the prime number determination unit 506. The random number generator generates a random number from the seed. The random number generator can generate a random number using any known method, and for example, a hash function or a block encryption algorithm can be used (see Non-Patent Document 1). If the seed update count stored in the storage unit 502 exceeds the limit seed update count, the random number generation unit 505 does not generate a random number, and the seed generation unit 501 adds a new seed to the storage unit 502. Wait for it to be stored.

<素数判定部506>
以下で、素数判定部506について説明する。素数判定部506は、乱数生成部505が出力した乱数が素数であるか否かを判定する。素数判定には任意の公知の方法を用いることができ、例えばミラーラビン法を用いることができる(非特許文献2)。
<Prime number determination unit 506>
Hereinafter, the prime number determination unit 506 will be described. The prime number determination unit 506 determines whether the random number output from the random number generation unit 505 is a prime number. Arbitrary well-known methods can be used for prime number determination, for example, a Miller rabin method can be used (nonpatent literature 2).

素数判定部506は、乱数生成部505が出力した乱数が素数であると判断すると、素数生成が完了したことをCPU101に通知する。本実施例において素数判定部506は、乱数が素数であると判断すると、CPU101に生成された素数を転送する。また素数判定部506は、乱数が素数であると判断すると、保存部502に格納されている素数生成完了フラグをONにする。素数生成完了フラグは、素数の生成が完了した時にONとなり、素数の生成が完了していないときにOFFとなるフラグである。素数生成完了フラグを参照することにより、CPU101は素数が生成されたことを知ることができる。   If the prime number determination unit 506 determines that the random number output by the random number generation unit 505 is a prime number, the prime number determination unit 506 notifies the CPU 101 that the generation of the prime number has been completed. In this embodiment, if the prime number determination unit 506 determines that the random number is a prime number, the prime number generated is transferred to the CPU 101. When the prime number determination unit 506 determines that the random number is a prime number, the prime number generation unit 506 sets a prime number generation completion flag stored in the storage unit 502 to ON. The prime generation completion flag is a flag that is turned on when the generation of the prime number is completed and turned off when the generation of the prime number is not completed. By referring to the prime number generation completion flag, the CPU 101 can know that a prime number has been generated.

<本実施例に係る処理フロー>
以下、図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 CPU 101 and a process in the GPU 103. Therefore, in this specification, the processing flow in the CPU 101 and the processing flow in the GPU 103 will be described.

<CPU101における処理フロー>
図3は本実施例におけるCPU101で実行される処理フローを示すフローチャートである。ステップS301においてシード生成部501は、保存部502に格納されている素数生成完了フラグをOFFにする。ステップS302においてシード生成部501は、エントロピーソースにシードを作るのに十分なエントロピーが溜まっているか否かを確認する。所定量のエントロピーが溜まっていない場合、シード生成部501は所定量のエントロピーがエントロピーソースに溜まるのを待つ。所定量のエントロピーが溜まっている場合、処理はステップS303に進む。
<Processing flow in CPU 101>
FIG. 3 is a flowchart showing a processing flow executed by the CPU 101 in this embodiment. In step S301, the seed generation unit 501 turns off the prime generation completion flag stored in the storage unit 502. In step S <b> 302, the seed generation unit 501 confirms whether or not sufficient entropy is accumulated to make a seed in the entropy source. If the predetermined amount of entropy is not accumulated, the seed generation unit 501 waits for the predetermined amount of entropy to accumulate in the entropy source. If a predetermined amount of entropy has accumulated, the process proceeds to step S303.

ステップS303においてシード生成部501は、エントロピーソースからエントロピーを取得し、上述のようにシードを生成する。ステップS304においてシード生成部501は、限界シード更新回数を設定する。具体的にはシード生成部501は、予め定められた限界シード更新回数を保存部502に格納すればよい。ステップS305においてシード生成部501は、ステップS303で生成したシードを保存部502に格納する。限界シード更新回数及び生成されたシードは、メモリコントローラハブ106を介してGPU103へと転送される。   In step S303, the seed generation unit 501 acquires entropy from the entropy source, and generates a seed as described above. In step S304, the seed generation unit 501 sets the limit seed update count. Specifically, the seed generation unit 501 may store a predetermined limit seed update count in the storage unit 502. In step S305, the seed generation unit 501 stores the seed generated in step S303 in the storage unit 502. The limit seed update count and the generated seed are transferred to the GPU 103 via the memory controller hub 106.

ステップS306においてシード生成部501は、GPU103において素数の生成が完了したか否かを判定する。具体的には、保存部502に格納されている素数生成完了フラグがONであるか否かを判定すればよい。素数生成完了フラグがONであれば、ステップS307においてシード生成部はメモリコントローラハブ106を介して保存部502から生成された素数を取得する。そしてシード生成部501は、GPU103の処理を停止させる。素数生成完了フラグがOFFであれば、処理はステップS308に進む。   In step S <b> 306, the seed generation unit 501 determines whether generation of a prime number is completed in the GPU 103. Specifically, it may be determined whether or not the prime number generation completion flag stored in the storage unit 502 is ON. If the prime number generation completion flag is ON, the seed generation unit acquires the prime number generated from the storage unit 502 via the memory controller hub 106 in step S307. Then, the seed generation unit 501 stops the processing of the GPU 103. If the prime generation completion flag is OFF, the process proceeds to step S308.

ステップS308においてシード生成部501は、シードの再生成が必要であるか否かを判定する。具体的には上述のように、シード更新回数が限界シード更新回数を超える場合に、シード生成部501はシードの再生成が必要であると判定する。シードの再生成が必要である場合、処理はステップS302に戻る。シードの再生成が必要ではない場合、処理はステップS306に戻る。   In step S308, the seed generation unit 501 determines whether or not seed regeneration is necessary. Specifically, as described above, when the number of seed updates exceeds the limit seed update number, the seed generation unit 501 determines that seed regeneration is necessary. If it is necessary to regenerate the seed, the process returns to step S302. If seed regeneration is not necessary, the process returns to step S306.

<GPU103における処理フロー>
GPU103においては、GPU103の構成要素である演算ユニット201及び演算ユニット202が並列に処理を行う。演算ユニット201と202とは同じフローに従って処理を行う。したがって、本明細書においては演算ユニット201の処理フローについてのみ説明する。
<Processing flow in GPU 103>
In the GPU 103, the arithmetic unit 201 and the arithmetic unit 202 that are components of the GPU 103 perform processing in parallel. The arithmetic units 201 and 202 perform processing according to the same flow. Therefore, in this specification, only the processing flow of the arithmetic unit 201 will be described.

図4は、本実施例に係る演算ユニット201で実行される処理フローを示すフローチャートである。ステップS401において乱数生成部505は、CPU101から転送されたシードが保存部502に格納されているか否かを確認する。シードが格納されていない場合、乱数生成部505は保存部502にシードが格納されるまで待つ。シードが格納されている場合、ステップS402において乱数生成部505は、格納されているシードで乱数生成器を初期化する。   FIG. 4 is a flowchart illustrating a processing flow executed by the arithmetic unit 201 according to the present embodiment. In step S <b> 401, the random number generation unit 505 confirms whether or not the seed transferred from the CPU 101 is stored in the storage unit 502. If the seed is not stored, the random number generation unit 505 waits until the seed is stored in the storage unit 502. When the seed is stored, in step S402, the random number generation unit 505 initializes the random number generator with the stored seed.

ステップS403において乱数生成部505は、保存部502に格納されているシード更新回数と限界シード更新回数とを比較する。シード更新回数が限界シード更新回数を超えている場合、処理はステップS401に戻る。超えていない場合、処理はステップS404に進む。   In step S403, the random number generation unit 505 compares the seed update count stored in the storage unit 502 with the limit seed update count. If the seed update count exceeds the limit seed update count, the process returns to step S401. If not, the process proceeds to step S404.

ステップS404において乱数生成部505は、現在保存部502に格納されているシードを用いて乱数を生成してもよいかを、制御部503に問い合わせる。制御部503の詳細な処理については後述する。乱数を生成してはいけない場合、処理はステップS403に戻る。乱数を生成してもよい場合、処理はステップS405に進む。このステップS404により、複数の演算ユニットが同一のシードを用いて乱数を生成することが防止される。   In step S <b> 404, the random number generation unit 505 inquires of the control unit 503 whether a random number may be generated using the seed currently stored in the storage unit 502. Detailed processing of the control unit 503 will be described later. If a random number should not be generated, the process returns to step S403. If a random number may be generated, the process proceeds to step S405. This step S404 prevents a plurality of arithmetic units from generating random numbers using the same seed.

ステップS405において乱数生成部505は、保存部502にシードが格納されているか否かを再び確認する。シードが格納されていない場合、処理はステップS401に戻る。シードが格納されている場合、ステップS406において乱数生成部505は、保存部502に格納されているシードを用いて乱数を生成する。   In step S <b> 405, the random number generation unit 505 confirms again whether or not the seed is stored in the storage unit 502. If no seed is stored, the process returns to step S401. When the seed is stored, the random number generation unit 505 generates a random number using the seed stored in the storage unit 502 in step S406.

ステップS407において乱数生成部505は、ステップS406で生成された乱数を用いて、保存部502に格納されているシードを更新する。また乱数生成部505は、保存部502に格納されているシード更新回数をインクリメントする。ステップS408において素数判定部506は、ステップS406において生成された乱数が素数かどうかを判定する。生成された乱数が素数でないと判定された場合、処理はステップS403に戻る。生成された乱数が素数であると判定された場合、ステップS409において素数判定部506は保存部502に格納されている素数生成完了フラグをONにし、処理は終了する。   In step S407, the random number generation unit 505 updates the seed stored in the storage unit 502 using the random number generated in step S406. The random number generation unit 505 increments the number of seed updates stored in the storage unit 502. In step S408, the prime number determination unit 506 determines whether the random number generated in step S406 is a prime number. If it is determined that the generated random number is not a prime number, the process returns to step S403. If it is determined that the generated random number is a prime number, the prime number determination unit 506 turns on the prime generation completion flag stored in the storage unit 502 in step S409, and the process ends.

次に、複数の演算ユニット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 arithmetic units 201 and 202 from generating random numbers using the same seed will be described in detail. As described above, the arithmetic unit 201 has “0” as an identifier, and the arithmetic unit 202 has “1” as an identifier. In this embodiment, the total number of arithmetic units is “2”. Accordingly, the “number of seed updates (total number of mod operation units)” has a value of “0” or “1”. That is, when the identifier (“0”) for the arithmetic unit 201 does not match the “seed update count (mod arithmetic unit total number)”, the identifier (“1”) for the arithmetic unit 202 is “seed update count (mod The total number of computing units). The reverse is also true.

ステップS404において制御部503は、演算ユニットの識別子と「シード更新回数(mod 演算ユニット総数)」とが一致する場合に、演算ユニットに対して乱数の生成を許可する。演算ユニット201は、制御部503によって乱数の生成を許可されるまで、ステップS403〜S404を繰り返す。すなわち演算ユニット201は、演算ユニット201の識別子とシード更新回数(mod 演算ユニット総数)が一致するまで、ステップS403〜S404を繰り返す。   In step S404, the control unit 503 permits the arithmetic unit to generate a random number when the identifier of the arithmetic unit matches the “seed update count (mod arithmetic unit total number)”. The arithmetic unit 201 repeats steps S403 to S404 until generation of random numbers is permitted by the control unit 503. That is, the arithmetic unit 201 repeats steps S403 to S404 until the identifier of the arithmetic unit 201 matches the seed update count (mod arithmetic unit total number).

一方で演算ユニット201が乱数の生成を許可されていない際に、演算ユニット202は乱数の生成を許可されている。従って演算ユニット202は乱数を生成し、生成された乱数を用いて保存部502に格納されているシードを更新するとともに、シード更新回数に1を加える。シード更新回数が1つ増えると、演算ユニット201の識別子とシード更新回数(mod 演算ユニット総数)が一致する。このため、演算ユニット201は制御部503によって乱数の生成を許可される。一方で、今度は演算ユニット202の識別子とシード更新回数(mod 演算ユニット総数)が不一致となる。このため、演算ユニット202は保存部502に格納されているシードが更新されるまで、乱数の生成を許可されない。   On the other hand, when the arithmetic unit 201 is not permitted to generate random numbers, the arithmetic unit 202 is permitted to generate random numbers. Therefore, the arithmetic unit 202 generates a random number, updates the seed stored in the storage unit 502 using the generated random number, and adds 1 to the number of seed updates. When the seed update count increases by one, the identifier of the calculation unit 201 matches the seed update count (mod calculation unit total number). For this reason, the arithmetic unit 201 is permitted to generate a random number by the control unit 503. On the other hand, this time, the identifier of the arithmetic unit 202 and the seed update count (mod arithmetic unit total number) do not match. For this reason, the arithmetic unit 202 is not permitted to generate a random number until the seed stored in the storage unit 502 is updated.

このように、制御部503は保存部502に格納されているシード更新回数を監視する。そして制御部503は、シード更新回数の増加を検出することにより、ある演算ユニットによる乱数生成処理及びシード更新処理が終了したことを検知できる。制御部503は、ある演算ユニットによってシードが更新されたことを検出すると、別の演算ユニットに乱数の生成を許可する。このような処理により、演算ユニット201,202が同一のシードを用いて乱数を生成することを回避することができる。もっとも制御部503は、シードを更新した演算ユニットを特定する情報を参照して、別の演算ユニットに乱数の生成を許可してもよい。また制御部503は、演算ユニットが処理を行っているか否か、例えば素数判定処理を完了しているか否かを示すフラグを参照して、処理を行っていない1つの演算ユニットに対して乱数の生成を許可してもよい。このように制御部503は、様々な方法を用いて、1つのシードを用いた乱数の生成を特定の演算ユニットのみに行わせるように、演算ユニットを制御することができる。   As described above, the control unit 503 monitors the number of seed updates stored in the storage unit 502. And the control part 503 can detect that the random number generation process and seed update process by a certain arithmetic unit were complete | finished by detecting the increase in the number of times of seed update. When detecting that the seed has been updated by a certain arithmetic unit, the control unit 503 permits another arithmetic unit to generate a random number. By such processing, it is possible to avoid that the arithmetic units 201 and 202 generate random numbers using the same seed. However, the control unit 503 may allow another arithmetic unit to generate a random number with reference to information specifying the arithmetic unit whose seed has been updated. In addition, the control unit 503 refers to a flag indicating whether or not the arithmetic unit is processing, for example, whether or not the prime number determination process is completed, and generates a random number for one arithmetic unit that is not processing. Generation may be permitted. In this way, the control unit 503 can control the arithmetic unit using various methods so that only a specific arithmetic unit generates a random number using one seed.

以上説明したように本実施例によれば、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 number generation unit 505 inquires of the control unit 503 whether the random number may be generated using the seed stored in the storage unit 502. However, the prime number determination unit 506 may inquire of the control unit 503 whether or not the prime number determination may be performed. In this case, the control unit 503 can control the prime number determination unit 506 in the same manner as the control of the random number generation unit 505 in the first embodiment. In this case, the random number generation unit 505 may generate a random number using a seed stored in the storage unit 502 without making an inquiry. By doing so, it can be avoided that a plurality of arithmetic units determine whether or not the same random number generated using the same seed is a prime number.

<変形例2>
各演算ユニット201,202は別々のシードを用いてもよい。つまり、演算ユニットのそれぞれに対応付けられたシードが、保存部502に格納される。この場合、シード生成部501が生成した1つのシードが、それぞれの演算ユニットによって共通に用いられてもよい。各演算ユニット201,202は、対応付けられたシードを用いて、上述のように乱数生成、シード更新、及び素数判定を行う。
<Modification 2>
Each arithmetic unit 201, 202 may use a separate seed. That is, the seed associated with each of the arithmetic units is stored in the storage unit 502. In this case, one seed generated by the seed generation unit 501 may be commonly used by each arithmetic unit. Each arithmetic unit 201, 202 performs random number generation, seed update, and prime number determination as described above using the associated seed.

このとき素数判定部506は、シード更新回数(mod 演算ユニット総数)と識別子とが一致しない時には、乱数生成部505が生成した乱数が素数であるか否かを判定しない。こうすることにより、複数の演算ユニットが、同一のシードを用いて生成された同一の乱数について素数であるか否かを判定することを回避できる。   At this time, the prime number determination unit 506 does not determine whether or not the random number generated by the random number generation unit 505 is a prime number when the seed update count (mod operation unit total number) does not match the identifier. By doing so, it can be avoided that a plurality of arithmetic units determine whether or not the same random number generated using the same seed is a prime number.

<変形例3>
乱数生成部505が、保存部502に格納されているシードを用いて乱数を生成してもよいかを、制御部503に問い合わせることは必ずしも必須ではない。例えば乱数生成部505は、保存部502に格納されているシード更新回数を確認し、保存部502に現在格納されているシードを用いて乱数を生成してもよいかを判定することができる。この判定は、制御部503と同様に行うことができる。
<Modification 3>
It is not always essential that the random number generation unit 505 inquires of the control unit 503 whether the random number may be generated using the seed stored in the storage unit 502. For example, the random number generation unit 505 can check the number of seed updates stored in the storage unit 502 and determine whether a random number may be generated using the seed currently stored in the storage unit 502. This determination can be performed similarly to the control unit 503.

<変形例4>
各演算ユニット201,202は、ステップS408において素数を見つけた後に、その素数を用いて鍵生成処理を行ってもよい。この場合情報処理システム100は、並列に複数の鍵を生成することができる。
<Modification 4>
Each arithmetic unit 201, 202 may perform a key generation process using the prime number after finding the prime number in step S408. In this case, the information processing system 100 can generate a plurality of keys in parallel.

(他の実施形態)
本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)をネットワーク又は各種記憶媒体を介してシステム或いは装置に供給する。そして、そのシステム或いは装置のコンピュータ(又は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個の前記演算ユニットを備え、それぞれの演算ユニットは1番からN番までの番号を有し、
前記更新手段は、前記メモリに記録されている回数を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.
前記指示手段は、前記回数が所定回数を超える場合に、前記取得手段に新たな初期値を取得して前記メモリに格納させることを特徴とする、請求項2又は3に記載の情報処理装置。   The information processing apparatus according to claim 2, wherein the instruction unit causes the acquisition unit to acquire a new initial value and store it in the memory when the number of times exceeds a predetermined number. 前記更新手段は、前記回数が前記所定回数を超えている場合には、前記メモリに格納されているシードを取得せず、前記新たな初期値が前記メモリに格納されるのを待つことを特徴とする、請求項4に記載の情報処理装置。   The update means waits for the new initial value to be stored in the memory without acquiring the seed stored in the memory when the number of times exceeds the predetermined number of times. The information processing apparatus according to claim 4. 乱数を生成するために用いるシードを保持するメモリと、前記メモリに格納されているシードを用いて乱数を生成する複数の演算ユニットと、を備える情報処理装置が行う情報処理方法であって
前記情報処理装置の指示手段が、前記複数の演算ユニットのうち何れか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.
コンピュータを、請求項1乃至5の何れか1項に記載の情報処理装置の各手段として機能させるための、コンピュータプログラム。   A computer program for causing a computer to function as each unit of the information processing apparatus according to any one of claims 1 to 5.
JP2011164765A 2011-07-27 2011-07-27 Information processing apparatus, information processing method, and program Expired - Fee Related JP5713828B2 (en)

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 true JP2013029618A (en) 2013-02-07
JP5713828B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015031458A3 (en) * 2013-08-30 2015-06-25 Qualcomm Incorporated Methods and apparatuses for prime number generation and storage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05224604A (en) * 1991-09-27 1993-09-03 Internatl Business Mach Corp <Ibm> Method and apparatus for forming official and private key pair by using pass phrase
US20020186837A1 (en) * 2001-03-26 2002-12-12 Hopkins W. Dale Multiple prime number generation using a parallel prime number search algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05224604A (en) * 1991-09-27 1993-09-03 Internatl Business Mach Corp <Ibm> Method and apparatus for forming official and private key pair by using pass phrase
US20020186837A1 (en) * 2001-03-26 2002-12-12 Hopkins W. Dale Multiple prime number generation using a parallel prime number search algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6015004851; 鈴木昭弘 他: 'LANを用いた素数生成実験' 2007年度 精密工学会秋季大会 学術講演会講演論文集 , 20070903, p.631-632 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015031458A3 (en) * 2013-08-30 2015-06-25 Qualcomm Incorporated Methods and apparatuses for prime number generation and storage
US9800407B2 (en) 2013-08-30 2017-10-24 Qualcomm Incorporated Methods and apparatuses for prime number generation and storage

Also Published As

Publication number Publication date
JP5713828B2 (en) 2015-05-07

Similar Documents

Publication Publication Date Title
CN104364757B (en) Parallel processing of single data buffers
JP2019502211A5 (en)
US10536264B2 (en) Efficient cryptographically secure control flow integrity protection
JP5564197B2 (en) MEMORY CONTROL DEVICE, SEMICONDUCTOR MEMORY DEVICE, MEMORY SYSTEM, AND MEMORY CONTROL METHOD
JP2016535310A (en) Method and apparatus for generating and storing prime numbers
JP2012009928A (en) Encryption operation device, storage device, and encryption operation method
JP6044738B2 (en) Information processing apparatus, program, and storage medium
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
CN116204911B (en) Encryption and decryption system, encryption and decryption control method, computer device and storage medium
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
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
JP2014232301A (en) Apparatus and method for performing compression operation in hash algorithm
JP5113833B2 (en) ENCRYPTION METHOD AND ENCRYPTION APPARATUS FOR IMPROVING OPERATION PERFORMANCE OF A CENTRAL PROCESSOR
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
CN107749793A (en) The method for retrieving and device of a kind of public private key pair
JP5791562B2 (en) COMPRESSION FUNCTION OPERATION DEVICE, COMPRESSION FUNCTION OPERATION METHOD, AND PROGRAM
JP2011081594A (en) Data processor and data processing program

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