JPH0237383A - Prime number generating system - Google Patents

Prime number generating system

Info

Publication number
JPH0237383A
JPH0237383A JP63185631A JP18563188A JPH0237383A JP H0237383 A JPH0237383 A JP H0237383A JP 63185631 A JP63185631 A JP 63185631A JP 18563188 A JP18563188 A JP 18563188A JP H0237383 A JPH0237383 A JP H0237383A
Authority
JP
Japan
Prior art keywords
prime
prime number
numbers
candidate
odd
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP63185631A
Other languages
Japanese (ja)
Inventor
Yasuko Gotou
後藤 寧子
Kazuo Takaragi
和夫 宝木
Akio Nakagawa
中川 聡夫
Ryoichi Sasaki
良一 佐々木
Yasuhiro Ishii
保弘 石井
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.)
Hitachi Ltd
Hitachi Information and Control Systems Inc
Original Assignee
Hitachi Ltd
Hitachi Information and Control Systems 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 Hitachi Ltd, Hitachi Information and Control Systems Inc filed Critical Hitachi Ltd
Priority to JP63185631A priority Critical patent/JPH0237383A/en
Publication of JPH0237383A publication Critical patent/JPH0237383A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To effectively generate a prime number (p) by denoting a large prime factor contained in p-1 and a large prime factor contained in P+1 as (r) and (s), respectively, inputting (r) and (s) and using a computer. CONSTITUTION:A large prime factor to be contained in p-1 and a large prime factor to be contained in p+1 are denoted as (r) and (s), respectively, and by inputting (r) and (s), (g) which becomes s.g=1(mod r) is derived, and (p) which becomes p=U+2m.r.s is derived by setting U=-1+2.s.g (mod r s). In such a manner, a prime number candidate (p) in which p-1 contains the large prime factor (r), and also, p+1 contains the large prime factor (s) is generated. As a result the prime number candidate (p) being strong against a (p+ or -1) method prime factorization can be obtained effectively.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、(p±1)法素因数分解にも強い素数生成技
術に関するものであり、公開鍵暗号の鍵を生成するため
に利用される。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a prime number generation technology that is also strong against (p±1) modulus prime factorization, and is used to generate keys for public key cryptography. .

〔従来の技術〕[Conventional technology]

通信ネットワークを介して、会議や種々の取引を電子的
に行うビジネス通信の時代が始まり、情報セキュリティ
の必要性は増大しつつある。情報セキュリティを確保す
るための暗号技術の一つであるR3A暗号方式やRAB
IN暗号方式は、データ保護だけでなく、相手認証の機
能を持つことから、有用な暗号方式と考えられている。
As the era of business communications begins, in which meetings and various transactions are conducted electronically via communication networks, the need for information security is increasing. R3A encryption method and RAB, which are one of the encryption technologies to ensure information security.
The IN encryption method is considered to be a useful encryption method because it not only protects data but also has the function of authenticating the other party.

また、実用上のネックとされていた多大な暗号処理時間
も、ハードウェア、ソフトウェアの発展によって高速化
が実現し、今後ますますR3A暗号方式は注目されると
考えられる。
Furthermore, the long encryption processing time, which had been considered a practical bottleneck, has now been speeded up due to advances in hardware and software, and it is thought that the R3A encryption method will attract more and more attention in the future.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

R8A暗号方式は、暗号化鍵とてし、秘密鍵と公開鍵を
必要とするが、公開鍵から秘密鍵を推定するのは計算量
的に困難だとされている。つまり。
The R8A encryption system requires a private key and a public key as an encryption key, but it is said to be computationally difficult to estimate the private key from the public key. In other words.

R8A暗号方式の安全性は、公開鍵であるn=p×q(
p+qは素数)の素因数分解の困難さに依存することに
なる。しかし、(p±1)法素因数分解は、(p−1)
あるいは(p + 1)が小さな素数の積だけからなる
場合には、有効な素因数分解法があることを示している
。そこで、(p±1)法による素因数分解のアタックを
避けるため、(P±1)と(q±1)は大きな素数を含
むという条件を充たす手法が必要とされていた。
The security of the R8A encryption method is based on the public key n=p×q(
p+q is a prime number) depends on the difficulty of factoring into prime factors. However, (p±1) modulus factorization is (p−1)
Alternatively, if (p + 1) consists only of products of small prime numbers, this indicates that there is an effective prime factorization method. Therefore, in order to avoid the attack of prime factorization using the (p±1) method, a method is needed that satisfies the condition that (P±1) and (q±1) include large prime numbers.

また、素数P+’Tの生成においては、上記条件を充た
す素数候補を設定し、素数か否かを判定していく。素数
判定には、指数計算を必要とするフェルマーの定理を利
用するので、大きな素数の判定には計算時間がかかる。
Furthermore, in generating the prime number P+'T, prime number candidates that satisfy the above conditions are set, and whether or not they are prime numbers is determined. Fermat's theorem, which requires exponent calculation, is used to determine primality, so determining large primality requires calculation time.

素数判定には、一般にフェルマーの定理を利用したソロ
ベイーストラツセンの方式を用いる。ソロベイーストラ
ツセンの判定方法の概略を示す。
For primality testing, the Solovey-Stratsen method, which uses Fermat's theorem, is generally used. An outline of the determination method for Soloveystratus is shown below.

mを判定したい数として、gcd(a + m ) =
 1を満たすランダムな数a (1≦a≦m−1)を選
ぶ。
Let m be the number you want to judge, gcd(a + m) =
Select a random number a (1≦a≦m−1) that satisfies 1.

mが素数であれば、次式は成立する。If m is a prime number, the following equation holds.

J (a 、 m )= a”−1)/2(nod m
 )     ・= (1)ヤコビ関数は1次のように
再帰的関数である6J (a 、m)= aが1の場合  1 aが偶数の場合 J (a / 2 、m)x (−1)(”1)/8a
が奇数の場合 J(m(lIlod a)、a))X(1)(a−”(
I−1)74mが十分大きな整数の場合、いくつかの素
数8に対しく1)式が成立すれば、mは素数であると判
定するが、上式かられかるように1判定には多量の指数
計算を必要とするので時間がかかる。
J (a, m) = a”-1)/2(nod m
) ・= (1) The Jacobian function is a recursive function of first order 6J (a, m) = If a is 1, 1 If a is even, J (a / 2, m) x (-1) (”1)/8a
If is an odd number, J(m(lIlod a), a))X(1)(a-”(
I-1) If 74m is a sufficiently large integer, m is determined to be a prime number if formula 1) holds true for some prime numbers 8, but as seen from the above formula, there are too many It takes time because it requires index calculation.

そこで、既知の小さな素数の倍数であるか否かを判定す
ることで、予め素数候補となる数の選定を吟味し、素数
生成を高速化する。
Therefore, by determining whether the number is a multiple of a known small prime number, the selection of numbers to be prime number candidates can be carefully considered in advance, and prime number generation can be sped up.

これらの素数生成を含むR8A暗号鍵生成に関しては、
上記記載の特許出願公表57−502145号が出され
ているが、(p −1)および(p + 1)がそれぞ
れ大きな素数を含むという条件を同時に満たすpの条件
について考慮されていないという問題点がある。
Regarding R8A encryption key generation including these prime number generation,
Patent Application Publication No. 57-502145 described above has been published, but the problem is that it does not take into account the condition for p that simultaneously satisfies the condition that (p - 1) and (p + 1) each contain a large prime number. There is.

更に上記特許出願公表においては、素数候補の選定を、
既知の素数の積と素数候補の最大公約数の評価によって
行っているが、既知の素数範囲の最適値に関しては評価
されていないという問題点も挙げられる。R8A暗号や
RABIN暗号等では、計算量の多い128ビツト、2
56ビツト等の多倍長素数を必要するため特に、素数候
補の選定を行う必要があること、既知の素数の積は急速
に大きくなるので、既知素数の設定個数に限界があるこ
と、また多倍長計算によるプログラム上の制約があるこ
とから既知素数群の範囲評価は鍵生成実用化の上で不可
欠である。
Furthermore, in the publication of the above patent application, the selection of prime number candidates is
This is done by evaluating the product of known prime numbers and the greatest common divisor of prime number candidates, but there is also the problem that the optimal value of the range of known prime numbers is not evaluated. In R8A encryption, RABIN encryption, etc., 128 bits, 2
Since a multiple-precision prime number such as 56 bits is required, it is necessary to select prime number candidates in particular.Since the product of known prime numbers increases rapidly, there is a limit to the number of known prime numbers that can be set. Since there are program constraints due to double-length calculations, range evaluation of known prime numbers is essential for practical use in key generation.

〔課題を解決するための手段〕[Means to solve the problem]

上記間層を解決するために、次の手段を用いる。 In order to solve the above-mentioned interlayer, the following means are used.

1、 国の剰余 連判 による  ±1 法数 解に強
い素数候補の効率釣設 p−iが含むべき大きな素因数をr、p+1が含むべき
大きな素因数をSとし、rとSを入力として、p−1は
大きな素因数rを含み、かつp+1は大きな素因数Sを
含む素数pを生成する。
1. Efficiency of prime candidates that are strong against ±1 modulus solutions based on the country's remainder series Let r be the large prime factor that p−i should contain, S be the large prime factor that p+1 should contain, and with r and S as inputs, p− 1 produces a prime number p containing a large prime factor r, and p+1 contains a large prime factor S.

P−1は大きな素因数rを含む。P-1 contains a large prime factor r.

9 p = 1 (mad r)          
−(2)p+1は大きな素因数Sを含む。
9 p = 1 (mad r)
-(2) p+1 includes a large prime factor S.

a p = −1(mod s )         
−(3C(2)式、(3)式を満たすpを、次の中国の
剰余定理の補題を用いて求める。
a p = −1 (mod s )
-(3C Find p that satisfies equations (2) and (3) using the following lemma of the Chinese remainder theorem.

s、rが互いに索であることから、法rにおけるSの逆
光gが存在する。すなわち、 Seg=1 (IIIOd r)          
  …(4)ここで、上記補題において、x==−1,
y=1とすれば、 U=x+(y−x)+s+ g(mod rs)=−1
+2+ S ″ g(IIlOdrS)とし、 p=U+2mr  s            ・・・
(5)とおくと、pは(2)式、(3)式を満たす。こ
こで、mはOを除く任意の整数である。逆に、(4)式
Since s and r are mutually connected, there is a backlight g of S in the modulus r. That is, Seg=1 (IIIOd r)
...(4) Here, in the above lemma, x==-1,
If y=1, U=x+(y-x)+s+ g(mod rs)=-1
+2+ S ″ g (IIlOdrS), p=U+2mr s...
(5), p satisfies equations (2) and (3). Here, m is any integer except O. Conversely, equation (4).

(3)式を満たすいかなるpも、法rsのもとで。(3) Any p that satisfies equation (3) under the modulus rs.

(5)式と等価になる。従って、(4)式、(5)式の
計算により1条件(2)式、(3)式を満足するpを求
め。
It becomes equivalent to equation (5). Therefore, by calculating equations (4) and (5), p that satisfies one condition (2) and (3) is determined.

素数候補として設定する。Set as a prime number candidate.

えユ訓葭蒐上ヌによケ敢MijlIj列叉定既知素数群
{3、5,7,・・・ 、i(h)}の設定範囲を1期
待値評価を行うことで、最適化する。
Optimize the setting range of the known prime number group {3, 5, 7, ..., i(h)} by performing one expectation value evaluation. .

オーダーnの素数を生成する方式において、初期データ
kを入力データとして与え、kを基に素数候補となる奇
数rを設定する。
In a method for generating a prime number of order n, initial data k is given as input data, and an odd number r that is a prime number candidate is set based on k.

一方、既知素数群{3、5,7,・・・、i(h))を
設定する。ここで、m i (h)は素数3から数えて
h番目の素数であることを示し、素数設定時間とrが既
知素数の倍数であるか否かを判定するための処理準備時
間をto(h)とする、rが既知素数の倍数であるか否
かの判定時間をta(h)とし。
On the other hand, a group of known prime numbers {3, 5, 7, . . . , i(h)) is set. Here, m i (h) indicates the h-th prime number counting from prime number 3, and the prime number setting time and processing preparation time for determining whether r is a multiple of a known prime number are to( h), and let ta(h) be the time for determining whether r is a multiple of a known prime number.

フェルマーの定理を利用した方式により、奇数rが素数
であるか、否かを判定する時間をtbとする。素数でな
かった場合には、次の素数候補rを設定し、上記手順を
繰り返し、素数を生成する。
Let tb be the time for determining whether an odd number r is a prime number or not by a method using Fermat's theorem. If it is not a prime number, the next prime number candidate r is set and the above procedure is repeated to generate a prime number.

この時、M=3・5・7・・・・・1(h)とすると、
奇数rが素数(3・5・7・・・・・、i(h)}の何
れかの倍数でないと判定される確率: Z(h)は次式
%式% 但し、φ(M)はオイラー関数である。
At this time, if M = 3, 5, 7...1 (h),
Probability that the odd number r is not a multiple of any prime number (3, 5, 7..., i(h)): Z(h) is the following formula% However, φ(M) is It is Euler's function.

素数(3・5・7・・・・・、i(h)}の何れかの倍
数でない奇数rが得られるまでの平均時間:ta’(h
)は、 となり、オーダーnあたりでの素数の散らばりの間隔W
は1次式で与えられる。
The average time it takes to obtain an odd number r that is not a multiple of any prime number (3, 5, 7..., i(h)}: ta'(h
) becomes , and the interval W of scattering of prime numbers around order n
is given by a linear equation.

dn  In  n   (in  n)2既知素数の
倍数でない素数候補が得られる確率:p(h)は、次式
となる。
dn In n (in n)2 The probability of obtaining a prime number candidate that is not a multiple of a known prime number: p(h) is given by the following equation.

p(h)=                ・・・(
9)z(h)・−・W 素数が得られるまでの期待時間T(h)は、T(h)=
to(b)+P(h) (ta(h)+tb)+(I 
P(h))’P(h) ・2 ・(t a(h)+t 
b)+(1−P(h))2・P(h) ・3 ・(t、
 a (h)+ t b)+・・・・・・・・・ +(1−P(h))’P(h)(j+1)(t a(h
)十t b)+・・・・・・・・・ =to(h)+(t b+t a (h))”F!(h
)・・・(10) で表わし5期待値T(h)の値が小さくなるようなhを
予め求め、最適な素数群(3・5・7・・・白、i(h
)}を設定する。
p(h)=...(
9) z(h)・-・W The expected time T(h) until a prime number is obtained is T(h)=
to(b)+P(h) (ta(h)+tb)+(I
P(h))'P(h) ・2 ・(t a(h)+t
b) + (1-P(h))2・P(h) ・3 ・(t,
a (h)+t b)+・・・・・・・・・ +(1-P(h))'P(h)(j+1)(t a(h
) 10t b)+・・・・・・・・・=to(h)+(t b+t a (h))”F!(h
)...(10) Find in advance h such that the value of 5 expected value T(h) is small, and find the optimal prime number group (3, 5, 7...white, i(h
)}.

〔作用〕[Effect]

前記技術的手段により、次の作用が生じる。 The technical means described above result in the following effects.

P−1が含むべき大きな素因数をr、p+lが含むべき
大きな素因数をSとし、rとSを久方とじて、 s−g=1(+10d r)となるgを求め、U=−1
+2 ・s−g(+iod  r s) とし、p=U
+2m + r ―s となるpを求めることにより、p−1は大きな素因数r
を含み、かつP+1は大きな素因数Sを含む素数候補p
を生成する。
The large prime factor that P-1 should contain is r, the large prime factor that p+l should contain is S, and r and S are separated to find g such that s-g=1 (+10d r), and U=-1
+2 ・sg(+iod r s) and p=U
By finding p such that +2m + r -s, p-1 becomes a large prime factor r
and P+1 is a prime number candidate p containing a large prime factor S
generate.

従来、ジエー・ゴートン(J、Gordon)によって
示されていたUを求める計算式は、 U = s 「−1−r’−”(sod r s )で
あり、これは指数計算を行うので本手段と比較して計算
量が多い。
Conventionally, the calculation formula for calculating U that was shown by J. The amount of calculation is large compared to

従って、(P+1)法素因数分解に強い素数候補pを効
果的に得ることができる。
Therefore, it is possible to effectively obtain a prime number candidate p that is strong against (P+1) prime factorization.

2、素数生成の高速化 上記(10)式で与えられる評価式により、最適素数群
(3・5・7・・・・・、i(h)}の設定を行うこと
ができる。
2. Speeding up prime number generation Using the evaluation formula given by equation (10) above, it is possible to set the optimal prime number group (3, 5, 7, . . . , i(h)).

これにより、素数生成において、フエルマー定理利用の
素数判定を行う前に、素数(3・5・7・・・・・、i
(h)}の倍数であるか、否かの判定によって、素数候
補となる数を最適に絞り込むことができ、素数生成の効
率化を実現する。
As a result, in prime number generation, before performing primality test using Felmer's theorem, the prime number (3, 5, 7..., i
(h)} By determining whether or not the number is a multiple of }, it is possible to optimally narrow down the number of prime number candidates, thereby realizing efficiency of prime number generation.

〔実施例〕〔Example〕

第1〜5図により、本発明の詳細な説明する。 The present invention will be explained in detail with reference to FIGS. 1 to 5.

第1図は本発明による最適素数群設定方式を実施するハ
ードウェア構成を示し、キーボード102から入力した
初期データを基に、計算機101上で、メモリ104に
格納されているプログラムを用いて、CPU103が非
対称暗号鍵を生成する。生成した非対称鍵は、秘密鍵と
公開鍵であるから、鍵の管理を十分に行う必要がある。
FIG. 1 shows a hardware configuration for implementing the optimal prime number group setting method according to the present invention. generates an asymmetric encryption key. Since the generated asymmetric key is a private key and a public key, it is necessary to manage the key adequately.

そこで、秘密鍵(8)はフロッピー・ディスク105に
フロッピー・ディスク・リーダ・ライタ106を通して
格納、あるいは、ICカード107にICカード・リー
ダ・ライタ108を通して格納し、メモリ104には保
管しない、また、公開鍵(d、n)はメモリ104に一
時保管し、オンラインで公開鍵の配布するか、あるいは
秘密鍵格納用とは別のフロッピー・ディスクやICカー
ドに格納し、配布する。
Therefore, the private key (8) is stored on the floppy disk 105 through the floppy disk reader/writer 106, or stored on the IC card 107 through the IC card reader/writer 108, and is not stored in the memory 104. The public keys (d, n) are temporarily stored in the memory 104 and distributed online, or stored and distributed in a floppy disk or IC card separate from the one used for storing the private key.

以下5第2図において、計算機101上で行うRAS暗
号鍵生成処理手順について説明する。
Below, referring to FIG. 2, the RAS encryption key generation processing procedure performed on the computer 101 will be explained.

5tep201 :始め。5step201: Beginning.

5top202 :  (p±1)法素因数分解に強い
素数pを生成する。
5top202: Generates a prime p that is strong against (p±1) modulo prime factorization.

5tep203 :  (P±1)法素因数分解に強い
素数qを生成する。
5tep203: Generate a prime number q that is strong against (P±1) modulo prime factorization.

5tep204 :鍵dを生成する。5step 204: Generate key d.

5tap205 : Pp C1* dから鍵e、nを
生成する。
5tap205: Generate keys e and n from Pp C1*d.

5top206 :終り。5 top 206: End.

上記手順において、nは素数pと素数qの積になってい
る。素数pおよびqが持つべき条件、つまり(p±1)
法素因数分解に困難な素数p、およびqの生成処理(s
tep 2 Q 2、および5tep2 Q 3の処理
)の詳細手順を第3図のフローチャートにより説明する
In the above procedure, n is the product of prime number p and prime number q. The conditions that prime numbers p and q should have, that is, (p±1)
Generation process of prime numbers p and q that are difficult to factorize (s
The detailed procedure of steps 2 Q 2 and 5 tep 2 Q 3 will be explained with reference to the flowchart of FIG.

ここでは、(p−1)および(p + 1)が持つべき
大きな素数を、それぞれr、sとして、素数pの生成に
ついて示す、qも同様の処理を行う。
Here, the large prime numbers that (p-1) and (p + 1) should have are assumed to be r and s, respectively, and the same process is performed for q, which is shown in relation to the generation of the prime number p.

5tep301 :始め。5step301: Beginning.

5tep302 :素数rを生成する。5step 302: Generate a prime number r.

5tap303 :素数Sを生成する。5tap303: Generate prime number S.

5tep304 :素数r、sから、sod rにおけ
るSの逆元gを求める。
5tep304: Find the inverse element g of S in sod r from the prime numbers r and s.

5tep305 :U=−1+2 Ts jg (+a
od rs)として、Uを求める。
5tep305 :U=-1+2 Ts jg (+a
od rs), find U.

5tep306 :乱数mを生成する。(ただし、m>
step307 : p=:U’+2mr  s  と
して、pを求める。
5tep306: Generate random number m. (However, m>
Step 307: Find p as p=:U'+2mrs.

5tep308 :既知素数群{3、5,7,−、i(
h)}を設定する。
5tep308: Known prime number group {3, 5, 7, −, i(
h) }.

5tep309 : Pが素数{3、5,7,・=i(
h))の何れかの倍数であるか、否かを判 定する6倍数であれば、5tep311へ、倍数でなけ
れば5tap310に進む。
5tep309: P is a prime number {3, 5, 7, ・=i(
Determine whether or not it is a multiple of h)). If it is a multiple of 6, proceed to 5tap 311; if it is not a multiple, proceed to 5tap 310.

5tep310 : Pが素数であるか、否かを判定す
る。
5tep310: Determine whether P is a prime number or not.

素数であれば、 5tap312へ、素数でなければ5
tap311に進む。
If it is a prime number, go to 5tap312, if it is not a prime number, go to 5tap312.
Proceed to tap311.

5tap311 : Pに2rsを加え、5tep30
9に進む。
5tap311: Add 2rs to P, 5tep30
Proceed to step 9.

5tap312 :終了。5tap312: Finished.

次に第3図における、素数r、およびSの生成処理(s
tep3 Q 2、および5tap303の処理)の詳
細手順を第4図のフローチャー1−により説明する。こ
こでは、素数rの生成について示すが、Sについても同
様である。
Next, in FIG. 3, the generation process of prime numbers r and S (s
The detailed procedure of tep3 Q 2 and 5tap303 processing will be explained with reference to flowchart 1- in FIG. 4. Here, the generation of the prime number r will be described, but the same applies to S.

5tep401 :始め。5 step 401: Beginning.

5tep402 :乱数生成のための初期値k、および
生成素数のビット長mを設定する。
5tep402: Set the initial value k for random number generation and the bit length m of the generated prime number.

5tep403 : kとmを基に、乱数を生成し、素
数候補rを設定する。
5tep403: Generate a random number based on k and m and set a prime number candidate r.

5top4 Q 4 :小さな既知素数群を設定する。5top4 Q4: Set a small group of known prime numbers.

5tep405 : rが既知素数の倍数であるか、否
かを判定する。もし、rが既知素数の 倍数であれば、5top4 Q 7、倍数でなければ5
top406に進む。
5tep405: Determine whether r is a multiple of a known prime number. If r is a multiple of a known prime number, 5top4 Q 7, otherwise 5
Proceed to top 406.

5tep406 : rが素数であるか、否かを判定す
る。
5tep406: Determine whether r is a prime number.

もし素数であれば、5tap408、素数でなければ5
tep407に進む。
If it is a prime number, 5tap408, if it is not a prime number, 5tap408
Proceed to step 407.

5tep407 :次の素数候補rを設定し、5tep
405に進む。
5tep407: Set the next prime number candidate r, 5tep
Proceed to 405.

5top408 : 14数rを出力して終了する。5top408: Outputs 14 number r and ends.

上記手順において、5tap404 、5tep405
、あるいは5tap308 、5tep309の処理を
付加することで、5tep406 、あるいは5top
310の処理回数を減らすことができる。そこで、5t
ep404あるいは、steρ308での小さな既知素
数群の大きさをどの程度にすることが最適であるかを予
め評価しておく。
In the above procedure, 5tap404, 5tep405
, or by adding the processing of 5tap308 and 5tep309, 5tep406 or 5top
The number of times 310 is processed can be reduced. Therefore, 5t
The optimal size of the small group of known prime numbers in step ep404 or step ρ308 is evaluated in advance.

次に、第5図のフローチャートにより、第3図および第
4図における既知製数群設定(step308、および
5tep404の処理)のための既知素数群の範囲評価
について説明する。
Next, with reference to the flowchart of FIG. 5, the range evaluation of the known prime number group for setting the known production number group in FIGS. 3 and 4 (processing in steps 308 and 5step 404) will be described.

5tep501 :始め。5step501: Beginning.

5tsp502 :乱数生成のための初期値に′、およ
び生成素数のビット長m′を設定す る。
5tsp502: Set the initial value for random number generation and the bit length m' of the generated prime number.

5tep503 : k’ とm′を基に、乱数を生成
し。
5tep503: Generate random numbers based on k' and m'.

素数候補n′を設定する。Set prime number candidate n'.

5tep504 : nあたりでの素数の散らばりの間
隔Wを次式により求める。
5tep504: Find the interval W of scattering of prime numbers around n using the following formula.

i    n’    lnn’、−1dn  in 
 n’  (in  n’)”5tap505 : h
 、 T(h)の初期値設定をする。
i n'lnn', -1dn in
n' (in n')"5tap505: h
, Set the initial value of T(h).

5tsp506 : hに1を加算する。5tsp506: Add 1 to h.

5tap507 : 3がら始まるh個の既知素数群を
設定する。また、5top 309、あるいは5tap
405で必要な前処理に必要な処理も行う、ここでの処
理時間を to(h)とする。
5tap507: Set a group of h known prime numbers starting with 3. Also, 5top 309 or 5tap
Processing necessary for the necessary preprocessing is also performed in step 405, and the processing time here is assumed to be to(h).

steρ508:rが既知素数の倍数であるが、否かを
判定する。ここでの処理時間を ta()1)とする。
step 508: Determine whether r is a multiple of a known prime number. The processing time here is assumed to be ta()1).

5tap509 : rが素数であるが、否かを判定す
る。
5tap509: Determine whether r is a prime number.

ここでの処理時間をtbとする。The processing time here is assumed to be tb.

steρ510:素数生成までの期待値時間を以下の手
順で求める。
step 510: Find the expected value time until prime number generation using the following procedure.

(1)奇数nが素11候捕になる確率z(h)は、M=
3・5・7・・・・・1(h)とすると(6)式で与え
られる。
(1) The probability z(h) of an odd number n becoming a prime 11 candidate is M=
3.5.7...1(h) is given by equation (6).

(2)上記5tep311、すなわち倍数除去用の素数
り個のいずれの倍数でないAが得られるまでの平均時間
ta’(h)は(7)式で与えられる。
(2) The above 5tep 311, that is, the average time ta'(h) until obtaining A that is not a multiple of any of the prime numbers for multiple removal is given by equation (7).

(3) 5tep311が終了した時点でのn′が素数
である確率p(h)は、(9)式で与えられる。
(3) The probability p(h) that n' is a prime number at the end of 5tep 311 is given by equation (9).

(4)素数が得られるまでの期待値時間T(h)は(1
0)式で与えられる。
(4) The expected value time T(h) until a prime number is obtained is (1
0) is given by Eq.

5tep511 : T(h −1)  T(h)>0
であれば、5tep506に戻り、T(h −1)−T
(h)≦0であれば、5tep512に進む。
5tep511: T(h-1) T(h)>0
If so, return to step 506 and calculate T(h −1)−T
If (h)≦0, the process advances to step 512.

5top512 : T(h)が最小値となる。3から
始まるh個までの素数を最適素数群とし て出力する。
5top512: T(h) becomes the minimum value. Output h prime numbers starting from 3 as the optimal prime number group.

5tap513 :終了。5tap513: Finished.

実施例の変形例1 第3図において、5top304 、5tep305を
次の式に置き換えて、素数候補Uの設定を行う。qも同
様の処理を行う。
Modification 1 of the Embodiment In FIG. 3, 5top 304 and 5tep 305 are replaced with the following equations to set the prime number candidate U. Similar processing is performed for q.

5tep304 :素数r、sから、lll0dsにお
けるrの逆光g′を求める。
5tep304: Find the backlight g' of r at lll0ds from the prime numbers r and s.

5tep305 :U=1−2 +r 参g’  (n
od rs)として、Uを求める。
5tep305: U=1-2 +r referenceg' (n
od rs), find U.

実施例の変形例2 Step510では期待値計算を行っているが、評価方
式はこの限りではない。
Modification 2 of Embodiment Although expected value calculation is performed in Step 510, the evaluation method is not limited to this.

例えば、上記実施例において、5tep510における
T(h)を以下の式に置き換えて処理する。
For example, in the above embodiment, T(h) in step 510 is replaced with the following formula.

実施例の変形例3 実施例、および変形例1で示したhの値は、生成する素
数の大きさ、計算機に依存して設定される。hの評価に
ある程度の処理時間を必要とするので、運用機決定後、
予めhを、計算機102上で、メモリ104に格納され
たプログラムによって評価し、生成素数の大きさとhと
の関係をメモリに格納しておく。
Modification 3 of Example The value of h shown in the Example and Modification 1 is set depending on the size of the prime number to be generated and the computer. Since a certain amount of processing time is required to evaluate h, after determining the operational equipment,
h is evaluated in advance on the computer 102 by a program stored in the memory 104, and the relationship between the size of the generated prime number and h is stored in the memory.

実施例の変形例4 上記実施例と同様手順で、RABIN暗号化鍵生成を行
う。
Modification 4 of Embodiment RABIN encryption key generation is performed in the same procedure as in the above embodiment.

RABIN暗号化鍵は、2つの大きな素数p。The RABIN encryption key is two large prime numbers p.

qを選び、その積n”p ’ qを計算する。次にO≦
b (nになるbを定める。この時、公開鍵は(n、b
)であり、秘密鍵は(p、q)となる。
Select q and calculate its product n''p' q. Next, O≦
Define b to be b (n. At this time, the public key is (n, b
), and the secret key is (p, q).

従って、第2図の5tep 204〜5tep 206
は次の5tep204 ’ 、 5tep205 ’ 
に置き換えRABIN暗号化鍵を生成を行う。
Therefore, 5tep 204 to 5tep 206 in FIG.
are the following 5tep204', 5tep205'
, and generate a RABIN encryption key.

5tep204’  :乱数すを生成する。5tep204': Generate random numbers.

5tep205’  :終わり。5tep205': End.

実施例の変形例5 生成する素数のビット長を要求に合わせることを考慮し
、各乱数の生成(step306 、5tep403)
、素数候補の選定(step 307 + 5tep 
311 、5tep407)において、ビット長調整機
能を付加する。
Modified example 5 of the embodiment Generate each random number (step 306, step 403), taking into consideration the bit length of the prime number to be generated to match the request.
, selection of prime number candidates (step 307 + 5step
311, 5tep407), a bit length adjustment function is added.

実施例の変形例6 以上は、計算機上のプログラムによる処理を前・提とし
ているが、第2図〜第5図の演算の一部、あるいは全部
を専用ハードウェア化することで実現することもできる
Modified example 6 of the embodiment The above is based on the premise that processing is performed by a program on a computer, but it may also be realized by implementing some or all of the calculations in Figures 2 to 5 to dedicated hardware. can.

〔効果〕〔effect〕

本発明によれば以下の効果がある。 According to the present invention, there are the following effects.

(1)従来発表されている J、Gordonの式U= sr″″” −r”−” 
(mad r s )に比べ、計算量が少なく、効率的
に(p±1)私製因数分解に強い素数候補pを得ること
ができる。
(1) Previously announced J. Gordon formula U = sr″″” −r”−”
Compared to (mad r s ), the amount of calculation is small, and it is possible to efficiently obtain a prime number candidate p that is resistant to (p±1) private factorization.

(2)フエルマー定理利用の素数判定を行う前に、素数
(3・5・7・・・・・、i(h)}の倍数であるか。
(2) Is it a multiple of a prime number (3, 5, 7, etc., i(h)) before performing primality test using Fulmer's theorem?

否かの判定によって、素数候補となる数を最適に絞り込
むことにより、素数生成を効率化できる。
The efficiency of prime number generation can be improved by optimally narrowing down the number of prime number candidates by determining whether or not this is the case.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明による、最適製数群設定方式を実施す
るハードウェア構成図、第2図は1本発明を含むR8A
暗号鍵生成手順のフローチャート、第3図は1本発明の
(p±1)私製因数分解に強い素数の生成処理手順のフ
ローチャート、第4図は、素数生成処理手順のフローチ
ャート、第5図は、第3図、第4図に示す本発明の既知
素数群設第 1 図 F3の 茅2[2]
FIG. 1 is a hardware configuration diagram implementing the optimal manufacturing number group setting method according to the present invention, and FIG. 2 is a diagram of the R8A including the present invention.
FIG. 3 is a flowchart of the encryption key generation procedure. FIG. 3 is a flowchart of the present invention's (p±1) prime number generation process that is strong against private factorization. The known prime number group of the present invention shown in FIGS. 3 and 4.

Claims (1)

【特許請求の範囲】 1、(p±1)法素因数分解に強い素数rとs(rは(
p−1)が含むべき大きな素因数 sは(p+1)が含むべき大きな素因数)を入力として
、素数pを計算機を用いて生成する方式において、i、
jを整数、mは正整数とし、法rにおけるsの逆元g、
すなわち s・g=1(mod r) となるgを求め、 U=(−1+i・s)+(2+j・r−i・s)s・g
(mod rs)とし、 P=U+2mr s となるpを素数候補として出力することを特徴とする素
数生成方式。 2、(p±1)法素因数分解に強い素数rとs(rは(
p−1)が含むべき大きな素因数、sは(p+1)が含
むべき大きな素因数)を入力として、素数pを計算機を
用いて生成する方式において、i、jを整数、mを正整
数とし、法sにおけるrの逆元g′、すなわち r・g′=1(mod s) となるg′を求め、 U=(1+j・r)+(−2+i・s−j・r)s・g
′(mod rs)とし、 p=U+2mr s となるpを素数候補とすることを特徴とする素数生成方
式。 3、計算機を用いて所定の奇数nと同程度の大きさを持
つ素数を生成する方式であつて、素数3から始めて、小
さい順に並べたh個の素数の集合、すなわち{3、5、
7、・・・、i(h)}を計算機に設定するとともに、
nが{3、5、7、・・・、i(h)}の各素数の倍数
であるか否かを判定するための準備処理に必要な処理時
間をto(h)とし、前記奇数nに対し、nが{3、5
、7、・・・、i(h)}の各素数の倍数であるか否か
を判定する時間をta(h)とし、前記nが素数である
か否かをフエルマー定理を利用した方式により計算機で
判定する時間をtbとし、Z(h)=2/3・4/5・
……・i(h)−1/i(h)ta′(h)=ta(h
)/Z(h)、 ▲数式、化学式、表等があります▼、▲数式、化学式、
表等があります▼ とした時、 T(h)=t_0(h)+(tb+ta′(h))・{
P(h)−1+〔1/P(h)〕} として、T(h)の値が小さくなるようなhの値に対し
て、素数3から始めてh個の素数の集合を予め求めてお
き、前記nと同程度の大きさの奇数の素数候補Rが素数
であるかどうかを判定する場合に、先ず、前記Rが前記
素数{3、5、7、・・・、i(h)}のいずれかの倍
数でないかどうかを判定し、いずれの倍数でもないこと
が判定された後に、フエルマー定理を利用した素数判定
を行うことを特徴とする素数生成方式。 4、前記T(h)を、 T(h)=t_0(h)+ta(h)・1/2W+tb
・z(h)・1/2・W とする第3項の素数生成方式。 5、前記奇数の素数候補Rが前記素数{3、5、7、・
・・、i(h)}のいずれかの倍数であると判定された
場合、該Rは素数でないと判定する第3項の素数生成方
式。 6、前記奇数の素数候補Rが前記素数{3、5、7、・
・・、i(h)}の何れかの倍数であると判定された場
合、あるいはフエルマーの定理によつて合成数だと判断
された場合、該Rを基に、次の素数候補を算出した後、
新たなRとして設定する第3項の素数生成方式。 7、前記奇数の素数候補Rが前記素数{3、5、7、・
・・、i(h)}の何れかの倍数であるか否かの判定は
、該Rと前記各素数のmod計算によつておこなう第3
項の素数生成方式。
[Claims] 1. Prime numbers r and s (r is (
In a system in which a prime number p is generated using a computer by inputting a large prime factor s that should be included in (p-1) is a large prime factor that should be included in (p+1), i,
j is an integer, m is a positive integer, and the inverse element g of s in the modulus r,
In other words, find g such that s・g=1 (mod r), and get U=(-1+i・s)+(2+j・r−i・s)s・g
(mod rs), and outputs p such that P=U+2mr s as a prime number candidate. 2. Prime numbers r and s (r is (
In this method, a prime number p is generated using a computer by inputting a large prime factor that p-1) should contain, and s a large prime factor that (p+1) should contain, where i and j are integers, m is a positive integer, and Find the inverse element g' of r in s, that is, g' such that r・g′=1 (mod s), and obtain U=(1+j・r)+(−2+i・s−j・r)s・g
'(mod rs), and p=U+2mr s is used as a prime number candidate. 3. A method of generating prime numbers with the same size as a predetermined odd number n using a computer, starting from the prime number 3, a set of h prime numbers arranged in ascending order, that is, {3, 5,
7, ..., i(h)} on the calculator, and
Let to(h) be the processing time required for the preparation process to determine whether n is a multiple of each prime number of {3, 5, 7, ..., i(h)}, and the odd number n For, n is {3, 5
, 7, . Let tb be the time to judge by computer, Z(h)=2/3・4/5・
...・i(h)-1/i(h)ta'(h)=ta(h
)/Z(h), ▲There are mathematical formulas, chemical formulas, tables, etc.▼, ▲Mathematical formulas, chemical formulas,
There are tables etc. ▼ When , T(h)=t_0(h)+(tb+ta'(h))・{
As P(h)-1+[1/P(h)}, for the value of h that makes the value of T(h) small, find a set of h prime numbers in advance, starting from prime number 3. , when determining whether an odd prime number candidate R having the same size as the n is a prime number, first, the R is the prime number {3, 5, 7, . . . , i(h)}. A prime number generation method characterized by determining whether the number is not a multiple of any one of the following, and after determining that it is not a multiple of any of the numbers, performing a primality test using the Fulmer theorem. 4. The above T(h) is T(h)=t_0(h)+ta(h)・1/2W+tb
・3rd term prime generation method where z(h)・1/2・W. 5. The odd prime number candidate R is the prime number {3, 5, 7, .
. . , i(h)}, the third term determines that R is not a prime number. 6. The odd prime number candidate R is the prime number {3, 5, 7, .
. rear,
The third term prime number generation method is set as a new R. 7. The odd prime number candidate R is the prime number {3, 5, 7, .
. . , i(h)}, the third
Prime number generation method for terms.
JP63185631A 1988-07-27 1988-07-27 Prime number generating system Pending JPH0237383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63185631A JPH0237383A (en) 1988-07-27 1988-07-27 Prime number generating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63185631A JPH0237383A (en) 1988-07-27 1988-07-27 Prime number generating system

Publications (1)

Publication Number Publication Date
JPH0237383A true JPH0237383A (en) 1990-02-07

Family

ID=16174156

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63185631A Pending JPH0237383A (en) 1988-07-27 1988-07-27 Prime number generating system

Country Status (1)

Country Link
JP (1) JPH0237383A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002515613A (en) * 1998-05-08 2002-05-28 サーティコム コーポレーション Private key validity and confirmation
US7043018B1 (en) 1998-11-27 2006-05-09 Murata Kikai Kabushiki Kaisha Prime number generation method, prime number generation apparatus, and cryptographic system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61281334A (en) * 1985-06-07 1986-12-11 Nec Corp Prime number deciding device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61281334A (en) * 1985-06-07 1986-12-11 Nec Corp Prime number deciding device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002515613A (en) * 1998-05-08 2002-05-28 サーティコム コーポレーション Private key validity and confirmation
JP4731686B2 (en) * 1998-05-08 2011-07-27 サーティコム コーポレーション Validation and confirmation of the private key
US7043018B1 (en) 1998-11-27 2006-05-09 Murata Kikai Kabushiki Kaisha Prime number generation method, prime number generation apparatus, and cryptographic system

Similar Documents

Publication Publication Date Title
US6704870B2 (en) Digital signatures on a Smartcard
JP5329676B2 (en) Accelerating key agreement protocols
US6816594B1 (en) Elliptic curve generating method and device, elliptic encryption system and recording medium
JP4137385B2 (en) Encryption method using public and private keys
US7912216B2 (en) Elliptic curve cryptosystem optimization using two phase key generation
US20110161390A1 (en) Modular multiplication processing apparatus
US8121290B2 (en) Pseudo-random function calculating device and method and number-limited anonymous authentication system and method
Renes et al. qDSA: small and secure digital signatures with curve-based Diffie–Hellman key pairs
US7486789B2 (en) Device and method for calculation on elliptic curve
JPH06505343A (en) Method, identification device and verification device for identification and/or digital signature
CN111325535A (en) Block chain private key management method, system and storage medium based on elliptic curve migration
US20020154768A1 (en) Generating RSA moduli including a predetermined portion
JP4977300B2 (en) Cryptography and equipment
EP0952697B1 (en) Elliptic curve encryption method and system
US20020041683A1 (en) Method for selecting optimal number of prime factors of a modulus for use in a cryptographic system
CN113158253A (en) Privacy union method and device
JP5336056B2 (en) Point addition method and addition arithmetic unit in binary finite field for realizing defect detection operation using high-speed Montgomery power ladder algorithm
JPH0237383A (en) Prime number generating system
JP2000137436A (en) Calculating method of point on elliptic curve on prime field and device therefor
CN114868175A (en) Final power calculation device, pairing operation device, encryption processing device, final power calculation method, and final power calculation program
Moldovyan et al. Short signatures from the difficulty of factoring problem
JP3796867B2 (en) Prime number determination method and apparatus
Lory Secure distributed multiplication of two polynomially shared values: Enhancing the efficiency of the protocol
JP3518680B2 (en) Prime number generator
JP2002508523A (en) Fast finite field operation on elliptic curves