KR20190022023A - Hardware-implemented modular inversion module - Google Patents

Hardware-implemented modular inversion module Download PDF

Info

Publication number
KR20190022023A
KR20190022023A KR1020170107740A KR20170107740A KR20190022023A KR 20190022023 A KR20190022023 A KR 20190022023A KR 1020170107740 A KR1020170107740 A KR 1020170107740A KR 20170107740 A KR20170107740 A KR 20170107740A KR 20190022023 A KR20190022023 A KR 20190022023A
Authority
KR
South Korea
Prior art keywords
modular
inverse
algorithm
mod
bit
Prior art date
Application number
KR1020170107740A
Other languages
Korean (ko)
Other versions
KR101977873B1 (en
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 KR1020170107740A priority Critical patent/KR101977873B1/en
Publication of KR20190022023A publication Critical patent/KR20190022023A/en
Application granted granted Critical
Publication of KR101977873B1 publication Critical patent/KR101977873B1/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
    • G06F7/724Finite field arithmetic
    • G06F7/725Finite field arithmetic over elliptic curves
    • 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
    • G06F7/721Modular inversion, reciprocal or quotient calculation
    • 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/002Countermeasures against attacks on cryptographic mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Complex Calculations (AREA)

Abstract

Provided is a hardware-implemented an elliptic curve cryptographic (ECC) algorithm processing device. The device comprises: at least one storage unit storing data during algorithm processing; a modular inverse calculation unit calculating a modulo inverse x of a in a relation of ax = 1 (mod m) in a right shift scheme, wherein x = a_-1 (mod m); and at least one modular addition operation unit performing modular addition in the algorithm process.

Description

하드웨어 구현된 모듈러 역원 모듈{HARDWARE-IMPLEMENTED MODULAR INVERSION MODULE}[0001] HARDWARE-IMPLEMENTED MODULAR INVERSION MODULE [0002]

하드웨어 구현된 모듈러 역원 모듈에 연관되며, 보다 특정하게는 타원 곡선 암호 시스템(ECC, Elliptic Curve Cryptosystem)에서 사용되는 역원 모듈을 오른쪽 시프트(Right-Shift) 구현하는 기술에 연관된다.Relates to a hardware implemented modular inversion module, and more particularly to a technique for implementing a right-shift implementation of an inverse module used in an elliptic curve cryptosystem (ECC).

제품과 기기들이 지능화되는 4차 산업 혁명에서는 보안이 더 중요해질 것으로 예상된다. 그러나 기존의 서버나 광통신 등의 환경과 달리 계산 능력과 무선 통신 전송량은 제한되어 있기 때문에 앞으로 더 짧은 키를 사용하면서도 RSA와 비슷한 암호학적 강도를 갖는 타원 곡선 암호 시스템(ECC, Elliptic Curve Cryptosystem)의 사용이 늘어날 것이다.In the fourth industrial revolution, where products and devices are intelligent, security is expected to become more important. However, unlike existing server or optical communication environments, the computation power and the amount of wireless communication are limited. Therefore, the use of an elliptic curve cryptosystem (ECC) with a similar cryptographic strength to that of RSA Will increase.

한편 모듈러 역(Modular inverse) 알고리즘은 타원 곡선 암호 시스템에서 필요한 유한체 연산 중에서 가장 많은 계산량을 가지고 있다. 그래서 사영 좌표계(projective coordinates)을 사용하여 modular inverse를 제거하는 방법이 주로 사용되었다. 그러나 이 방법은 MM(modular multiplication) 등의 횟수가 증가하며 타원 곡선 상의 연산을 계산하는 수식이 복잡해져 구현 복잡도가 상승하고 면적이 증가할 수 있다는 한계가 있다. 그리고 마지막 추가연산에서 반드시 한 번은 modular inversion이 필요할 뿐만 아니라 타원 곡선 암호 기반의 서명 알고리즘인 ECDSA를 수행하기 위해서도 몇 번의 MI(modular inverse)가 필요하다. 따라서 만약 빠른 modular inverse 모듈을 구현할 수 있다면 사영 좌표계 사용없이 하드웨어 ECC 모듈을 좀 더 간단하고 작은 면적으로 구현하는 것이 가능하다.On the other hand, the modular inverse algorithm has the most computational complexity among the finite field operations required in the elliptic curve cryptosystem. Therefore, the method of removing the modular inverse by using the projective coordinates was mainly used. However, this method increases the number of times such as modular multiplication (MM) and the complexity of calculating an operation on an elliptic curve becomes complicated, so that there is a limitation that an implementation complexity increases and an area increases. Not only does modular inversion need to be performed once in the last addition operation, but also a few modular inverse (MI) is required to perform ECDSA, an elliptic curve cryptography based signature algorithm. Therefore, if a fast modular inverse module can be implemented, it is possible to implement a hardware ECC module with a simpler and smaller area without using a projection coordinate system.

대한민국 공개특허 제1020100062565호(2010.06.10), "모듈러스의 음의 역원을 구하는 방법"Korean Patent Publication No. 1020100062565 (Jun. 10, 2010), " How to obtain the modulus inverse of the modulus " 대한민국 등록특허 제1005851190000호(2006.05.24), "암호화 장치, 암호화 방법 및 그 기록매체"Korean Patent No. 1005851190000 (May 26, 2006), "Encryption device, encryption method and recording medium" 대한민국 공개특허 제1020120088316호(2012.08.08), "몽고메리 역원 계산 장치 및 이를 이용한 몽고메리 역원 계산 방법"Korean Patent Publication No. 1020120088316 (Aug. 8, 2012), " Montgomery inversion calculation apparatus and Montgomery inversion calculation method using the same &

기술문헌 "P. Choi, J. Kong, and D.K. Kim, "Analysis of Hardware Modular Inversion Modules for Elliptic Curve Cryptography," Proceeding of International SoC Design Conference, pp.313-314, 2015" &Quot; Proceedings of International Conference on SoC Design, pp. 313-314, 2015 ", " Analysis of Hardware Modular Inversion Modules for Elliptic Curve Cryptography &

일측에 따르면, 하드웨어-구현되는 타원곡선 암호화 알고리즘 처리 장치가 제공된다. 장치는: 알고리즘 처리 중의 데이터를 저장하기 위한 적어도 하나의 저장부; 우측정렬 시프트 (right shift) 방식으로 ax ≡ 1 (mod m)의 관계에 있는 a의 모듈러 역 x (단, x ≡ a-1 (mod m)임)을 연산하는 모듈러 역 연산부; 및 상기 알고리즘 처리 과정에서의 모듈러 덧셈을 수행하는 적어도 하나의 모듈러 덧셈 연산부를 포함한다.According to one aspect, a hardware-implemented elliptic curve encryption algorithm processing device is provided. The apparatus comprises: at least one storage for storing data during algorithm processing; A modular inverse arithmetic unit operable to calculate a modulo inverse x (where x ≡ a -1 (mod m)) of a in a relation of ax ≡ 1 (mod m) in a right shift scheme; And at least one modular addition operation unit for performing modular addition in the algorithm process.

일실시예에 따르면 상기 모듈러 역 연산부는, aR≡U (mod m), aS≡V (mod m)를 만족하도록 R, S, U, 및 V 각각의 초기 값을 설정하고, 상기 U 및 상기 V의 값을 오른쪽 쉬프트와 뺄셈을 통해 줄여 나가서 상기 U 및 상기 V 중 어느 하나가 1이 되는 경우에 상기 a의 모듈러 역원인 상기 x를 결정한다.According to one embodiment, the modular inverse operation unit sets the initial values of R, S, U, and V so that aR? U (mod m), aS? V (mod m) Is subtracted through a right shift and a subtraction to determine the modular inverse cause x of the a when the U and the V become one.

일실시예에 따르면 상기 제어부는 상기 R의 초기 값을 0로 주고, 상기 S의 초기 값을 1으로 주고, 상기 U의 초기 값을 -m으로 주고, 상기 V의 초기 값을 a로 줌으로써, 상기 저장부에 상기 U 대신 -U를 저장하고 상기 R 대신 -R을 저장하여 처리한다.According to an embodiment, the controller gives the initial value of R to 0, gives the initial value of S to 1, gives the initial value of U to -m, and gives the initial value of V to a, Stores U in place of U in the storage unit, stores-R in place of R, and processes it.

일실시예에 따르면 상기 제어부는, 상기 S의 초기 값으로 1대신 b을 주어 모듈라 역 대신 a

Figure pat00001
b-1 (mod m)을 구하는 모듈라 나눗셈(MD, Modular Division)을 수행하도록 할 수 있다.According to one embodiment, the control unit may set the initial value of S to b instead of 1,
Figure pat00001
modular division (MD) in which b -1 (mod m) is obtained.

일실시예에 따르면 상기 모듈러 역 연산부는 (-R)+S 연산의 결과가 홀수인 경우 상기 m 또는 -m을 더해주는 덧셈기를 상기 -R과 상기 S을 더하는 덧셈기 뒤에 더 포함할 수 있다.According to an embodiment, the modular inverse operation unit may further include an adder for adding the m or -m when the result of the (-R) + S operation is an odd number, after the adder for adding the -R and the S.

일실시예에 따르면 상기 모듈러 역 연산부는 (-U)+V 연산의 결과가 짝수이므로 최하위 비트 중 적어도 하나의 0을 제거하도록, 동일 싸이클에서 오른쪽 정렬(right shift) 하여 (-U)+V의 결과를 상기 저장부에 저장할 수 있다.According to one embodiment, the modulo inverse operation unit right shifts in the same cycle to remove at least one of the least significant bits since the result of the (-U) + V operation is an even number so that (-U) + V And store the result in the storage unit.

일실시예에 따르면 상기 모듈러 역 연산부는 오른쪽 쉬프트해야할 (-U), V, (-U)+V 연산의 결과 중 하나의 최하위 2 비트가 모두 0일 경우, 1-bit 쉬프트 대신 2-bit 쉬프트 되도록 하여 속도를 더 개선할 수 있다.According to one embodiment, the modular inverse operation unit may perform a 2-bit shift operation instead of the 1-bit shift operation when all of the least significant 2 bits of the results of the (-U), V, (-U) So that the speed can be further improved.

나아가, (-U), 또는 V, (-U)+V 연산의 결과 중 하나를 2-bit 쉬프트할 때, 함께 쉬프트되는 (-R), S, (-R)+S 연산의 결과 중 하나의 최하위 2 비트 중 적어도 1 비트가 0이 아닐 경우, 0, m, -m, 및 2m 중 어느 하나를 더해주어 상기 최하위 2-bit을 0으로 만들고 다시 2-bit 쉬프트 되도록 하여 속도를 더 개선할 수도 있다.Furthermore, one of the results of the (-R), S, (-R) + S operations shifted together when shifting one of the results of the (-U) or (-U) If at least one of the least significant 2 bits of the bit is not 0, adding 0, m, -m, or 2m to the least significant 2-bit to 0 and then 2-bit shifting further improves the speed It is possible.

나아가, (-R)+S 연산의 결과를 2-bit shift할 때 (-R)+S의 결과를 기다리지 않고 (-R)와 S 각각의 최하위 2-bit만 더한 결과를 기준으로 0, m, -m, 및 2m 중 하나를 선택하도록 하여 딜레이를 줄일 수 있다.Further, when the result of the (-R) + S operation is 2-bit shifted, the result of addition of the least significant 2-bit of each of (-R) and S without waiting for the result of (-R) , -m, and 2m to reduce delay.

도 1은 일실시예에 따른 ECC 알고리즘 처리 장치의 블록도이다.
도 2는 일실시예에 따른 ECC 알고리즘의 처리 과정을 설명하기 위해 제시되는 참고도이다.
도 3a는 일실시예에 따른 모듈러 역 연산부의 블록도이다.
도 3b는 일실시예들에 따른 ECC 알고리즘의 처리 과정에서의 RS 연산과 LS 연산을 비교하여 설명하기 위한 참고도이다.
도 4는 일실시예에 따른 모듈러 역원 연산부의 예시적 블록도이다.
도 5는 다른 일실시예에 따른 모듈러 역원 연산부의 예시적 블록도이다.
도 6은 또 다른 일실시예에 따른 모듈러 역원 연산부의 예시적 블록도이다.
1 is a block diagram of an apparatus for processing an ECC algorithm according to an embodiment.
2 is a reference diagram for explaining a process of the ECC algorithm according to an embodiment.
3A is a block diagram of a modular inverse operation unit according to an embodiment.
FIG. 3B is a reference diagram for explaining the comparison between the RS operation and the LS operation in the process of the ECC algorithm according to one embodiment.
4 is an exemplary block diagram of a modular inverse operation unit in accordance with one embodiment.
5 is an exemplary block diagram of a modular inverse operation unit according to another embodiment.
6 is an exemplary block diagram of a modular inverse operation unit in accordance with another embodiment.

이하에서, 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다. 그러나, 권리범위는 이러한 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. However, the scope of the rights is not limited or limited by these embodiments. Like reference symbols in the drawings denote like elements.

아래 설명에서 사용되는 용어는, 연관되는 기술 분야에서 일반적이고 보편적인 것으로 선택되었으나, 기술의 발달 및/또는 변화, 관례, 기술자의 선호 등에 따라 다른 용어가 있을 수 있다. 따라서, 아래 설명에서 사용되는 용어는 기술적 사상을 한정하는 것으로 이해되어서는 안 되며, 실시예들을 설명하기 위한 예시적 용어로 이해되어야 한다.The terms used in the following description are chosen to be generic and universal in the art to which they are related, but other terms may exist depending on the development and / or change in technology, customs, preferences of the technician, and the like. Accordingly, the terminology used in the following description should not be construed as limiting the technical thought, but should be understood in the exemplary language used to describe the embodiments.

또한 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 설명 부분에서 상세한 그 의미를 기재할 것이다. 따라서 아래 설명에서 사용되는 용어는 단순한 용어의 명칭이 아닌 그 용어가 가지는 의미와 명세서 전반에 걸친 내용을 토대로 이해되어야 한다.Also, in certain cases, there may be a term chosen arbitrarily by the applicant, in which case the meaning of the detailed description in the corresponding description section. Therefore, the term used in the following description should be understood based on the meaning of the term, not the name of a simple term, and the contents throughout the specification.

Elliptic Curve Cryptosystem in GF(p)Elliptic Curve Cryptosystem in GF (p)

최근 요구되는 보안 강도에 따른 ECC의 키 길이는 256-bit로, 워드 길이인 32-bit 또는 64-bit보다 커 소프트웨어로 구현 시 워드 단위로 나누어 계산해야 한다. 이는 계산 능력이 뛰어난 서버급 환경에서는 큰 문제가 되지 않으나, 자원이 제한된 임베디드 시스템 환경의 경우 ECC 연산은 큰 부담으로 작용할 수 있다. 이와 달리 ECC를 하드웨어로 구현할 경우 ECC의 알고리즘 특성에 맞춘 전용 모듈로 구현할 수 있어 계산 속도를 크게 증가시킬 수 있다. ECC도 다른 공개키 암호 알고리즘과 마찬가지로 유한체(finite field) 상에서의 연산인 모듈러 덧셈(MA, Modular Addition), 모듈러 역(MI, Modular Inversion), 모듈러 곱셈(MM, Modular Multiplication)을 사용한다. 이 중 MI는 다른 대표적인 공개키 암호 알고리즘인 RSA에서는 거의 사용되지 않으나 ECC에서는 빈번하게 사용되는데, MA나 MM에 비해 계산량이 많아 ECC 전체 성능에 큰 영향을 미친다. 따라서 ECC의 하드웨어 설계 시 MI의 효율적인 구현은 매우 중요하다.The key length of ECC according to recently required security strength is 256-bit, it should be calculated by dividing by word when implemented with software which is larger than word length of 32-bit or 64-bit. This is not a big problem in a server-class environment with high computation capability, but ECC computation can be a burden for a resource-constrained embedded system environment. On the other hand, when ECC is implemented in hardware, it can be implemented as a dedicated module according to the characteristics of ECC algorithm, which can greatly increase the calculation speed. ECC uses modular addition (MA), modular inversion (MI), and modular multiplication (MM), which are operations on the finite field as well as other public key cryptographic algorithms. Among them, MI is rarely used in RSA, which is another typical public key encryption algorithm. However, MI is frequently used in ECC. Compared to MA and MM, MI has a large effect on overall performance of ECC. Therefore, efficient implementation of MI in hardware design of ECC is very important.

MI를 하드웨어로 구현에 대한 기존 접근에서는 MI 알고리즘인 유클리드 모듈러 역(EM, Euclidean Modular inverse), 이진 RS 모듈러 역(RS, binary Right-Shift modular inverse), 이진 LS(LS, binary Left-Shift modular inverse) 중에서 RS가 하드웨어 구현 시 가장 속도가 빠르다고 알려져 있다. 그러나, 하드웨어 구현 시 덧셈기가 많이 추가되는 등의 이유로 면적이 상대적으로 크다고 알려져 있다.In the conventional approach for implementing MI in hardware, the MI algorithm, the Euclidean Modular inverse, the RS, the binary right-shift modular inverse, and the binary left-shift modular inverse ), RS is known to be the fastest in hardware implementation. However, it is known that the area is relatively large for reasons such as adding a lot of adders in hardware implementation.

이하에서 설명하는 실시예들에 따르면, 하드웨어 구현 시 가장 속도가 빠른 RS 방식의 MI를 제시하면서도, 기존의 구현보다 면적을 크게 줄였다. 또한, 속도 면에서도 기존보다 싸이클 수가 줄어드는 구조를 제시한다. 또한, 후술하겠지만 이러한 실시예들은 몽고메리 모듈러 역(MMI, Montgomery Modular Inverse) 알고리즘에도 적용이 가능하여 여러 가지 장점이 있다.According to the embodiments described below, the area of the RS is greatly reduced compared to the conventional implementation, while the fastest RS method is presented in the hardware implementation. In addition, it shows a structure in which the number of cycles is reduced compared to the conventional one. Also, as will be described later, these embodiments are applicable to the Montgomery Modular Inverse (MMI) algorithm.

모듈러 역원 연산 알고리즘Modular inversion algorithm

MI(modular inverse) 알고리즘으로는 최대 공약수(GCB: Greatest Common B를 구하는 것에 기반한 방법이 많이 사용된다. 최대 공약수를 구하기 위해 값들을 왼쪽 또는 오른쪽으로 정렬한 후 서로 빼거나 더하는 과정이 반복하여 값을 최대 공약수로 줄여나가게 된다. 소프트웨어 설계의 경우 한정된 자원(CPU의 ALU)로만 덧셈/뺄셈이 수행되기 때문에 추가적인 덧셈/뺄셈을 가진 오른쪽 정렬 방식이 느리나 하드웨어 설계에서는 덧셈기를 더 추가하는 것이 가능하므로 빠른 modular inverse가 가능하다. 그리고 발명한 modular inverse는 구조를 덧셈기의 양을 최소화하고 소모되는 클럭 싸이클을 크게 줄일 수 있는 방법이 포함되어 있다.As a modular inverse (MI) algorithm, a method based on finding the greatest common B is used. To obtain the greatest common divisor, the values are sorted left or right and subtracted or added together to repeat the value In the case of software design, the right alignment method with additional addition / subtraction is slow because addition / subtraction is performed only with limited resources (CPU's ALU). However, since hardware design can add more adders, modular inverse is possible, and the invented modular inverse includes a structure that minimizes the amount of adders and greatly reduces the clock cycles consumed.

ECC 연산 처리 장치의 구조Structure of ECC arithmetic processing unit

도 1은 일실시예에 따른 ECC 알고리즘 처리 장치의 블록도이다.1 is a block diagram of an apparatus for processing an ECC algorithm according to an embodiment.

기본적으로 데이터를 저장하기 위한 레지스터 등의 저장 공간과 모듈러 연산을 위한 모듈러 역, 모듈러 곱, 모듈러 덧셈/뺄셈 모듈, 그리고 이들을 동작과 입출력을 제어하기 위한 제어 로직을 포함하게 된다.Basically, it includes a storage space such as a register for storing data, a modular product for modular operation, a modular product, a modular addition / subtraction module, and a control logic for controlling operation and input / output of the module.

일실시예에 따르면 하드웨어-구현되는 타원곡선 암호화 알고리즘 처리 장치가 제공된다. 장치에는 레지스터 같이 알고리즘 처리 중의 데이터를 저장하기 위한 적어도 하나의 저장부가 포함된다. 그리고 모듈러 역 연산부(MI 모듈)이 포함되는데, 이 모듈러 역 연산부의 구조들에 대한 다양한 실시예들은 보다 상세히 후술한다.According to one embodiment, a hardware-implemented elliptic curve encryption algorithm processing device is provided. The apparatus includes at least one storage unit for storing data during algorithm processing, such as a register. And a modular inverse operation unit (MI module), various embodiments of the structures of the modular inverse operation unit will be described later in more detail.

모듈러 역 연산부는 우측정렬 시프트 (RS: right shift) 방식의 연산을 하드웨어적으로 구현한 모듈이다. MI는 ax = 1 (mod m)의 관계에 있는 a의 모듈러 역 x (단, x = a-1 (mod m)임)을 연산한다.The modular inverse arithmetic unit is a module that implements a right shift (RS) arithmetic operation in hardware. MI computes the modular inverse x (where x = a -1 (mod m)) of a in the relationship ax = 1 (mod m).

그 밖에 다양한 모듈러 덧셈부/뺄셈부 등이 더 포함된다.In addition, various modular addition / subtraction units are further included.

ECC 연산 과정ECC operation process

도 2는 일실시예에 따른 ECC 알고리즘의 처리 과정을 설명하기 위해 제시되는 참고도이다.2 is a reference diagram for explaining a process of the ECC algorithm according to an embodiment.

p가 소수일 때 유한체 GF(p) 상에서의 타원 곡선은 y2 (mod p) = x3 + ax + b (mod p)를 만족하는 (x, y) 점들의 집합과 항등원인 무한대 점 O를 의미한다. 타원 곡선 상에서 두 점에 대한 연산은 포인트 합(PA, Point Addition), 포인트 승(PD, Point Doubling)으로 나뉘며 도 3a는 이를 설명하기 위한 것이다.When p is a prime, the elliptic curve on the finite field GF (p) is a set of (x, y) points satisfying y 2 (mod p) = x 3 + ax + b it means. The operation on two points on the elliptic curve is divided into a point sum (PA) and a point multiplication (PD).

PA는 서로 다른 두 점 간의 덧셈으로, 두 점을 지나는 직선이 타원 곡선과 만나는 다른 한 점을 구한 후 이를 다시 x축 대칭하여 구할 수 있다. PD는 서로 같은 두 점 간의 덧셈으로, 이 두 점에서 타원 곡선의 접선이 타원 곡선과 만나는 다른 한 점을 구한 후 이를 다시 x축 대칭하여 구할 수 있다. 이를 구하기 위한 구체적인 수식은 다음 표와 같다.PA is the addition between two different points, and another point where a straight line passing through two points meets an elliptic curve is obtained and then it can be obtained by x-axis symmetry again. PD is the addition between two identical points. At the two points, another point where the tangent of the elliptic curve meets the elliptic curve is obtained and then it can be obtained by x-axis symmetry again. The concrete formulas for obtaining this are shown in the following table.

Point addition
(x1, y1) + (x2, y2)
Point addition
(x 1 , y 1 ) + (x 2 , y 2 )
Point doubling
2(x1, y1)
Point doubling
2 (x 1, y 1)
x3 x 3

Figure pat00002
Figure pat00002
Figure pat00003
Figure pat00003
y3 y 3
Figure pat00004
Figure pat00004
Figure pat00005
Figure pat00005

위 표 1에서 볼 수 있듯이 PA와 PD를 수행하기 위해서는 모듈러 곱셈, 모듈러 역(또는 나눗셈), 모듈러 덧셈/뺄셈이 필요함을 알 수 있다. PA와 PD를 반복하여 키 생성, ECDH, ECDSA의 주요 연산인 포인트 곱(PM, Point Multiplication)을 수행하게 된다. 일반적인 하드웨어 ECC 모듈의 구조는 다음과 같다.As shown in Table 1 above, modular multiplication, modulo (or division) modular addition / subtraction is required to perform PA and PD. PA and PD are repeated to perform point multiplication (PM, Point Multiplication), which is a key operation of key generation, ECDH and ECDSA. The general hardware ECC module structure is as follows.

기본적으로 데이터를 저장하기 위한 레지스터 등의 저장 공간과 모듈러 연산을 위한 모듈러 역, 모듈러 곱, 모듈러 덧셈/뺄셈 모듈, 그리고 이들을 동작과 입출력을 제어하기 위한 제어 로직을 포함하게 된다.Basically, it includes a storage space such as a register for storing data, a modular product for modular operation, a modular product, a modular addition / subtraction module, and a control logic for controlling operation and input / output of the module.

모듈러 역 모듈의 구조 및 왼쪽 정렬 방식과 오른쪽 정렬 방식 비교Structure of modular station module and comparison of left alignment and right alignment

도 3a는 일실시예에 따른 모듈러 역 연산부의 블록도이다.3A is a block diagram of a modular inverse operation unit according to an embodiment.

일실시예에 따르면 상기 모듈러 역 연산부는, aR≡U (mod m), aS≡V (mod m)를 만족하도록 R, S, U, 및 V 각각의 초기 값을 설정하고, 상기 U 및 상기 V의 값을 오른쪽 쉬프트와 뺄셈을 통해 줄여 나가서 상기 U 및 상기 V 중 어느 하나가 1이 되는 경우에 상기 a의 모듈러 역원인 상기 x를 결정한다.According to one embodiment, the modular inverse operation unit sets the initial values of R, S, U, and V so that aR? U (mod m), aS? V (mod m) Is subtracted through a right shift and a subtraction to determine the modular inverse cause x of the a when the U and the V become one.

여기서 상기 제어부는 상기 R의 초기 값을 1로 주고, 상기 S의 초기 값을 0으로 주고, 상기 U의 초기 값을 -m으로 주고, 상기 V의 초기 값을 a로 줌으로써, 상기 저장부에 상기 U 대신 -U를 저장하고 상기 R 대신 -R을 저장하여 처리한다.Wherein the control unit gives the initial value of R to 1, gives the initial value of S to 0, gives the initial value of U to -m, gives the initial value of V to a, U is stored instead of U, and -R is stored instead of R, and processed.

위에서 말한 초기화 값은 모듈러 역 모듈이 동작을 시작할 때 데이터 저장부의 레지스터 값의 초기 값을 의미한다. 제어부는 데이터 저장부의 내용을 읽어 들여 연산부로 보내 연산을 수행하고 그 결과를 다시 데이터 저장부에 저장시키는 역할을 수행한다. 모듈러 역 알고리즘에 따라 연산부에서 수행하는 연산과 제어부의 제어 방법이 달라진다. 연산부에 덧셈기가 하나만 있을 경우 소프트웨어 환경과 비슷하며, 이 경우 왼쪽 정렬 기반의 모듈러 역 알고리즘의 속도가 더 빠를 수 있다. 아래에서 설명하겠지만 오른쪽 정렬 기반 알고리즘은 추가 연산이 있지만 덧셈기의 수가 충분한 경우 오른쪽 정렬 기반 모듈러 역 알고리즘의 속도가 더 빠르게 된다. 도 3b는 이를 설명하기 위한 것이다.The initialization value mentioned above means the initial value of the register value of the data storage part when the modular module starts its operation. The control unit reads the contents of the data storage unit, sends the data to the operation unit, and stores the result in the data storage unit. The operation performed by the arithmetic unit and the control method of the control unit are changed according to the modular inverse algorithm. If there is only one adder in the operation part, it is similar to the software environment. In this case, the left sort based modular inverse algorithm can be faster. As we will see below, the right-justification-based algorithm has additional operations, but if the number of adders is sufficient, the right-justification-based modular inverse algorithm will be faster. FIG. 3B is for explaining this.

도 3b는 일실시예들에 따른 ECC 알고리즘의 처리 과정에서의 RS 연산과 LS 연산을 비교하여 설명하기 위한 참고도이다. 도 3b의 (a)에서는 가장 왼쪽(most significant bit, MSB)만 0이 되나, (b)에서는 가장 오른쪽(least significant bit, LSB) 뿐만 아니라 뺄셈으로 인한 carry 이동으로 MSB도 높은 확률로 0이 된다. 빼는 두수가 비슷한 크기의 값이었다면, MSB측 bit은 1 bit이 아니라 더 많은 bit이 0이 될 수 있다. 즉, 뺄셈 시 값이 줄어드는 효과가 (b)가 더 빠르다.FIG. 3B is a reference diagram for explaining the comparison between the RS operation and the LS operation in the process of the ECC algorithm according to one embodiment. In FIG. 3B, only the most significant bit (MSB) is 0, but in (b), the MSB is also 0 at a high probability due to a carry operation due to not only the least significant bit (LSB) but also the subtraction . If the number of bits to be subtracted is a value of similar size, the MSB-side bits can be 0 bits rather than 1 bit. That is, the effect of decreasing the value when subtracting is (b) is faster.

기존의 right shift binary inverse 알고리즘Conventional right shift binary inverse algorithm

기존의 오른쪽 정렬 기반 알고리즘은 a-1 (mod m)을 구하고자 할 때, 즉, ax = 1 (mod m)를 만족하는 x를 구할 때, aR≡U (mod m), aS≡V (mod m)를 만족하는 R, S, U, V를 0, 1, m, a로 초기화한 후 right shift를 통해 오른쪽 정렬 후 두 식을 서로 빼어 U와 V의 값을 줄여나가는 방식을 사용한다. 즉, U가 짝수면 R와 함께 오른쪽 shift, V가 짝수면 S와 함께 오른쪽 shift, U와 V가 모두 홀수면 U>V일 때 U=U-V, R=R-S, U<V일 때 V=V-U, S=S-R이 수행된다. 이를 통해 U나 V가 1이 되면 aR≡1 (mod m) 또는 aS≡1 (mod m)이 되므로, R나 S가 a의 역원이 된다.Conventional right-justified based algorithm is a -1 (mod m) to when trying to obtain, that is, ax = 1 (mod m) to in calculating the x satisfying, aR≡U (mod m), aS≡V (mod m, a, r, S, U, and V are initialized to 0, 1, m, a, then right shifted by right shift, and the two expressions are subtracted from each other to reduce the U and V values. That is, if U is the right shift with the even water surface R, V is the right shift with the even water surface S, V = VU when U and V are all U> V, U = UV, R = , S = SR is performed. Thus, when U or V becomes 1, aR≡1 (mod m) or aS≡1 (mod m), R or S becomes the inverse of a.

짝수 U 또는 V를 오른쪽 shift할 때 R과 S가 홀수인 경우 바로 shift하면 1이었던 최하위 bit의 정보가 사라지므로 m을 더하는 추가 연산이 더 필요하다. U-V와 V-U의 선택은 U>V에 의해 결정되므로, U-V>0일 경우 U-V의 값을 그대로 사용하면 되나 U-V<0일 경우 V-U 연산이 추가로 더 필요하다(V-U = -(U-V)이나 이 또한 덧셈 연산이 필요함). 이러한 추가 연산 때문에 왼쪽 정렬에 기반을 둔 modular inverse 알고리즘에 비해 더 많은 덧셈/뺄셈 연산이 필요하게 된다. 특히 소프트웨어 설계에선 한정된 ALU에서 덧셈/뺄셈이 수행되는 것이므로 실행 속도가 많이 느려지게 된다.  If R and S are odd numbers when shifting the even U or V to the right, an additional operation to add m is needed since the information of the least significant bit which is 1 is shifted when shifting immediately. Since the choice of UV and VU is determined by U> V, if UV> 0, the value of UV can be used as is, but if UV <0, an additional VU operation is needed (VU = - (UV) Addition operation is required). This additional operation requires more addition / subtraction operations than the left-aligned based modular inverse algorithm. Especially in software design, the execution speed is slowed down because addition / subtraction is performed in limited ALU.

제안하는 Suggested 일실시예In one embodiment : U의 : U of 초기 값에To the initial value -m을 제공하며  -m RSRS 방식의 MI를 구현 Implementation of MI

도 4는 일실시예에 따른 모듈러 역원 연산부의 예시적 블록도이다.4 is an exemplary block diagram of a modular inverse operation unit in accordance with one embodiment.

발명의 내용은 오른쪽 정렬에 기반을 둔 right shift binary inverse algorithm을 하드웨어로 구현하는 것이다. 우선 modulus m의 bit 길이 n 단위로 덧셈을 수행(워드 단위로 나누지 않음)하도록 하여 제어 회로를 단순화한다. n=256일 때에도 100MHz 이상의 고속 설계가 가능하다. 그리고 right shift와 뺄셈을 각각 별도의 클럭 싸이클에 수행하지 않는다. U와 V 간 뺄셈의 결과는 항상 짝수이므로 뺄셈의 결과는 별도의 클럭 싸이클을 소모하지 않고 뺄셈과 동일한 싸이클 내에서 right shift하여 저장되도록 한다(하드웨어에서는 shift 연산은 비용없는 shift된 wire 연결일 뿐임). 마지막으로 필요한 덧셈기를 필요한 만큼 포함하도록 하여 자원 공유에 따른 클럭 싸이클 수 증가를 방지한다. 이 때 필요한대로 추가된 덧셈기의 수가 많을 수 있으나(5~6개) 제안하는 방법으로 이를 크게 줄일 수 있다(3개).In the present invention, the right shift binary inverse algorithm based on right alignment is implemented in hardware. First, the addition is performed in unit of bit length n of modulus m (not divided in word units) to simplify the control circuit. Even when n = 256, a high-speed design of 100 MHz or more is possible. And do not perform right shift and subtraction on separate clock cycles, respectively. The result of the subtraction between U and V is always even, so the result of the subtraction is stored by right shifting in the same cycle as the subtraction without consuming a separate clock cycle (shift in hardware is only a shift wire connection without cost) . Finally, the necessary adders are included as needed to prevent the number of clock cycles from increasing due to resource sharing. In this case, the number of adders added may be large (5 ~ 6), but this can be greatly reduced by 3 (3).

기존의 알고리즘에선 U=U-V, V=V-U, R=R-S, S=S-R 연산이 수행되나 U와 R가 저장되는 레지스터에 -U와 -R을 저장한다면 수식은 (-U)=(-U)+V, V=(-U)+V, (-R)=(-R)+S, S=(-R)+S이 되어, (-U)+V와 (-R)+S 연산만 필요하게 된다. R와 S에서 +m을 위한 덧셈기까지 포함하여 3개의 덧셈기만 필요하다. 이를 위해 필요한 것은 U와 R의 초기값 값을 음수로 변경하여 입력하는 것뿐이다. U와 R의 초기값은 m, 0이므로, U에만 -m으로 변경하여 입력하면 된다. Right shift binary inverse 알고리즘은 modulus m이 홀수일 때에만 가능한 연산이며 타원곡선 암호에서 m은 항상 홀수이다. 따라서 -m은 m의 최하위 bit만 제외하고 bitwise inverting하는 것만으로 쉽게 구할 수 있다.In the conventional algorithm, U = UV, V = VU, R = RS and S = SR are performed but if the U and R are stored in the register to store -U and -R, + V, V = (- U) + V, (-R) = (- R) + S and S = . Only three adders are needed, including the adders for R and S to + m. All that is needed is to change the initial values of U and R to negative numbers. Since the initial values of U and R are m, 0, only U can be changed to -m. The right shift binary inverse algorithm is only possible when modulus m is odd. In elliptic curve cryptosystem, m is always odd. Therefore, -m can be easily obtained by bitwise inverting only the least significant bit of m.

제안하는 다른 일실시예: 속도를 더욱 개선Another embodiment that suggests: to further improve speed

도 4는 다른 일실시예에 따른 모듈러 역원 연산부의 예시적 블록도이다.4 is an exemplary block diagram of a modular inverse operation unit in accordance with another embodiment.

UV는 V가 짝수일 때 (-U), (-U)가 짝수일 때 V, 둘 다 홀 수 일 때 (-U)+V를 나타내고, RS는 V가 짝수일 때 (-R), (-U)가 짝수일 때 S, 둘 다 홀 수 일 때 (-R)+S를 나타낸다고 하자.UV represents V when both V is an even number (-U), (-U) is an even number, and (-U) + V when both are odd numbers, RS is a (-R) -U) is an even number, and (-R) + S when both are odd numbers.

일실시예에 따르면 상기 모듈러 역 연산부는 상기 RS가 홀수인 경우 상기 m 또는 -m을 더해주는 덧셈기를 상기 -R과 상기 S을 더하는 덧셈기 뒤에 더 포함할 수 있다.According to an embodiment, the modular inverse operation unit may further include an adder for adding m or -m when the RS is an odd number, after an adder for adding the -R and the S.

일실시예에 따르면 상기 모듈러 역 연산부는 (-U)+V 연산의 결과가 짝수이므로 최하위 비트 중 적어도 하나의 0을 제거하도록, 동일 싸이클에서 오른쪽 정렬(right shift) 하여 (-U)+V의 결과를 상기 저장부에 저장할 수 있다.According to one embodiment, the modulo inverse operation unit right shifts in the same cycle to remove at least one of the least significant bits since the result of the (-U) + V operation is an even number so that (-U) + V And store the result in the storage unit.

일실시예에 따르면 상기 모듈러 역 연산부는 상기 UV의 최하위 2 비트가 모두 0일 경우, 2-bit 쉬프트 되도록 하여 속도를 더 개선할 수 있다.According to an exemplary embodiment, the modular inverse operation unit may further improve the speed by being shifted by 2-bit when the least significant two bits of the UV are all zeros.

나아가, 상기 모듈러 역 연산부는 상기 RS의 최하위 2 비트 중 적어도 1 비트가 0이 아닐 경우, 0, m, -m, 및 2m 중 어느 하나를 더해주어 상기 최하위 2-bit을 0으로 만들고 다시 2-bit 쉬프트 되도록 하여 속도를 더 개선할 수도 있다.Further, when at least one of the least significant 2 bits of the RS is not 0, the modular inverse operation unit adds 0, m, -m, and 2m to make the least significant 2-bit to 0, bit shifted to further improve speed.

구체적으로, 본 실시예에서는 UV의 최하위 2 bit이 모두 0일 경우 왼쪽으로 2-bit 쉬프트 되도록 하여 속도를 더 개선할 수 있다. 이 때 RS의 최하위 2-bit은 0이 아닐 수도 있으나 0, m, -m, 2m 중 하나와 더해 최하위 2-bit을 0으로 만드는 것이 가능하다. 그림 2에서 *의 선택 방법은 다음 표와 같다.More specifically, in the present embodiment, if the least significant 2 bits of UV are all 0, the 2-bit shift is performed to the left to further improve the speed. At this time, the least significant 2-bit of RS may not be 0, but it is possible to add 0, m, -m or 2m to the least significant 2-bit. The selection method of * in Fig. 2 is shown in the following table.

UVUV RS의 최하위 2-bitRS's least significant 2-bit m의 최하위 2-bit = 1일 때When the lowest 2-bit of m = 1 m의 최하위 2-bit = 3일 때When the lowest 2-bit of m = 3 최하위 1-bit만 0The least significant 1-bit only 0 0, 20, 2 00 1, 31, 3 mm 최하위 2-bit이 0If the least significant 2-bit is 0 00 00 1One -m-m mm 22 2m2m 33 mm -m-m

도 4를 참조하여 설명한 실시예와 비교하였을 때 m 종류의 선택이 기존 0, -m, m에서 2m이 하나 더 추가될 뿐이며 1 bit shift에 2-bit shift가 더 추가되었기 때문에 multiplexer만 늘어날 뿐 덧셈기나 레지스터 등 비용이 큰 소자는 없어 면적 오버헤드는 크지 않다.As compared with the embodiment described with reference to FIG. 4, since the m-type selection is added to the existing 0, -m, m only by 2m, and the 2-bit shift is further added to the 1-bit shift, The area overhead is not large because there are no expensive devices such as resistors.

추가적 실시예: 몽고메리 역원(Montgomery inverse) 모듈에의 응용Additional embodiments: Application to the Montgomery inverse module

도 6은 또 다른 일실시예에 따른 Almost Montgomery inverse 모듈의 예시적 블록도이다. 앞서 설명한 방법(면적을 줄이는 방법과 속도를 높이는 방법)은 RS 알고리즘과 비슷한 구조의 Montgomery inverse 모듈에도 적용 가능하다. Montgomery inverse 알고리즘은 a-1

Figure pat00006
2n(mod m)을 계산하는 알고리즘으로 크게 두 단계로 나뉜다. 첫 단계는 almost Montgomery inverse라 불리며 a-1
Figure pat00007
2k(mod m) (n<k<2n)을 계산하고 두 번째 단계에서는 이를 a-1
Figure pat00008
2n로 변환한다. almost Montgomery inverse는 RS와 흡사하기 때문에 앞서 사용했던 방법을 적용하면 다음과 같은 구조를 갖는다.6 is an exemplary block diagram of an Almost Montgomery inverse module in accordance with another embodiment. The methods described above (reducing area and increasing speed) are also applicable to the Montgomery inverse module, which is similar in structure to the RS algorithm. The Montgomery inverse algorithm is a -1
Figure pat00006
2 n (mod m). The algorithm is divided into two stages. The first step is called the almost Montgomery inverse and a -1
Figure pat00007
2 k (mod m) (n <k <2n) calculating and the second step it a -1
Figure pat00008
2 n . Almost Montgomery inverse is similar to RS, so we apply the previous method and it has the following structure.

RS 알고리즘과 동일하게 변수 U와 R에 -U와 -R을 저장하도록 하여 덧셈기의 양을 줄일 수 있다. RS 알고리즘과 달리 R, S를 계산하는 쪽에 m, -m, 2m을 더하는 연산이 없어 더 적은 덧셈기가 소모된다. 상기 도 6 내에서 1-bit shift 부분에 "제안하는 발명2"에서 RS 알고리즘의 속도를 향상시켰던 것처럼 추가로 2-bit shift와 이를 위한 multiplexer를 추가하여도 되며, RS 알고리즘과 달리 m을 더하는 연산이 없기 때문에 3-bit shift와 이를 위한 multiplexer를 추가하는 것이 가능하다. 그 이상의 shift도 추가할 수 있으나 그에 따른 속도 향상 효과는 갈수록 떨어진다.The amount of adders can be reduced by storing -U and -R in variables U and R as in RS algorithm. Unlike the RS algorithm, there are no operations to add m, -m, and 2m to the R and S computation side, and fewer adders are consumed. 6, a 2-bit shift and a multiplexer may be added as in the case of improving the speed of the RS algorithm in the " proposed invention 2 " in the 1-bit shift part. In contrast to the RS algorithm, It is possible to add a 3-bit shift and a multiplexer for it. You can add more shifts, but the speeding effect is getting worse.

알고리즘 설명Algorithm Description

Algorithm 1은 RS와 RS의 면적을 개선한 알고리즘으로, 음영 표시의 왼쪽은 원래 RS를, 오른쪽은 RS의 면적을 개선한 RS variant를 나타낸다. 나머지 부분은 공통 사용 부분이다. Algorithm 1의 while문의 루프 불변자(loop invariant)는Algorithm 1 is an algorithm that improves the area of RS and RS. The left side of the shaded area represents the original RS and the right side represents the RS variant that improves the area of RS. The remaining part is the common use part. The loop invariant of the while statement of Algorithm 1

aR ≡U (mod m), aS ≡ V (mod m) --- (1)aR? U (mod m), aS? V (mod m) --- (1)

이다. Algorithm 1의 첫 번째 줄에서 R, S, U, V는 각각 0, 1, m, a로 초기화되며, while문 내에서 right-shift와 뺄셈을 통해 U와 V에 저장된 값이 지속적으로 감소된다. V = 0일 때 U의 값이 0이면 a-1(mod m)이 존재하지 않으며, U의 값이 1이면 aR≡ 1 (mod m)이 되어, R에 저장되어 있는 값이 a-1 (mod m)이 된다. ECC 알고리즘에서 modulus m은 항상 소수이므로 역원이 존재하지 않는 경우는 없다. 이하에서는 역원이 존재하는 경우만 가정하여 설명한다. 표 3은 상술한 Algorithm 1의 예시이다.to be. In the first line of Algorithm 1, R, S, U, and V are initialized to 0, 1, m, and a respectively, and the values stored in U and V are continuously reduced by right-shift and subtraction in the while statement. If V is 0, then a -1 (mod m) does not exist if U is 0, aR≡ 1 (mod m) if U is 1 and the value stored in R is a -1 mod m). In the ECC algorithm, the modulus m is always a prime number, so there is no case where the inverse does not exist. In the following description, it is assumed that only the inverse exists. Table 3 is an example of Algorithm 1 described above.

Figure pat00009
Figure pat00009

앞서 설명한 바와 같이 RS는 14째 줄의 U > V의 결과에 따라 U-V와 V-U의 선택이 달라진다. U > V 연산은 결국 U-V > 0이므로 U-V 연산은 기본적으로 수행되며, 그 결과가 음수일 경우 V-U 를 위한 추가 연산이 필요하다. 이들은 서로 덧셈의 역원 관계로 V-U = -(U-V)로도 계산이 가능하나, 2의 보수를 계산하는 과정 역시 덧셈기가 필요하다. 별도의 클럭 싸이클을 소모하지 않으려면 U-V와 V-U 각각에 덧셈기가 하나씩 필요하다. R-S와 S-R 연산을 수행하는 것도 마찬가지 이유로 2개의 덧셈기가 필요하다. 그리고 홀수 R과 S를 right-shift하기 위한 +m 연산(6번째 줄과 10번째 줄)까지 고려하면 소모 클럭 싸이클 수와 최상 경로(critical path)를 최소화하면서 RS를 하드웨어로 설계하는 것은 적어도 5∼6개의 덧셈기가 필요하다.As described above, the selection of U-V and V-U depends on the result of U> V on the 14th line of RS. The U-V operation is basically performed because U-V> 0, and if the result is negative, an additional operation for V-U is required. These can be calculated as V-U = - (U-V) as the inverse relation of addition, but the process of calculating the complement of 2 also requires an adder. If you do not want to consume a separate clock cycle, you need one adder for each of U-V and V-U. Two adders are also required for performing R-S and S-R operations for the same reason. Considering the + m operation (6th and 10th lines) for right-shifting the odd R and S, the hardware design of the RS with minimizing the number of consumed clock cycles and the critical path is at least 5 ~ Six adders are required.

그런데, 오른쪽에서 대안으로 제시한 본 실시예에서는, U가 저장되는 레지스터에 (-U)를 저장하고, R이 저장되는 레지스터에 (-R)을 저장하는 식으로 간단한 수식만 바꾸었는데, 요구되는 덧셈기의 수를 반으로 줄였다. (달라진 주요 부분은 Algorithm 1의 첫 번째 줄과 12∼21번째 줄 음영 표시의 오른쪽 참고) 즉, 변경된 알고리즘에서는 변수 U와 R에 -U와 -R을 저장한다. 이를 위해 U가 m이 아닌 -m으로 초기화되며, 초기 값이 0인 R에서는 아무런 변화가 없다. 변경 결과 덧셈 연산만 존재하게 되어, (-U) + V, (-R) + S에 각 하나, 홀수 R과 S에 대한 +m (공용 사용)을 위해 하나, 총 3개의 덧셈기가 필요하다. 종래에 추가로 필요하던 5개의 덧셈기에 비해 덧셈기 수가 3개로 줄었다.By the way, in the present embodiment which is alternatively shown on the right, only a simple expression is changed by storing (-U) in a register in which U is stored and storing (-R) in a register in which R is stored, We reduced the number of adders by half. The modified algorithm stores -U and -R in the variables U and R. In the modified algorithm, For this, U is initialized to -m, not m, and there is no change in R with initial value 0. As a result of the change, there are only add operations, and a total of three adders are required, one for (-U) + V, (-R) + S and one for odd R and S for + m (shared use). The number of adders is reduced to three compared to the five additional adders that were previously required.

이상에서 설명된 장치는 메모리의 하드웨어 구성요소, 메모리를 제어 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 예를 들어, 실시예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPA(field programmable array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다.The apparatus described above may be implemented as a hardware component of a memory, a memory control software component, and / or a combination of hardware components and software components. For example, the apparatus and components described in the embodiments may be implemented within a computer system, such as, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable array (FPA) A programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.The software may include a computer program, code, instructions, or a combination of one or more of the foregoing, and may be configured to configure the processing device to operate as desired or to process it collectively or collectively Device can be commanded. The software and / or data may be in the form of any type of machine, component, physical device, virtual equipment, computer storage media, or device , Or may be permanently or temporarily embodied in a transmitted signal wave. The software may be distributed over a networked computer system and stored or executed in a distributed manner. The software and data may be stored on one or more computer readable recording media.

실시예에 따른 메모리 동작 제어 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The memory operation control method according to the embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

실시예들이 비록 한정된 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다. 그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Although the embodiments have been described with reference to the drawings, various modifications and variations may be made by those skilled in the art. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI &gt; or equivalents, even if it is replaced or replaced. Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (7)

하드웨어-구현되는 타원곡선 암호화 알고리즘 처리 장치에 있어서,
알고리즘 처리 중의 데이터를 저장하기 위한 적어도 하나의 저장부;
우측정렬 시프트 (right shift) 방식으로 ax = 1 (mod m)의 관계에 있는 a의 모듈러 역 x (단, x = a-1 (mod m)임)을 연산하는 모듈러 역 연산부; 및
상기 알고리즘 처리 과정에서의 모듈러 덧셈을 수행하는 적어도 하나의 모듈러 덧셈 연산부
를 포함하는 타원곡선 암호화 알고리즘 처리 장치.
A hardware-implemented elliptic curve encryption algorithm processing apparatus comprising:
At least one storage for storing data during algorithm processing;
A modulo inverse calculation unit operable to calculate a modulo inverse x (where x = a -1 (mod m)) of a in a relation of ax = 1 (mod m) in a right shift scheme; And
At least one modular addition operation unit for performing modular addition in the algorithm process,
And an elliptic curve encryption algorithm processing unit.
제1항에 있어서,
상기 모듈러 역 연산부는,
aR≡U (mod m), aS≡V (mod m)를 만족하도록 R, S, U, 및 V 각각의 초기 값을 설정하고, 상기 U 및 상기 V의 값을 줄여 나가서 상기 U 및 상기 V 중 어느 하나가 1이 되는 경우에 상기 a의 모듈러 역원인 상기 x를 결정하는 타원곡선 알고리즘 처리 장치.
The method according to claim 1,
Wherein the modular inverse operation unit comprises:
S, U, and V are set so that aR? U (mod m) and aS? V (mod m) are satisfied, the values of U and V are reduced, And determines the modulo-denominator cause x of the a if any one is 1. The apparatus of claim &lt; RTI ID = 0.0 &gt; 1, &lt; / RTI &gt;
제2항에 있어서,
상기 모듈러 역 연산부는 상기 R의 초기 값을 0로 주고, 상기 S의 초기 값을 1으로 주고, 상기 U의 초기 값을 -m으로 주고, 상기 V의 초기 값을 a로 줌으로써, 상기 저장부에 상기 U 대신 -U를 저장하고 상기 R 대신 -R을 저장하여 처리하는 타원곡선 알고리즘 처리 장치.
3. The method of claim 2,
The modular inverse operation unit gives the initial value of R to 0, gives the initial value of S to 1, gives the initial value of U to -m, and gives the initial value of V to a, Storing an -U in place of the U and storing -R in place of the R and processing the elliptic curve algorithm.
제3항에 있어서,
상기 모듈러 역 연산부는 (-R)+S 연산의 결과가 음수인 경우 상기 m을 더해주는 덧셈기를 상기 -R과 상기 S을 더하는 덧셈기 뒤에 더 포함하는 타원곡선 알고리즘 처리 장치.
The method of claim 3,
Wherein the modular inverse operation unit further includes an adder for adding m to the adder for adding the -R and the S when the result of the (-R) + S operation is negative.
제3항에 있어서,
상기 모듈러 역 연산부는 (-U)+V 연산의 결과가 짝수이므로 최하위 비트 중 적어도 하나의 0을 제거하도록, 동일 싸이클에서 오른쪽 정렬(right shift) 하여 (-U)+V의 결과를 상기 저장부에 저장하는 타원곡선 알고리즘 처리 장치.
The method of claim 3,
The modular inverse operation unit right shifts in the same cycle so as to eliminate at least one of the least significant bits since the result of the (-U) + V operation is an even number, thereby outputting a result of (-U) + V, The elliptic curve algorithm processing device stores in.
제5항에 있어서,
상기 모듈러 역 연산부는 (-U)+V 연산의 결과의 최하위 2 비트가 모두 0일 경우, 2-bit 쉬프트 되도록 하여 속도를 더 개선하는 타원곡선 알고리즘 처리 장치.
6. The method of claim 5,
Wherein the modular inverse arithmetic unit is 2-bit shifted when the least significant 2 bits of the result of the (-U) + V operation are all 0, thereby further improving the speed.
제5항에 있어서,
상기 모듈러 역 연산부는 쉬프트해야 할 (-R), S, (-R)+S 연산의 결과 중 하나의 최하위 2 비트 중 적어도 1 비트가 0이 아닐 경우, 0, m, -m, 및 2m 중 어느 하나를 더해주어 상기 최하위 2-bit을 0으로 만들고 다시 2-bit 쉬프트 되도록 하여 속도를 더 개선하는 타원곡선 알고리즘 처리 장치.
6. The method of claim 5,
The modular inverse calculation unit calculates 0, m, -m, and 2m when at least one of the least significant two bits of the results of the (-R), S, (-R) + S operations to be shifted is not 0 Wherein the least significant 2-bit is set to 0, and the 2-bit is shifted again to further improve the speed.
KR1020170107740A 2017-08-25 2017-08-25 Hardware-implemented modular inversion module KR101977873B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170107740A KR101977873B1 (en) 2017-08-25 2017-08-25 Hardware-implemented modular inversion module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170107740A KR101977873B1 (en) 2017-08-25 2017-08-25 Hardware-implemented modular inversion module

Publications (2)

Publication Number Publication Date
KR20190022023A true KR20190022023A (en) 2019-03-06
KR101977873B1 KR101977873B1 (en) 2019-08-28

Family

ID=65761291

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170107740A KR101977873B1 (en) 2017-08-25 2017-08-25 Hardware-implemented modular inversion module

Country Status (1)

Country Link
KR (1) KR101977873B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685758A (en) * 2020-12-31 2021-04-20 南方电网科学研究院有限责任公司 Data encryption system based on elliptic curve encryption algorithm
CN117014208A (en) * 2023-08-09 2023-11-07 海光信息技术股份有限公司 Data encryption method, device, system, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269060A (en) * 1997-01-27 1998-10-09 Toshiba Corp Montgomery division device, montgomery inverse element calculation device, montgomery division method and montgomery inverse element calculation method
KR100585119B1 (en) 2004-01-07 2006-06-01 삼성전자주식회사 Cryptographic apparatus and cryptographic method , and storage medium thereof
KR20070105415A (en) * 2006-04-26 2007-10-31 고려대학교 산학협력단 Appratus for adding and multipying with sign encoding and method thereof
KR20100062565A (en) 2008-12-02 2010-06-10 삼성전자주식회사 Method for calculating negative inverse of modulus
KR20120088316A (en) 2011-01-31 2012-08-08 삼성전자주식회사 Montgomery inverse calculation device and method for calculating montgomery inverse using the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10269060A (en) * 1997-01-27 1998-10-09 Toshiba Corp Montgomery division device, montgomery inverse element calculation device, montgomery division method and montgomery inverse element calculation method
KR100585119B1 (en) 2004-01-07 2006-06-01 삼성전자주식회사 Cryptographic apparatus and cryptographic method , and storage medium thereof
KR20070105415A (en) * 2006-04-26 2007-10-31 고려대학교 산학협력단 Appratus for adding and multipying with sign encoding and method thereof
KR20100062565A (en) 2008-12-02 2010-06-10 삼성전자주식회사 Method for calculating negative inverse of modulus
KR20120088316A (en) 2011-01-31 2012-08-08 삼성전자주식회사 Montgomery inverse calculation device and method for calculating montgomery inverse using the same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
기술문헌 "P. Choi, J. Kong, and D.K. Kim, "Analysis of Hardware Modular Inversion Modules for Elliptic Curve Cryptography," Proceeding of International SoC Design Conference, pp.313-314, 2015"

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685758A (en) * 2020-12-31 2021-04-20 南方电网科学研究院有限责任公司 Data encryption system based on elliptic curve encryption algorithm
CN112685758B (en) * 2020-12-31 2024-02-06 南方电网科学研究院有限责任公司 Data encryption system based on elliptic curve encryption algorithm
CN117014208A (en) * 2023-08-09 2023-11-07 海光信息技术股份有限公司 Data encryption method, device, system, electronic equipment and storage medium
CN117014208B (en) * 2023-08-09 2024-04-09 海光信息技术股份有限公司 Data encryption method, device, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
KR101977873B1 (en) 2019-08-28

Similar Documents

Publication Publication Date Title
Sasdrich et al. Efficient elliptic-curve cryptography using Curve25519 on reconfigurable devices
JP5116770B2 (en) Module reduction using folding
US7908641B2 (en) Modular exponentiation with randomized exponent
US20090319804A1 (en) Scalable and Extensible Architecture for Asymmetrical Cryptographic Acceleration
WO2015164996A1 (en) Elliptic domain curve operational method and elliptic domain curve operational unit
CN109814838B (en) Method, hardware device and system for obtaining intermediate result set in encryption and decryption operation
TWI553548B (en) Method, device and computer software product for cryptographic computation
WO2021004454A1 (en) Operation method, apparatus and device
Bos et al. Montgomery arithmetic from a software perspective
JP2002229445A (en) Modulator exponent device
Sasdrich et al. Cryptography for next generation TLS: implementing the RFC 7748 elliptic curve448 cryptosystem in hardware
KR101977873B1 (en) Hardware-implemented modular inversion module
JP5553773B2 (en) Apparatus and method for calculating scalar multiple of points on elliptic curve
CN113193962B (en) SM2 digital signature generation and verifier based on lightweight modular multiplication
JP2006259735A (en) Elliptic curve point octupling using single instruction multiple data processing
Moon et al. Fast VLSI arithmetic algorithms for high-security elliptic curve cryptographic applications
JP2004227344A (en) Multiplier and code circuit
WO2023236899A1 (en) Data processing method, apparatus, device and storage medium
CN104123431B (en) A kind of mould of element is against computational methods and device
WO2024086243A1 (en) Protection of polynomial cryptographic operations against side-channel attacks with change-of-variable transformations
US11985221B2 (en) Efficient masking of secure data in ladder-type cryptographic computations
JP4567753B2 (en) Parity generation circuit, counting circuit, and counting method
KR101707334B1 (en) Apparatus for efficient elliptic curve cryptography processor and method for the same
JP2004125891A (en) Power remainder computer
JP2002358010A (en) Exponentiation remainder computing element

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant