KR101918741B1 - Method for distinction of safe prime number - Google Patents

Method for distinction of safe prime number Download PDF

Info

Publication number
KR101918741B1
KR101918741B1 KR1020170105530A KR20170105530A KR101918741B1 KR 101918741 B1 KR101918741 B1 KR 101918741B1 KR 1020170105530 A KR1020170105530 A KR 1020170105530A KR 20170105530 A KR20170105530 A KR 20170105530A KR 101918741 B1 KR101918741 B1 KR 101918741B1
Authority
KR
South Korea
Prior art keywords
test
gcd
prime
numbers
random number
Prior art date
Application number
KR1020170105530A
Other languages
Korean (ko)
Inventor
박희진
조호성
Original Assignee
국방과학연구소
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 국방과학연구소 filed Critical 국방과학연구소
Priority to KR1020170105530A priority Critical patent/KR101918741B1/en
Application granted granted Critical
Publication of KR101918741B1 publication Critical patent/KR101918741B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2207/00Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F2207/72Indexing scheme relating to groups G06F7/72 - G06F7/729
    • G06F2207/7204Prime number generation or prime number testing

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The present invention discloses a safe prime number determining method which combines the greatest common divisor (GCD) test using a property that a random number r is not a prime number and a Miller-Rabin (MR) test determining the prime number according to a result value performing a modular exponentiation computation for the random number r, if the greatest common denominator of the random number r and the prime numbers is not equal to 1. A prime number determining device comprises a GCD computation module and a modular exponentiation computation module.

Description

안전소수 판별 방법{METHOD FOR DISTINCTION OF SAFE PRIME NUMBER}{METHOD FOR DISTINCTION OF SAFE PRIME NUMBER}

본 발명은 자기 자신이 소수일 뿐만 아니라 자기 자신에서 1을 빼고 2를 나눈 수 역시 소수인 수를 의미하는 안전소수를 판별하는 방법에 관한 것이다.The present invention relates to a method for determining a safety factor, which is not only a prime factor but also a number obtained by dividing 2 by 1, which is a prime number.

큰 소수는 현재 암호학의 기초로서 RSA(Rivest Shamir Adleman), ElGamal, DSS(Digital Signature Standard), ECC(Elliptic Curve Cryptosystems)와 같은 표준 공개키 암호 시스템에서 널리 이용되고 있다.Large primes are widely used in standard public key cryptosystems such as RSA (Rivest Shamir Adleman), ElGamal, Digital Signature Standard (DSS), and ECC (Elliptic Curve Cryptosystems) as the basis of current cryptography.

오늘날 더욱 진보된 악성 공격들로부터 이러한 시스템들을 안전하게 유지하기 위해서는 더욱 큰 소수가 요구되고 있는 실정이다. 예시적으로, 초기의 RSA는 512비트의 키를 이용했지만 현재는 1024비트에서 2048비트의 키까지 요구되고 있다.Today, there is a greater need to keep these systems safe from more advanced malicious attacks. By way of illustration, the initial RSA used a 512-bit key, but now requires a key of 1024 bits to 2048 bits.

일반적으로, 소수를 생성 또는 판별할 때에는 먼저 임의의 홀수 난수를 생성하여 소수인지 검사하고, 소수일 경우 그 값을 반환하며, 소수가 아닌 경우에 난수를 다시 생성하여 소수인지 새롭게 검사하는 과정을 반복하게 된다. 이 중 소수인지 검사하는 과정에 매우 많은 시간이 소모된다.Generally, when generating or discriminating a prime number, first generate an arbitrary odd random number and check whether it is a prime number. If the prime number is a prime number, the value is returned. If the prime number is not a prime number, . It is very time consuming to check whether the number is a prime number.

한편, RSA 암호 알고리즘 등과 같은 정보보호 알고리즘을 사용하는 컴퓨팅 환경은 다양한 형태로 급속히 변화되는 추세에 있으며, 이에 맞추어 보다 빨리 안전소수를 판별하기 위한 방법을 연구할 필요가 있다.On the other hand, computing environments using information protection algorithms such as RSA encryption algorithms are rapidly changing in various forms, and it is necessary to study a method for determining safety fractions more quickly.

대한민국 등록특허공보 제10-1731921호, 공개일자 2017년 04월 25일.Korean Registered Patent No. 10-1731921, published on April 25, 2017.

이에 해결하고자 하는 과제는, 난수 r과 소수들의 최대공약수가 1이 아닐 경우에 난수 r은 소수가 아니라는 성질을 이용하는 GCD 테스트(Greatest Common Divisor Test)와 난수 r에 대한 모듈러 지수 연산을 수행한 결과값에 따라 소수를 판별하는 MR 테스트(Miller-Rabin Test)를 조합하여 안전소수를 판별하는 방법을 제공한다.The problem to be solved is that the GCD test (Greatest Common Divisor Test), which uses a property that the random number r is not a prime number when the greatest common divisor of r is 1 and the random number r is not a prime number, (Miller-Rabin Test) that discriminates the prime numbers according to the number of the users.

해결하고자 하는 과제는 이상에서 언급한 것으로 제한되지 않으며, 언급되지 않은 또 다른 해결하고자 하는 과제는 아래의 기재로부터 본 발명이 속하는 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The problems to be solved are not limited to those mentioned above, and another problem to be solved which is not mentioned can be clearly understood by those skilled in the art from the following description.

제 1 실시예에 따르면, 안전소수 판별 장치에서 수행하는 안전소수 판별 방법은, k개의 소수를 차례대로 서로 곱하되 곱한 값의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족하는 소수들을 그룹화하여 s개의 소수 그룹으로 나누고, 각 소수 그룹에 속한 소수들의 곱을 테스트용 소수(

Figure 112017080596000-pat00001
)로 선정하는 단계(단, i는 1에서 s까지의 자연수)와, n-bit 크기의 홀수 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=
Figure 112017080596000-pat00002
) 및 상기 s개의 테스트용 소수(
Figure 112017080596000-pat00003
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트를 수행하는 단계와, 상기 GCD 테스트를 통과하는 경우에, 상기 r1 및 상기 r2에 대해 m회의 모듈러 지수 연산을 수행하여 산출된 결과값이 '1' 또는 'r-1'인지를 판별하는 MR 테스트를 수행하는 단계와, 상기 MR 테스트를 통과하는 경우에, 상기 난수(r)를 안전소수로 판별하는 단계를 포함한다.According to the first embodiment, a safety factor determining method performed by a safety factor determining apparatus includes: grouping prime numbers that are multiplied by k prime numbers in sequence and multiplied by a value smaller than m-bit, Divide the number of prime numbers belonging to each prime group into prime numbers
Figure 112017080596000-pat00001
(Where i is a natural number from 1 to s) and an odd random number r of n-bit size are r 1 (where r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00002
) And the s test small numbers (
Figure 112017080596000-pat00003
), Performing a GCD test to determine if the greatest common divisor of the two numbers is 1; and, if the GCD test passes, performing a modular exponentiation operation on the r 1 and r 2 times, Performing an MR test to determine whether the calculated result value is '1' or 'r-1'; and if the MR test is passed, determining the random number (r) as a safety decimal number .

제 2 실시예에 따르면, 소수 판별 장치는, k개의 소수를 차례대로 서로 곱하되 곱한 값의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족하는 소수들을 그룹화하여 s개의 소수 그룹으로 나누고, 각 소수 그룹에 속한 소수들의 곱을 테스트용 소수(

Figure 112017080596000-pat00004
)로 선정(단, i는 1에서 s까지의 자연수)하며, n-bit 크기의 홀수 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=
Figure 112017080596000-pat00005
) 및 상기 s개의 테스트용 소수(
Figure 112017080596000-pat00006
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트를 수행하는 GCD 연산 모듈과, 상기 GCD 테스트를 통과한 상기 난수(r)에 의한 상기 r1 및 상기 r2에 대해 m회의 모듈러 지수 연산을 수행하여 산출된 결과값이 '1' 또는 'r-1'인지를 판별하는 MR 테스트를 수행하고, 상기 MR 테스트를 통과하는 경우에 상기 난수(r)를 안전소수로 판별하는 모듈러 지수 연산 모듈을 포함한다.According to the second embodiment, the prime number discriminating apparatus divides prime numbers that are multiplied by k prime numbers in order and multiplied by a value smaller than m-bit but satisfy a condition as large as possible, into groups of s number of prime numbers, The product of the prime numbers in the group is the test fraction (
Figure 112017080596000-pat00004
(Where r is a natural number from 1 to s) and r 1 (where r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00005
) And the s test small numbers (
Figure 112017080596000-pat00006
), A GCD operation module for performing a GCD test to determine whether the greatest common divisor of the two numbers is 1, and a GCD operation module for performing a GCD test on the r 1 and r 2 by the random number (r) Modulo exponentiation to perform a MR test to determine whether the resultant value is '1' or 'r-1', and when the MR test is passed, a modulo (r) And an exponentiation module.

본 발명의 실시예에 따르면, GCD 테스트와 MR 테스트를 조합하여 난수 r이 안전소수인지 여부를 판별함으로써, 종래보다 더 빠르게 안전소수를 판별할 수 있는 효과가 있다.According to the embodiment of the present invention, the combination of the GCD test and the MR test can discriminate whether the random number r is a safety decimal number or not, thereby determining the safety decimal number faster than before.

도 1은 본 발명의 실시예에 따른 안전소수 판별 장치의 기능 블록도이다.
도 2는 본 발명의 실시예에 따른 안전소수 판별 방법을 설명하기 위한 흐름도이다.
도 3은 안전소수 판별을 위해 이용하는 GCD 테스트의 일 예를 설명하기 위한 흐름도이다.
도 4는 안전소수 판별을 위해 이용하는 GCD 테스트의 다른 예를 설명하기 위한 흐름도이다.
도 5는 본 발명의 실시예에 따른 GCD-GCD-MR-MR 검사법 및 GCD-MR-MR 검사법과 종래 TD-MR-MR 검사법의 수행 시간을 비교한 그래프이다.
1 is a functional block diagram of a safety decimation apparatus according to an embodiment of the present invention.
FIG. 2 is a flowchart illustrating a method of determining a safe decimal number according to an embodiment of the present invention.
FIG. 3 is a flowchart for explaining an example of a GCD test used for discriminating a safety factor.
FIG. 4 is a flowchart for explaining another example of the GCD test used for determining the safety factor.
5 is a graph comparing the execution times of the GCD-GCD-MR-MR and GCD-MR-MR tests and the conventional TD-MR-MR test according to an embodiment of the present invention.

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명의 범주는 청구항에 의해 정의될 뿐이다.BRIEF DESCRIPTION OF THE DRAWINGS The advantages and features of the present invention and the manner of achieving them will become apparent with reference to the embodiments described in detail below with reference to the accompanying drawings. It should be understood, however, that the invention is not limited to the disclosed embodiments, but may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, To fully disclose the scope of the invention to a person skilled in the art, and the scope of the invention is only defined by the claims.

본 발명의 실시예들을 설명함에 있어서 공지 기능 또는 구성에 대한 구체적인 설명은 본 발명의 실시예들을 설명함에 있어 실제로 필요한 경우 외에는 생략될 것이다. 그리고 후술되는 용어들은 본 발명의 실시예에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In describing embodiments of the present invention, a detailed description of well-known functions or constructions will be omitted unless otherwise described in order to describe embodiments of the present invention. The following terms are defined in consideration of the functions in the embodiments of the present invention, which may vary depending on the intention of the user, the intention or the custom of the operator. Therefore, the definition should be based on the contents throughout this specification.

도 1은 본 발명의 실시예에 따른 안전소수 판별 장치의 기능 블록도이다.1 is a functional block diagram of a safety decimation apparatus according to an embodiment of the present invention.

도 1의 실시예에 따른 안전소수 판별 장치(100)는 GCD 연산 모듈(110) 및 모듈러 지수 연산 모듈(120)을 포함한다.The safety factor determining apparatus 100 according to the embodiment of FIG. 1 includes a GCD computing module 110 and a modular exponentiation computing module 120.

GCD 연산 모듈(110)은 k개의 소수를 s개의 소수 그룹으로 나누어 각 그룹 내의 소수들을 곱하여 s개의 테스트용 소수를 생성한다. 이때 s개의 소수 그룹은 각 그룹에 속하는 소수들의 곱의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족한다.The GCD operation module 110 divides k prime numbers into s prime groups and multiplies prime numbers in each group to generate s test prime numbers. In this case, the s number of fractional groups satisfy the condition as large as possible but the product of the prime numbers belonging to each group is smaller than m-bit.

이때, GCD 연산 모듈(110)은 k개의 소수를 소수 그룹으로 그룹화하는 과정을 k개의 소수가 소진될 때까지 수행한다. 그리고, GCD 연산 모듈(110)은 소수 그룹별로 그룹 내 소수들의 곱을 테스트용 소수(

Figure 112017080596000-pat00007
, i=1,2,3,…,s)로 생성한다. 예를 들어, k=7개의 소수 P1, P2, P3, P4, P5, P6, P7이 있을 때 P1부터 차례대로 소수를 곱하여 그 곱의 크기가 3-bit(m=3) 미만의 최대값이 되는 소수 P1, P2, P3을 소수 그룹1로, 이와 유사하게 소수 P4, P5를 소수 그룹2로, 소수 P6, P7을 소수 그룹3으로 하여, 3개(s=3)의 소수 그룹으로 나누고, 테스트용 소수 =P1×P2×P3, =P4×P5, =P6×P7를 생성한다.At this time, the GCD operation module 110 performs the process of grouping the k number of prime numbers into a small number of groups until k number of prime numbers are exhausted. Then, the GCD operation module 110 multiplies the product of the prime numbers within the group by the prime number group
Figure 112017080596000-pat00007
, i = 1, 2, 3, ... , s). For example, k = 7 minority P 1, P 2, P 3 , P 4, P 5, P 6, P 7 is multiplied by a prime number in order from P 1 when the product is 3-bit (m size = 3), the prime numbers P 1 , P 2 , and P 3 are set to the prime group 1, and similarly, the prime numbers P 4 and P 5 are set to the prime group 2, the prime numbers P 6 and P 7 are set to the prime group 3 , And divides the result into three groups of three (s = 3) prime numbers to generate a prime number for test = P 1 P 2 P 3 , = P 4 P 5 , = P 6 P 7 .

한편, GCD 연산 모듈(110)은 n-bit 크기의 홀수 난수(r)를 생성하거나 입력 받는다. 도 1에는 별도의 난수 생성기(도시 생략됨)에서 생성된 난수(r)를 입력 받는 예를 나타내었다.Meanwhile, the GCD operation module 110 generates or receives an odd random number r of n-bit size. FIG. 1 shows an example of receiving a random number r generated in a separate random number generator (not shown).

그리고, GCD 연산 모듈(110)은 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=

Figure 112017080596000-pat00008
) 및 s개의 테스트용 소수(
Figure 112017080596000-pat00009
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트(Greatest Common Divisor Test)를 수행한다. 여기서, GCD 연산 모듈(110)은 r1과 테스트용 소수(
Figure 112017080596000-pat00010
)의 최대공약수가 1일 때에, r2와 테스트용 소수(
Figure 112017080596000-pat00011
)의 최대공약수가 1이면 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다. 또는, GCD 연산 모듈(110)은 r1과 r2를 곱한 값과 테스트용 소수(
Figure 112017080596000-pat00012
)의 최대공약수가 1일 경우에 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다.The GCD calculation module 110 calculates r 1 (r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00008
) And a small number of test samples (
Figure 112017080596000-pat00009
), And performs a GCD test (Greatest Common Divisor Test) to determine whether the greatest common divisor of the two numbers is one. Here, the GCD calculation module 110 calculates r 1 and a test fraction
Figure 112017080596000-pat00010
) Is 1, r 2 and the test decimal (
Figure 112017080596000-pat00011
) Is 1, it can be judged that the random number (r) has passed the GCD test. Alternatively, the GCD operation module 110 may calculate a value obtained by multiplying r 1 by r 2 ,
Figure 112017080596000-pat00012
) Is 1, it can be determined that the random number (r) has passed the GCD test.

모듈러 지수 연산 모듈(120)은 GCD 연산 모듈(110)에서 GCD 테스트를 통과한 난수(r)에 의한 r1 및 r2에 대해 m회의 모듈러 지수 연산을 수행한다. 이때, 모듈러 지수 연산 모듈(120)은 모듈러 지수 연산에서 산출된 결과값이 '1' 또는 'r-1'이 아닌지를 판별하는 MR 테스트(Miller-Rabin Test)를 수행한다. 여기서, 모듈러 지수 연산 모듈(120)은 MR 테스트를 통과하는 경우에 난수(r)를 안전소수로 판별한다. 이때, 모듈러 지수 연산 모듈(120)은 r1과 r2에 대해 순차적으로 MR 테스트를 수행할 수 있다. 예를 들며, r1이 1차 MR 테스트를 통과한 경우에 r2에 대한 2차 MR 테스트를 수행할 수 있다.The modular exponentiation computation module 120 performs m modular exponentiation operations on r 1 and r 2 by the random number (r) passed the GCD test in the GCD operation module 110. At this time, the modulus exponentiation module 120 performs an MR test (Miller-Rabin Test) to determine whether the result value calculated in the modular exponentiation operation is not '1' or 'r-1'. Here, the modular exponentiation computing module 120 determines the random number r as a safety decimal number when passing the MR test. At this time, the modular exponentiation module 120 can sequentially perform the MR test for r 1 and r 2 . For example, a second-order MR test for r 2 may be performed if r 1 has passed the first MR test.

도 2는 본 발명의 실시예에 따른 안전소수 판별 방법을 설명하기 위한 흐름도이다.FIG. 2 is a flowchart illustrating a method of determining a safe decimal number according to an embodiment of the present invention.

도 2를 참조하면, 도 1에서 살펴본 소수 판별 장치(100)에 포함되는 GCD 연산 모듈(110)은 GCD 테스트에 이용하고자 하는 테스트용 소수(

Figure 112017080596000-pat00013
)를 선정하는 단계(S210)를 수행할 수 있다. GCD 연산 모듈(110)이 테스트용 소수(
Figure 112017080596000-pat00014
)를 선정하는 구체적인 과정은 도 1에서 설명한 바와 같다.Referring to FIG. 2, the GCD operation module 110 included in the prime number discrimination apparatus 100 shown in FIG. 1 includes a test small number
Figure 112017080596000-pat00013
(Step S210). When the GCD operation module 110 receives a test small number (
Figure 112017080596000-pat00014
) Is as described in Fig.

이후, GCD 연산 모듈(110)은 n-bit 크기의 홀수 난수(r)를 생성하거나 입력 받는 단계(S220)를 수행할 수 있다. 도 2에는 GCD 연산 모듈(110)이 홀수 난수(r)를 생성하는 예를 나타내었다.Thereafter, the GCD operation module 110 may perform step S220 of generating or receiving an odd random number r of n-bit size. FIG. 2 shows an example in which the GCD operation module 110 generates an odd random number r.

그리고, GCD 연산 모듈(110)은 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=

Figure 112017080596000-pat00015
) 및 s개의 테스트용 소수(
Figure 112017080596000-pat00016
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트를 수행하는 단계(S230)를 수행할 수 있다. 여기서, 단계 S230에 의한 GCD 테스트는 m-bit보다 작지만 최대한 큰 테스트용 소수(
Figure 112017080596000-pat00017
)를 이용하므로 이하에서 'm-bit GCD 테스트'라고 한다.The GCD calculation module 110 calculates r 1 (r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00015
) And s test prime numbers (
Figure 112017080596000-pat00016
) To perform a GCD test to determine whether the greatest common divisor of the two numbers is 1 (S230). Here, the GCD test by the step S230 is smaller than m-bit, but the largest test small number (
Figure 112017080596000-pat00017
), It is called 'm-bit GCD test' below.

단계 S230에서, GCD 연산 모듈(110)은 일 예로서, r1과 테스트용 소수(

Figure 112017080596000-pat00018
)의 최대공약수가 1일 때에, r2와 테스트용 소수(
Figure 112017080596000-pat00019
)의 최대공약수가 1이면 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다. 이에 대한 보다 구체적인 설명은 도 3을 참조하여 아래에서 다루기로 한다.In step S230, GCD calculation module 110 as an example, r 1 and a small number of test (
Figure 112017080596000-pat00018
) Is 1, r 2 and the test decimal (
Figure 112017080596000-pat00019
) Is 1, it can be judged that the random number (r) has passed the GCD test. A more detailed description thereof will be described below with reference to Fig.

또는, 단계 S230에서, GCD 연산 모듈(110)은 다른 예로서, r1과 r2를 곱한 값과 테스트용 소수(

Figure 112017080596000-pat00020
)의 최대공약수가 1일 경우에 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다. 이에 대한 보다 구체적인 설명은 도 4를 참조하여 아래에서 다루기로 한다.Alternatively, in step S230, the GCD operation module 110 may calculate, as another example, a value obtained by multiplying r 1 by r 2 and a value obtained by multiplying the test decimal
Figure 112017080596000-pat00020
) Is 1, it can be determined that the random number (r) has passed the GCD test. A more detailed description thereof will be described below with reference to FIG.

단계 S240에서 GCD 테스트를 통과하지 못하면 GCD 연산 모듈(110)은 단계 S220으로 돌아가 홀수 난수(r)를 다시 생성하거나 다시 입력 받아서 이후의 과정들을 순차적으로 다시 수행한다.If the GCD test is not passed in step S240, the GCD operation module 110 returns to step S220 to re-generate or re-input the odd random number r to sequentially perform the following processes again.

하지만, 단계 S240에서 GCD 테스트를 통과하면 모듈러 지수 연산 모듈(120)에 의해 수행되는 단계 S250으로 진행한다.However, if the GCD test passes in step S240, the flow proceeds to step S250 performed by the modular exponentiation module 120. [

도 1의 소수 판별 장치(100)에 포함되는 모듈러 지수 연산 모듈(120)은 GCD 테스트를 통과한 난수(r)에 대하여 MR 테스트를 수행할 수 있다(S250). 보다 구체적으로, 모듈러 지수 연산 모듈(120)은 r1 및 r2에 대해 m회의 모듈러 지수 연산을 수행한다. 그리고, 모듈러 지수 연산 모듈(120)은 모듈러 지수 연산에서 산출된 결과값이 '1' 또는 'r-1'이 아닌 지를 판별하는 MR 테스트를 수행한다. 이때, 모듈러 지수 연산 모듈(120)은 r1과 r2에 대해 순차적으로 MR 테스트를 수행할 수 있다. 예를 들며, r1이 1차 MR 테스트를 통과한 경우에 r2에 대한 2차 MR 테스트를 수행할 수 있다.The modulus exponentiation computing module 120 included in the prime number discriminating apparatus 100 of FIG. 1 may perform the MR test on the random number r passed the GCD test (S250). More specifically, modular exponentiation module 120 performs m modular exponentiation operations on r 1 and r 2 . The modulus exponentiation module 120 performs an MR test to determine whether the resultant value calculated in the modular exponentiation operation is not '1' or 'r-1'. At this time, the modular exponentiation module 120 can sequentially perform the MR test for r 1 and r 2 . For example, a second-order MR test for r 2 may be performed if r 1 has passed the first MR test.

단계 S260에서 MR 테스트를 통과하지 못한 것으로 판정되면 단계 S220으로 귀환하며, GCD 연산 모듈(110)은 홀수 난수(r)를 다시 생성하거나 다시 입력 받아서 이후의 과정들을 순차적으로 다시 수행한다.If it is determined in step S260 that the MR test has not been passed, the process returns to step S220. In step S260, the GCD operation module 110 generates the odd random number r again or receives the odd random number r again.

MR 테스트를 이용하여 소수를 판별하는 과정을 알고리즘으로 표현하면 아래와 같이 제 1 단계부터 제 5 단계까지로 나타낼 수 있다.The algorithm for identifying the prime numbers using the MR test can be represented as steps 1 through 5 as follows.

제 1 단계 : 난수(r) 생성 또는 입력 받기Step 1: Create or receive a random number (r)

제 2 단계 : 제 1 변수(w) 및 제 2 변수(h) 생성, 여기서, r-1 = w×2h, w는 홀수, h > 0W = 2 x h , where w is an odd number, h > 0,

제 3 단계 : 반복 횟수(t) 결정, 실행 횟수(i) =1Step 3: Determine the number of repetitions (t), the number of executions (i) = 1

제 4 단계 : while i≤t doStep 4: while i ≤ t do

제 4-1 단계 : 임의의 수(a) 선택, 여기서, 1 < a < r   Step 4-1: arbitrary number (a) selection, where 1 < a < r

제 4-2 단계 : 모듈러 값(b) = aw mod rStep 4-2: modular value (b) = a w mod r

제 4-3 단계 : 모듈러 값(b) = 1 mod r이면, 제 4-6 단계로 진행Step 4-3: If the modular value (b) = 1 mod r, the process proceeds to Step 4-6

제 4-4 단계 : for j=0 to h-1 doStep 4-4: for j = 0 to h-1 do

제 4-4-1 단계 : b = (r-1) mod r이면, 제 4-6 단계로 진행    Step 4-4-1: If b = (r-1) mod r, proceed to Step 4-6

제 4-4-2 단계 : b = b2 mod rStep 4-4-2: b = b 2 mod r

제 4-5 단계 : r을 합성수로 판정하고, 제 1 단계로 복귀Step 4-5: r is determined to be a synthetic number, and the process returns to the first step

제 4-6 단계 : i = i +1Steps 4-6: i = i + 1

제 5 단계 : r을 소수라고 판정Step 5: Determine r as a prime number

한편, MR 테스트는 페르마 테스트가 카마이클 수에 대한 소수 판정을 항상 통과시키는 것을 보완하기 위한 테스트 방법이며, 공지된 소수 검사법의 일종이기에, 구체적인 설명은 생략하기로 한다.On the other hand, the MR test is a test method for compensating for the fact that the Fermat test always passes a small number of determinations for the number of chambers, and is a kind of known minor test method, so a detailed description will be omitted.

단계 S260에서, 모듈러 지수 연산 모듈(120)은 MR 테스트를 통과한 것으로 판정되면 난수(r)를 안전소수로 판별한다(S270).In step S260, the modular exponentiation calculating module 120 determines that the random number r is a safety decimal number if it is determined that the MR test is passed (S270).

도 3은 안전소수 판별을 위해 이용하는 GCD 테스트의 일 예를 설명하기 위한 흐름도이다.FIG. 3 is a flowchart for explaining an example of a GCD test used for discriminating a safety factor.

도 3을 참조하면, 도 1에 도시된 소수 판별 장치(100)에 포함되는 GCD 연산 모듈(110)은 r1과 테스트용 소수(

Figure 112017080596000-pat00021
)의 최대공약수를 산출하는 단계(S310)를 수행할 수 있다. 그리고, GCD 연산 모듈(110)은 단계 S310에서 산출된 최대공약수가 1인가를 판정(S320)하고, 단계 S320에서 최대공약수가 1로 판정되면, r2와 테스트용 소수(
Figure 112017080596000-pat00022
)의 최대공약수를 산출(S330)할 수 있다. 그리고, GCD 연산 모듈(110)은 단계 S330에서 산출된 최대공약수가 1인가를 판정(S340)하고, 단계 S340에서 최대공약수가 1로 판정되면, 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다(S350). 반면에, 단계 S320 및 S340에서 최대공약수가 1이 아닌 것으로 판정되면 GCD 테스트를 불통과한 것으로 판단할 수 있다(S360).Referring to FIG. 3, the GCD operation module 110 included in the decimation apparatus 100 shown in FIG. 1 includes r 1 and test decimals
Figure 112017080596000-pat00021
(S310) of calculating the greatest common divisor of the number Then, when the GCD calculation module 110 is the greatest common factor of 1 is applied to the determination (S320), and the greatest common factor is determined by 1 in step S320 calculates in step S310, r 2 and a few test (
Figure 112017080596000-pat00022
(S330). &Lt; / RTI &gt; Then, the GCD operation module 110 determines whether the greatest common divisor is one (S340). If it is determined in step S340 that the greatest common divisor is 1, the GCD operation module 110 determines that the random number r has passed the GCD test (S350). On the other hand, if it is determined in steps S320 and S340 that the greatest common divisor is not 1 (S360), it can be determined that the GCD test is disrupted.

도 3과 같이, 단계 S310 및 S320에서 1차 GCD 테스트를 수행한 후에 단계 S330 및 S340에서 2차 GCD 테스트를 수행할 때에, 전체 m-bit GCD 테스트의 수행 시간에 대해 살펴보기로 한다.As shown in FIG. 3, when the second GCD test is performed in steps S330 and S340 after performing the first GCD test in steps S310 and S320, the execution time of the entire m-bit GCD test will be described.

먼저, r1과 에 대해서 GCD를 수행하여야 하며, 이 때 결과가 1일 경우 r2와 에 대한 GCD를 수행하여야 한다. 여기서, 첫 번째 GCD의 결과가 1일 확률을 X라고 하자. 그리고, 과 r1, r2를 GCD한 결과가 1일 경우 r1과 에 대해 GCD를 수행했을 때 GCD의 결과가 1일 확률을 Y라고 하자. 이때, 확률 X와 Y는 아래의 수학식 1에 나타낸 바와 같다.First, GCD should be performed on r 1 and, if the result is 1, GCD for r 2 and GCD should be performed. Here, let X be the probability that the first GCD result is 1. Let R be the probability that the result of GCD is 1 when GCD is performed on r 1 and r 1 , and r 1 and r 2 are 1. At this time, the probabilities X and Y are as shown in the following equation (1).

Figure 112017080596000-pat00023
Figure 112017080596000-pat00023

여기서, Pi는 소수로 P1<P2<…<Pk의 규칙을 따른다.Where P i is a prime number and P 1 <P 2 <... <P k follows the rules.

따라서, r2와 에 대해 GCD를 수행하였을 때에 GCD의 결과가 1일 확률은 다음의 수학식 2와 같다.Therefore, the probability that the result of GCD is 1 when GCD is performed on r 2 and is given by Equation 2 below.

Figure 112017080596000-pat00024
Figure 112017080596000-pat00024

이어서,

Figure 112017080596000-pat00025
와 r1, r2의 GCD가 1일 경우
Figure 112017080596000-pat00026
에 대해서 GCD를 수행하여야 한다. 이때, r1
Figure 112017080596000-pat00027
에 대해서 GCD를 수행했을 때의 1일 확률은 다음의 수학식 3과 같다.next,
Figure 112017080596000-pat00025
And the GCD of r 1 and r 2 is 1
Figure 112017080596000-pat00026
The GCD should be performed. At this time, r 1 and
Figure 112017080596000-pat00027
The probability of one day when the GCD is performed is expressed by Equation (3).

Figure 112017080596000-pat00028
Figure 112017080596000-pat00028

그리고, r2

Figure 112017080596000-pat00029
에 대해 GCD를 수행하였을 때에 GCD의 결과가 1일 확률은 다음의 수학식 4와 같다.Then, r 2 and
Figure 112017080596000-pat00029
The probability that the result of the GCD is 1 at the time when the GCD is performed is expressed by Equation (4).

Figure 112017080596000-pat00030
Figure 112017080596000-pat00030

마지막 번째인

Figure 112017080596000-pat00031
와 r1에 대해 GCD를 수행하였을 때와
Figure 112017080596000-pat00032
와 r2에 대해 GCD를 수행하였을 때에 GCD의 결과가 1일 확률은 각각 다음의 수학식 5와 같다.The last one
Figure 112017080596000-pat00031
And r 1 were performed for GCD
Figure 112017080596000-pat00032
And r 2 , the probability of the GCD result being 1 is given by Equation (5) below.

Figure 112017080596000-pat00033
Figure 112017080596000-pat00033

수학식 1 내지 수학식 5를 토대로 하여 도 3의 실시예에 따른 m-bit GCD 테스트의 수행 시간은 아래의 수학식 6과 같이 나타낼 수 있다.Based on Equations (1) to (5), the execution time of the m-bit GCD test according to the embodiment of FIG. 3 can be expressed as Equation (6) below.

Figure 112017080596000-pat00034
Figure 112017080596000-pat00034

여기서, TGCD (m)은 GCD 검사법을 한 번한 시간이다.Here, T GCD (m) is the one time GCD test.

또한, 도 3의 실시예가 적용된 안전소수 판별 방법의 수행 시간을 공지의 MR 테스트에 대한 수행 시간과 합산하면 아래의 수학식 7과 같이 나타낼 수 있다.In addition, when the execution time of the safety factor determination method applied in the embodiment of FIG. 3 is summed with the execution time of the known MR test, it can be expressed as Equation (7) below.

Figure 112017080596000-pat00035
Figure 112017080596000-pat00035

여기서, T(n, k)는 n-bit의 난수 r과 k개의 소수를 통해서 n-bit인 안전소수 한 개를 생성하는데 걸리는 시간을 의미한다. Ntrial은 r이 안전소수일 때까지 시도해야 하는 횟수이고, Trnd는 난수 생성 시간이며, TMR은 MR 검사법을 한 번한 시간이다.Here, T (n, k) denotes the time taken to generate one n-bit safe decimal number through an n-bit random number r and k decimals. N trial is the number of times t must be tried until r is a safety factor , T rnd is the random number generation time, and T MR is the time of the MR test.

도 4는 안전소수 판별을 위해 이용하는 GCD 테스트의 다른 예를 설명하기 위한 흐름도이다.FIG. 4 is a flowchart for explaining another example of the GCD test used for determining the safety factor.

도 4를 참조하면, 도 1에서 살펴본 소수 판별 장치(100)에 포함되는 GCD 연산 모듈(110)은 r1과 r2를 곱한 값을 산출하는 단계(S410)를 수행할 수 있다. 이후, GCD 연산 모듈(110)은 단계 S410에서 산출된 r1과 r2를 곱한 값과 테스트용 소수(

Figure 112017080596000-pat00036
)의 최대공약수를 산출(S420)하고, 단계 S430에서 최대공약수가 1로 판정되면, 난수(r)가 GCD 테스트를 통과한 것으로 판단할 수 있다(S440). 반면에, 단계 S430에서 최대공약수가 1이 아닌 것으로 판정되면 GCD 테스트를 불통과한 것으로 판단할 수 있다(S450).Referring to FIG. 4, the GCD operation module 110 included in the prime number discriminating apparatus 100 illustrated in FIG. 1 may calculate a value obtained by multiplying r 1 by r 2 (S410). Thereafter, the GCD operation module 110 multiplies the value obtained by multiplying r 1 and r 2 calculated at step S410 and the test decimal number (
Figure 112017080596000-pat00036
(S420). If it is determined in step S430 that the greatest common divisor is 1, it can be determined that the random number r has passed the GCD test (S440). On the other hand, if it is determined in step S430 that the greatest common divisor is not 1 (S450), it is determined that the GCD test is not performed.

도 4와 같이, 단계 S410 및 S420에서 GCD 테스트를 한 번만 수행할 때에, 전체 m-bit GCD 테스트의 수행 시간에 대해 살펴보기로 한다.As shown in FIG. 4, when the GCD test is performed only once in steps S410 and S420, the execution time of the entire m-bit GCD test will be described.

r1과 r2를 곱한 값과 에 대해서 GCD를 수행했을 때에 GCD의 결과가 1일 경우의 확률은 아래의 수학식 8에 나타낸 바와 같다.the probability that the result of GCD is 1 when the GCD is performed with respect to the value obtained by multiplying r 1 by r 2 and the value obtained by multiplying r 1 by r 2 is as shown in the following equation (8).

Figure 112017080596000-pat00037
Figure 112017080596000-pat00037

수학식 8을 토대로 하여 도 4의 실시예에 따른 m-bit GCD 테스트의 수행 시간은 아래의 수학식 9와 같이 나타낼 수 있다.Based on Equation (8), the execution time of the m-bit GCD test according to the embodiment of FIG. 4 can be expressed as Equation (9) below.

Figure 112017080596000-pat00038
Figure 112017080596000-pat00038

또한, 도 4의 실시예가 적용된 안전소수 판별 방법의 수행 시간을 공지의 MR 테스트에 대한 수행 시간과 합산하면 아래의 수학식 10과 같이 나타낼 수 있다.In addition, when the execution time of the safety factor determination method applied in the embodiment of FIG. 4 is summed with the execution time of the known MR test, it can be expressed as Equation (10) below.

Figure 112017080596000-pat00039
Figure 112017080596000-pat00039

도 5는 본 발명의 실시예에 따른 GCD-GCD-MR-MR 검사법 및 GCD-MR-MR 검사법과 종래 TD-MR-MR 검사법의 수행 시간을 비교한 그래프이다. 601은 TD-MR-MR 검사법이고, 602는 GCD-GCD-MR-MR 검사법이며, 603은 GCD-MR-MR 검사법이다.5 is a graph comparing the execution times of the GCD-GCD-MR-MR and GCD-MR-MR tests and the conventional TD-MR-MR test according to an embodiment of the present invention. 601 is a TD-MR-MR test, 602 is a GCD-GCD-MR-MR test, and 603 is a GCD-MR-MR test.

소수를 판별하는 방식으로는 결정적 검사법과 확률적 검사법이 존재한다. 결정적 검사법은 검사를 통과한 난수가 1의 확률로 소수임을 보장하며, 예를 들어 TD 테스트(Trial Division Test) 등이 존재한다. 나아가, 확률적 검사법은 매우 큰 s에 대해 1-(0.5)s의 확률로 해당 검사를 통과한 난수가 소수임을 보장하며, 예를 들어 MR 테스트 등이 존재한다.There are deterministic and probabilistic methods for determining the prime numbers. The deterministic test method ensures that the random number that passes the test is a prime number with a probability of 1, for example, there is a TD test (Trial Division Test). Furthermore, the probabilistic test method guarantees a probability of 1- (0.5) s for a very large s, and a random number passing through the test is a prime number, for example, an MR test or the like exists.

안전소수를 판별할 때에, 좀 더 빠른 소수 검사를 위해 소수 검사법들을 조합해서 사용하는데 그 중 많이 사용되는 조합은 TD 테스트와 MR 테스트의 조합이다.When determining the safety factor, a combination of minor test methods is used for a quicker minority test. The most common combination is the combination of the TD test and the MR test.

종래 기술에 따라, 안전소수를 판별하기 위한 방법으로는 TD-MR-MR 검사법이 있다. 이러한 TD-MR-MR 검사법은, 난수(r)에 대해 안전소수인지 검사함에 있어서 r1(단, r1=r)과 r2(단, r2=

Figure 112017080596000-pat00040
)에 대해서 TD 테스트를 한번에 수행한 뒤, r1과 r2 각각에 대해 MR 테스트를 수행하는 조합이다.According to the prior art, there is a TD-MR-MR test method as a method for discriminating the safety factor. In this TD-MR-MR test, r 1 (r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00040
) Is a combination of performing a TD test at a time and then performing an MR test for each of r 1 and r 2 .

도 5에 있어서, PC의 실험환경은 Microsoft Windows8.1, 3.20GHz CPU, 8.00GB RAM에서 Eclipse IDE for Java Developers Mars.1 Release (4.5.1)을 사용하였다. 실험방법은 m이 32bit, 128bit, 512bit, 1024bit, 2048bit일 때 안전소수를 10,000번 생성하고 평균 수행시간을 측정하였다.In FIG. 5, the experimental environment of the PC was the Eclipse IDE for Java Developers Mars.1 Release (4.5.1) in Microsoft Windows8.1, 3.20GHz CPU, and 8.00GB RAM. Experimental method is to generate the number of safety factors 10,000 times when m is 32bit, 128bit, 512bit, 1024bit and 2048bit, and the average execution time is measured.

TD-MR-MR 검사법의 가장 빠른 수행 시간은 k=984일 때 6.68초였으며, GCD-MR-MR 검사법의 가장 빠른 수행시간은 m=32bit이고 k=1102일 때 6.33초로 가장 빨랐다. GCD-GCD-MR-MR 검사법의 가장 빠른 수행시간은 m=128bit이고 k=114일 때 178초가 나왔다. 따라서 PC 환경에서 GCD-MR-MR 검사법을 이용할 경우에 가장 빨리 안전소수를 생성할 수 있음을 알 수 있다.The fastest execution time of the TD-MR-MR method was 6.68 seconds at k = 984, and the fastest execution time of the GCD-MR-MR method was 6.33 seconds at m = 32 bits and k = 1102. The fastest execution time of the GCD-GCD-MR-MR method was m = 128 bits and 178 seconds when k = 114. Therefore, it can be seen that the GCD-MR-MR test can be used to generate the safety factor at the earliest in the PC environment.

본 발명에 첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수도 있다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다.Combinations of each step of the flowchart and each block of the block diagrams appended to the present invention may be performed by computer program instructions. These computer program instructions may be loaded into a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus so that the instructions, which may be executed by a processor of a computer or other programmable data processing apparatus, And means for performing the functions described in each step are created. These computer program instructions may also be stored in a computer usable or computer readable memory capable of directing a computer or other programmable data processing apparatus to implement the functionality in a particular manner so that the computer usable or computer readable memory It is also possible for the instructions stored in the block diagram to produce a manufacturing item containing instruction means for performing the functions described in each block or flowchart of the block diagram. Computer program instructions may also be stored on a computer or other programmable data processing equipment so that a series of operating steps may be performed on a computer or other programmable data processing equipment to create a computer- It is also possible that the instructions that perform the processing equipment provide the steps for executing the functions described in each block of the block diagram and at each step of the flowchart.

또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실시예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.Also, each block or each step may represent a module, segment, or portion of code that includes one or more executable instructions for executing the specified logical function (s). It should also be noted that in some alternative embodiments, the functions mentioned in the blocks or steps may occur out of order. For example, two blocks or steps shown in succession may in fact be performed substantially concurrently, or the blocks or steps may sometimes be performed in reverse order according to the corresponding function.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The foregoing description is merely illustrative of the technical idea of the present invention, and various changes and modifications may be made by those skilled in the art without departing from the essential characteristics of the present invention. Therefore, the embodiments disclosed in the present invention are intended to illustrate rather than limit the scope of the present invention, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be construed according to the following claims, and all technical ideas within the scope of equivalents should be construed as falling within the scope of the present invention.

100 : 소수 판별 장치
110 : GCD 연산 모듈
120 : 모듈러 지수 연산 모듈
100: fractional discrimination device
110: GCD operation module
120: modular exponentiation module

Claims (6)

안전소수 판별 장치에서 수행하는 안전소수 판별 방법으로서,
k개의 소수를 차례대로 서로 곱하되 곱한 값의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족하는 소수들을 그룹화하여 s개의 소수 그룹으로 나누고, 각 소수 그룹에 속한 소수들의 곱을 테스트용 소수(
Figure 112017080596000-pat00041
)로 선정하는 단계(단, i는 1에서 s까지의 자연수)와,
n-bit 크기의 홀수 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=
Figure 112017080596000-pat00042
) 및 상기 s개의 테스트용 소수(
Figure 112017080596000-pat00043
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트(Greatest Common Divisor Test)를 수행하는 단계와,
상기 GCD 테스트를 통과하는 경우에, 상기 r1 및 상기 r2에 대해 m회의 모듈러 지수 연산을 수행하여 산출된 결과값이 '1' 또는 'r-1'인지를 판별하는 MR 테스트(Miller-Rabin Test)를 수행하는 단계와,
상기 MR 테스트를 통과하는 경우에, 상기 난수(r)를 안전소수로 판별하는 단계를 포함하는
안전소수 판별 방법.
A method for distinguishing safety numbers performed by a safety factor discriminator,
The prime numbers that are smaller than m-bit but satisfy the largest condition are grouped and divided into s prime groups, and the product of the prime numbers belonging to each prime group is divided into test prime numbers
Figure 112017080596000-pat00041
), Where i is a natural number from 1 to s,
r 1 (where r 1 = r) and r 2 (where r 2 = r) are set for an odd random number r of n-bit size,
Figure 112017080596000-pat00042
) And the s test small numbers (
Figure 112017080596000-pat00043
), Performing a GCD test (Greatest Common Divisor Test) to determine whether the greatest common divisor of the two numbers is 1,
When passing the GCD test, an MR test (Miller-Rabin (R)) for determining whether the calculated result value is '1' or 'r-1' by performing m modular exponent operations on the r 1 and r 2 Test)
Determining the random number (r) as a safety decimal number when passing the MR test
How to identify safety factor.
제 1 항에 있어서,
상기 GCD 테스트를 통과하는 것은, 상기 r1과 상기 테스트용 소수(
Figure 112017080596000-pat00044
)의 최대공약수가 1일 때에, 상기 r2와 상기 테스트용 소수(
Figure 112017080596000-pat00045
)의 최대공약수가 1이면 상기 GCD 테스트를 통과하는 것인
안전소수 판별 방법.
The method according to claim 1,
Passing the GCD test is to pass the r 1 and the test prime number (
Figure 112017080596000-pat00044
) Is 1, the r 2 and the test fractional number (
Figure 112017080596000-pat00045
) &Lt; / RTI &gt; is 1, the GCD test is passed.
How to identify safety factor.
제 1 항에 있어서,
상기 GCD 테스트를 통과하는 것은, 상기 r1과 상기 r2를 곱한 값과 상기 테스트용 소수(
Figure 112017080596000-pat00046
)의 최대공약수가 1일 경우에 상기 GCD 테스트를 통과하는 것인
안전소수 판별 방법.
The method according to claim 1,
Passing the GCD test is a value obtained by multiplying r 1 by r 2 ,
Figure 112017080596000-pat00046
) &Lt; / RTI &gt; passes the GCD test when the greatest common divisor of &lt; RTI ID = 0.0 &gt;
How to identify safety factor.
제 1 항에 있어서,
상기 MR 테스트를 수행하는 단계는, 상기 r1과 상기 r2에 대해 순차적으로 MR 테스트를 수행하는
안전소수 판별 방법
The method according to claim 1,
The step of performing the MR test may include sequentially performing an MR test on the r 1 and the r 2
How to identify safety factor
하나 이상의 프로세서들에 의해 실행될 때, 안전소수를 판별하는 과정들을 수행하는 명령어들을 포함하는, 컴퓨터로 판독 가능한 기록매체에 있어서,
상기 과정들은,
k개의 소수를 차례대로 서로 곱하되 곱한 값의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족하는 소수들을 그룹화하여 s개의 소수 그룹으로 나누고, 각 소수 그룹에 속한 소수들의 곱을 테스트용 소수(
Figure 112017080596000-pat00047
)로 선정하는 단계(단, i는 1에서 s까지의 자연수)와,
n-bit 크기의 홀수 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=
Figure 112017080596000-pat00048
) 및 상기 s개의 테스트용 소수(
Figure 112017080596000-pat00049
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트(Greatest Common Divisor Test)를 수행하는 단계와,
상기 GCD 테스트를 통과하는 경우에, 상기 r1 및 상기 r2에 대해 m회의 모듈러 지수 연산을 수행하여 산출된 결과값이 '1' 또는 'r-1'인지를 판별하는 MR 테스트(Miller-Rabin Test)를 수행하는 단계와,
상기 MR 테스트를 통과하는 경우에 상기 난수(r)를 안전소수로 판별하는 단계를 포함하는
컴퓨터로 판독 가능한 기록매체.
21. A computer-readable medium having stored thereon instructions for performing the steps of determining a safety factor when executed by one or more processors,
The above-
The prime numbers that are smaller than m-bit but satisfy the largest condition are grouped and divided into s prime groups, and the product of the prime numbers belonging to each prime group is divided into test prime numbers
Figure 112017080596000-pat00047
), Where i is a natural number from 1 to s,
r 1 (where r 1 = r) and r 2 (where r 2 = r) are set for an odd random number r of n-bit size,
Figure 112017080596000-pat00048
) And the s test small numbers (
Figure 112017080596000-pat00049
), Performing a GCD test (Greatest Common Divisor Test) to determine whether the greatest common divisor of the two numbers is 1,
When passing the GCD test, an MR test (Miller-Rabin (R)) for determining whether the calculated result value is '1' or 'r-1' by performing m modular exponent operations on the r 1 and r 2 Test)
And determining the random number (r) as a safety decimal number when passing the MR test
A computer readable recording medium.
k개의 소수를 차례대로 서로 곱하되 곱한 값의 크기가 m-bit보다 작지만 최대한 큰 조건을 만족하는 소수들을 그룹화하여 s개의 소수 그룹으로 나누고, 각 소수 그룹에 속한 소수들의 곱을 테스트용 소수(
Figure 112017080596000-pat00050
)로 선정(단, i는 1에서 s까지의 자연수)하며, n-bit 크기의 홀수 난수(r)에 대해, r1(단, r1=r)과 r2(단, r2=
Figure 112017080596000-pat00051
) 및 상기 s개의 테스트용 소수(
Figure 112017080596000-pat00052
)를 이용하여, 두 수의 최대공약수가 1인지를 판별하는 GCD 테스트(Greatest Common Divisor Test)를 수행하는 GCD 연산 모듈과,
상기 GCD 테스트를 통과한 상기 난수(r)에 의한 상기 r1 및 상기 r2에 대해 m회의 모듈러 지수 연산을 수행하여 산출된 결과값이 '1' 또는 'r-1'인지를 판별하는 MR 테스트(Miller-Rabin Test)를 수행하고, 상기 MR 테스트를 통과하는 경우에 상기 난수(r)를 안전소수로 판별하는 모듈러 지수 연산 모듈을 포함하는
소수 판별 장치.
The prime numbers that are smaller than m-bit but satisfy the largest condition are grouped and divided into s prime groups, and the product of the prime numbers belonging to each prime group is divided into test prime numbers
Figure 112017080596000-pat00050
(Where r is a natural number from 1 to s) and r 1 (where r 1 = r) and r 2 (where r 2 =
Figure 112017080596000-pat00051
) And the s test small numbers (
Figure 112017080596000-pat00052
), A GCD operation module for performing a GCD test (Greatest Common Divisor Test) for determining whether the greatest common divisor of two numbers is 1,
An MR test for determining whether the calculated result value is '1' or 'r-1' by performing m modular exponent operations on the r 1 and r 2 by the random number r passed the GCD test A modulo exponentiation module for performing the Miller-Rabin Test and determining the random number (r) as a safety decimal number when passing the MR test
Fractional discrimination device.
KR1020170105530A 2017-08-21 2017-08-21 Method for distinction of safe prime number KR101918741B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170105530A KR101918741B1 (en) 2017-08-21 2017-08-21 Method for distinction of safe prime number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170105530A KR101918741B1 (en) 2017-08-21 2017-08-21 Method for distinction of safe prime number

Publications (1)

Publication Number Publication Date
KR101918741B1 true KR101918741B1 (en) 2018-11-14

Family

ID=64328174

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170105530A KR101918741B1 (en) 2017-08-21 2017-08-21 Method for distinction of safe prime number

Country Status (1)

Country Link
KR (1) KR101918741B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005064844A1 (en) 2003-12-26 2005-07-14 Matsushita Electric Industrial Co.,Ltd. Prime calculation device, method, and key issuing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005064844A1 (en) 2003-12-26 2005-07-14 Matsushita Electric Industrial Co.,Ltd. Prime calculation device, method, and key issuing system

Similar Documents

Publication Publication Date Title
JP5449576B2 (en) Arithmetic device, elliptic scalar multiplication method for arithmetic device, elliptic scalar multiplication program, remainder arithmetic method for arithmetic device, and remainder arithmetic program
US20080044010A1 (en) Cryptographic system and method for encrypting input data
KR20100113130A (en) Countermeasure method and devices for asymmetric cryptography
US7907724B2 (en) Method and apparatus for protecting an RSA calculation on an output by means of the chinese remainder theorem
Petit et al. Algebraic approaches for the elliptic curve discrete logarithm problem over prime fields
Bernstein et al. A low-resource quantum factoring algorithm
Dong et al. sDPF-RSA: Utilizing floating-point computing power of GPUs for massive digital signature computations
JP2007189692A (en) Montgomery power ladder algorithm including method against dfa
KR101918741B1 (en) Method for distinction of safe prime number
JP2009505148A (en) Circuit arrangement and method for performing inversion operation in encryption operation
CN108334304A (en) digital recursive division
JP7055142B2 (en) How to generate prime numbers for cryptographic applications
KR101731921B1 (en) Hardware-wired apparatus and method of discriminating prime numbers
US7257224B2 (en) Cryptographical pseudo-random number generation apparatus and program
Duta et al. Framework for evaluation and comparison of primality testing algorithms
Clavier et al. Updated recommendations for blinded exponentiation vs. single trace analysis
Pomykała et al. On reducing factorization to the discrete logarithm problem modulo a composite
Jo et al. Probabilistic analysis on JPV algorithm and improving it using GCD function
Kim et al. Design and analysis of efficient parallel hardware prime generators
KR101423947B1 (en) Modular multiplication and modular exponentiation using extended NIST prime
Lichtman et al. Improved error bounds for the Fermat primality test on random inputs
Abbas et al. Integer Linear Programming Modeling of Addition Sequences With Additional Constraints for Evaluation of Power Terms
Zadiraka et al. Security estimates updating of asymmetric cryptosystems for modern computing
KR102200132B1 (en) Prime number test method and apparatus using sieve of euler
Kloster Factoring a semiprime n by estimating φ (n)

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant