KR100939356B1 - Apparatus and method for modular multiplier - Google Patents

Apparatus and method for modular multiplier Download PDF

Info

Publication number
KR100939356B1
KR100939356B1 KR1020070127020A KR20070127020A KR100939356B1 KR 100939356 B1 KR100939356 B1 KR 100939356B1 KR 1020070127020 A KR1020070127020 A KR 1020070127020A KR 20070127020 A KR20070127020 A KR 20070127020A KR 100939356 B1 KR100939356 B1 KR 100939356B1
Authority
KR
South Korea
Prior art keywords
modular
value
memory
output
input
Prior art date
Application number
KR1020070127020A
Other languages
Korean (ko)
Other versions
KR20090059921A (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 KR1020070127020A priority Critical patent/KR100939356B1/en
Publication of KR20090059921A publication Critical patent/KR20090059921A/en
Application granted granted Critical
Publication of KR100939356B1 publication Critical patent/KR100939356B1/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/722Modular multiplication
    • 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/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • G06F7/505Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination
    • G06F7/506Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination with simultaneous carry generation for, or propagation over, two or more stages
    • G06F7/507Adding; Subtracting in bit-parallel fashion, i.e. having a different digit-handling circuit for each denomination with simultaneous carry generation for, or propagation over, two or more stages using selection between two conditionally calculated carry or sum values
    • 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/728Methods 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 using Montgomery reduction

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Complex Calculations (AREA)

Abstract

본 발명은 모듈러 곱셈 장치 및 그 방법에 관한 것이다.The present invention relates to a modular multiplication device and method thereof.

본 발명에서는, 외부로부터 데이터를 수신하며, 수신된 데이터를 이용하여 제어 신호를 생성한다. 그리고, 생성된 제어 신호를 이용하여 메모리에 접근하려는 적어도 하나의 기능부 중 어느 하나를 선택한 후, 선택된 기능부에게 메모리로의 접근을 허용한다. 이어, 선택된 기능부가 워드 단위의 모듈러 곱셈 연산을 반복적으로 수행하면, 수행하는 동안 중 발생하는 적어도 하나의 결과 값을 메모리에 저장한다. 그리고, 수행된 곱셈 연산 결과를 외부로 전달한다.In the present invention, data is received from the outside and a control signal is generated using the received data. After selecting one of the at least one functional unit to access the memory using the generated control signal, the selected functional unit is allowed to access the memory. Subsequently, when the selected function unit repeatedly performs a modular multiplication operation in units of words, at least one result value generated during the operation is stored in the memory. Then, the result of the multiplication operation performed is transmitted to the outside.

이처럼, 연속적인 워드-베이스 모듈러 곱셈 과정을 수행하는 동안, 내장되어 있는 메모리를 직접적으로 제어함으로써, 데이터 입출력으로 인한 시간 지연을 제거할 수 있다.As such, during the continuous word-based modular multiplication process, by controlling the built-in memory directly, it is possible to eliminate the time delay due to data input and output.

암호화, 모듈러(MODULAR), 연산, 지수승, 시간 지연, 메모리, 인터페이스 Encryption, Modular, Arithmetic, Exponential, Time Delay, Memory, Interface

Description

모듈러 곱셈 장치 및 그 방법 {APPARATUS AND METHOD FOR MODULAR MULTIPLIER}Modular multiplication apparatus and its method {APPARATUS AND METHOD FOR MODULAR MULTIPLIER}

본 발명은 모듈러 곱셈 장치 및 그 방법에 관한 것으로서, 보다 상세하게는 이동통신 시스템의 모듈러 곱셈 장치 및 그 방법에 관한 것이다. The present invention relates to a modular multiplication apparatus and a method thereof, and more particularly, to a modular multiplication apparatus and a method of a mobile communication system.

본 발명은 정보통신부 및 정보통신연구진흥원의 IT성장동력기술개발사업의 일환으로 수행한 연구로부터 도출된 것이다[과제관리번호: 2006-S-041-02, 과제명: 차세대 모바일 단말기의 보안 및 신뢰 서비스를 위한 공통 보안 핵심 모듈 개발].The present invention is derived from the research conducted as part of the IT growth engine technology development project of the Ministry of Information and Communication and the Ministry of Information and Telecommunication Research and Development. [Task Management Number: 2006-S-041-02, Title: Security and Reliability of Next Generation Mobile Terminals] Develop common security core modules for services.

최근 들어, 컴퓨터 시스템을 포함한 각종 이동통신 단말기에 대한 보안 위협이 급증하면서, 그 해결 방안을 다양한 각도에서 검토 및 개발하고 있다. Recently, with the rapid increase of security threats to various mobile communication terminals including computer systems, solutions have been reviewed and developed from various angles.

이중, 공개 키 암호화 알고리즘인 RSA(Rivest-Shamir-Adleman, 세 명의 공동 발명자 이름, 이하 'RSA'라 함) 암호 알고리즘은 모듈러 지수승을 통해 구현할 수 있으며, 이는 모듈러 곱셈의 반복 수행을 통하여 가능하다. Dual, public key cryptographic algorithm, RSA (Rivest-Shamir-Adleman, three co-inventor names, hereinafter referred to as 'RSA') cryptographic algorithm can be implemented through modular exponentiation, which is possible through iterative modular multiplication. .

일반적으로, 모듈러 곱셈을 빠르게 반복 수행하기 위해서는 몽고메리 알고리즘을 주로 사용한다. 특히, 모바일의 TPM(Trusted Platform Module)과 같이 제한된 하드웨어 리소스를 가지는 시스템 상에, RSA 암호화 알고리즘을 적용하기 위해서 는, 전체 데이터를 한꺼번에 처리하는 것이 아니라, 워드(Word) 단위로 나누어 연산하는 워드-베이스(word-base) 몽고메리 알고리즘을 사용한다. In general, Montgomery's algorithm is used mainly for fast iteration of modular multiplication. In particular, in order to apply the RSA encryption algorithm on a system with limited hardware resources, such as a mobile Trusted Platform Module (TPM), a word that is calculated by dividing the data into units of words instead of processing all the data at once. The word-base Montgomery algorithm is used.

이에 따라, 워드-베이스 몽고메리 알고리즘을 적용하여 설계된 모듈러 곱셈기 역시 워드 단위로 연산을 수행한다. 그런데, 모듈러 곱셈기를 이용하여 전체 데이터를 연산하기 위해서는, 시스템의 제어에 따라 시스템과 모듈러 곱셈기간의 입출력 동작이 반복적으로 이루어져야 한다.Accordingly, the modular multiplier designed by applying the word-based Montgomery algorithm also performs operations in units of words. However, in order to calculate the entire data using the modular multiplier, the input and output operations of the system and the modular multiplication period must be repeatedly performed under the control of the system.

그러나, 시스템과 모듈러 곱셈기간의 반복적인 데이터 입출력 동작에 의해 발생되는 시간 지연은, 모듈러 곱셈기 자체의 성능과는 상관없이 전체 모듈라 곱셈의 성능을 저하시키는 중요한 원인이 된다.However, the time delay caused by repetitive data input / output operations between the system and the modular multiplication period is an important cause of degrading the overall modular multiplication regardless of the performance of the modular multiplier itself.

그런데, 데이터 입출력으로 소요되는 시간은 개선이 불가능한 시스템이 가지는 고유한 인터페이스 성능이므로, 성능 향상을 위한 방안으로 모듈러 곱셈기 자체의 동작 속도를 증가시키는 것만으로는, 모듈러 곱셈 동작의 획기적인 성능 향상을 기대하기가 매우 어렵다. However, since the time required for data input / output is a unique interface performance of a system that cannot be improved, it is necessary to increase the operation speed of the modular multiplier itself as a method for improving performance, and expect a significant performance improvement of the modular multiplication operation. Is very difficult.

즉, 이동통신 단말기와 같이 고속 및 저면적을 동시에 요구하는 시스템인 경우, 워드 단위의 몽고메리 알고리즘을 그대로 적용한 모듈러 곱셈기는 만족할 만한 성능을 보여줄 수 없다는 문제를 가진다. That is, in the case of a system requiring a high speed and a low area at the same time as a mobile communication terminal, the modular multiplier using the Montgomery algorithm of word units as it is, there is a problem that can not show satisfactory performance.

본 발명이 이루고자 하는 기술적 과제는 전체 데이터 크기의 모듈러 곱셈 연산을 수행하기 위해 요구되는 반복적인 데이터 입출력에 의한 시간 지연을 제거할 수 있는 장치 및 그 방법을 제공하기 위한 것이다. It is an object of the present invention to provide an apparatus and method for eliminating the time delay caused by repetitive data input / output required to perform a modular multiplication operation of the total data size.

이러한 목적을 달성하기 위한 본 발명의 특징에 따른 모듈러 곱셈 장치는, 모듈러 곱셈 연산을 반복적으로 수행하는 모듈러 곱셈부; 상기 수행하는 연산 과정 중 발생하는 적어도 하나의 결과 값이 저장되는 메모리; 및 상기 결과 값 중 어느 하나를 이용하여 상기 모듈러 곱셈부와의 동기를 맞춘 후, 상기 맞춰진 동기에 따라 상기 모듈러 곱셈부로부터 출력되는 값을 상기 메모리에 저장하며, 상기 모듈러 곱셈부가 요청하는 적어도 하나의 값을 상기 메모리에서 읽어 들여 상기 모듈러 곱셈부로 제공하는 모듈러 인터페이스부를 포함한다.Modular multiplication apparatus according to the characteristics of the present invention for achieving this object, the modular multiplication unit for repeatedly performing a modular multiplication operation; A memory configured to store at least one result value generated during the operation process; And after synchronizing with the modular multiplier using any one of the result values, storing a value output from the modular multiplier in the memory according to the matched synchronization, and at least one requesting the modular multiplier. And a modular interface unit for reading a value from the memory and providing the value to the modular multiplier.

또한, 본 발명의 다른 특징에 따른 모듈러 곱셈 방법은, 외부로부터 입력되는 신호들의 동기를 맞춘 후, 상기 맞춰진 신호를 통해 메모리에 접근하기 위한 신호를 생성하는 단계; 상기 생성된 신호를 이용하여 상기 외부로부터 요청 받은 상기 메모리 내의 주소에 저장된 값을 읽어 들인 후, 상기 읽어 들인 값 및 상기 읽어 들인 값을 알리는 제어 신호를 상기 외부로 출력하는 단계; 소정의 값을 통해 모듈러 곱셈 연산을 수행하는 기능부와의 동기를 맞춘 후, 상기 맞춰진 동기에 따라, 상기 기능부의 출력 값 중 적어도 하나를 상기 메모리에 저장하는 단계; 상기 기능부가 요청하는 상기 메모리의 주소에 저장된 값을 읽어 들여 상기 기능부로 제공하는 단계; 상기 외부로부터 입력되는 신호 중 어느 하나를 이용하여 제어 신호를 생성한 후, 상기 생성된 제어 신호를 이용하여 상기 메모리에 접근하려는 기능부 중 어느 하나의 기능부를 선택하는 단계; 및 상기 선택된 기능부의 신호를 상기 메모리로 전송하며, 상기 메모리로부터 출력되는 값을 상기 메모리에 접근하려는 기능부 중 어느 하나에 전송하는 단계를 포함한다.In addition, the modular multiplication method according to another aspect of the present invention, after synchronizing the signals input from the outside, generating a signal for accessing the memory through the matched signal; Reading a value stored at an address in the memory requested from the outside using the generated signal, and then outputting a control signal notifying the read value and the read value to the outside; Synchronizing with a function unit that performs a modular multiplication operation through a predetermined value, and storing at least one of output values of the function unit in the memory according to the matched synchronization; Reading a value stored in an address of the memory requested by the function unit and providing the value to the function unit; Generating a control signal using any one of the signals input from the outside, and then selecting any one of the functional units to access the memory using the generated control signals; And transmitting a signal of the selected functional unit to the memory, and transmitting a value output from the memory to any one of the functional units to access the memory.

본 발명에 따르면, 내장된 메모리와 모듈러 인터페이스부간의 데이터 입출력을 통해, 워드-베이스 모듈러 곱셈 과정을 연속적으로 수행하는 동안 메모리를 직접적으로 제어함으로써, 데이터 입출력으로 인한 시간 지연을 제거할 수 있다.According to the present invention, through the data input and output between the built-in memory and the modular interface, by directly controlling the memory during the continuous word-based modular multiplication process, it is possible to eliminate the time delay due to the data input and output.

또한, 내장된 메모리의 세그먼트에 저장된 값의 변경 또는 갱신을 통해, 모듈러 지수승 연산을 순차적으로 진행할 수 있다.In addition, the modular exponential operation may be sequentially performed by changing or updating a value stored in a segment of an embedded memory.

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시 예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the present invention. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. In the drawings, parts irrelevant to the description are omitted in order to clearly describe the present invention, and like reference numerals designate like parts throughout the specification.

명세서 전체에서, 어떤 부분이 어떤 구성 요소를 "포함" 한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한, 명세서에 기재된 "…부", "…기", "모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있 다.Throughout the specification, when a part is said to "include" a certain component, it means that it can further include other components, except to exclude other components unless specifically stated otherwise. In addition, the terms “… unit”, “… unit”, “module”, etc. described in the specification mean a unit that processes at least one function or operation, which may be implemented by hardware or software or a combination of hardware and software. have.

먼저, 본 발명의 실시 예에 적용하는 몽고메리(Montgomery) 모듈러 곱셈 알고리즘에 대해 설명한다. 참고로, RSA(Rivest-Shamir-Adleman, 이하 'RSA'라 함) 연산 및 모듈러 곱셈의 기본적인 수학식은 본 발명이 속하는 기술 분야의 전문가라면 쉽게 알 수 있는 내용이기 때문에, 구체적인 언급은 생략한다. First, the Montgomery modular multiplication algorithm applied to an embodiment of the present invention will be described. For reference, since the basic equations for RSA (Rivest-Shamir-Adleman, RSA) operation and modular multiplication are easily understood by those skilled in the art, detailed descriptions thereof are omitted.

모듈러 곱셈을 잉여계수 r을 이용해서 정수 Zn영역에서 계산을 rZn영역으로 옮겨 계산하는 방법으로, 몫과 나머지를 구하는 고전적인 나눗셈을 사용하지 않으면서 모듈러 연산을 가능케 하는 방법이 몽고메리 곱셈 알고리즘이다.Montgomery multiplication algorithm is a method of modular multiplication by using the surplus coefficient r to transfer the calculation from the integer Z n area to the rZ n area, without using the classical division of quotient and remainder. .

R = A × B × r-1modNR = A × B × r -1 modN

상기의 수학식 1을 구현하기 위해, 임의의 워드 단위로 나누어 수행하는 워드 베이스(word-base) 몽고메리 알고리즘은 아래의 수학식 2와 같다.In order to implement Equation 1, a word-base Montgomery algorithm, which is divided into arbitrary word units, is performed by Equation 2 below.

Step 1 : R = 0Step 1: R = 0

Step 2 : for i = 0 to p-1 {Step 2: for i = 0 to p-1 {

Step 3 : R = R+A×Bi(Bi는 w-bit 워드)Step 3: R = R + A × B i (B i is w-bit word)

m = R0×N0 *mod2w(N0×N0 *=-1mod2w)m = R 0 × N 0 * mod2 w (N 0 × N 0 * = -1 mod2 w )

R = R+N*m             R = R + N * m

R = R/2w R = R / 2 w

}       }

Step 4 : if(R>N) R = R-N Step 4: if (R> N) R = R-N

Step 5 : return (R)Step 5: return (R)

또한, 수학식 2에 있어서 몽고메리 알고리즘 보정 인자 m을 별도의 연산 과정 없이 단계적인 연산 내에서 처리하는 방법은 아래의 수학식 3과 같다.In addition, the method of processing the Montgomery algorithm correction factor m in the stepwise calculation without a separate calculation process in Equation 2 is as shown in Equation 3 below.

Step 1 : R = 0, T = 0Step 1: R = 0, T = 0

Step 2 : for i = 0 to p-1 {Step 2: for i = 0 to p-1 {

Carry_pre = 0, Carry_next = 0             Carry_pre = 0, Carry_next = 0

Step 3 : for j = 0 to p-1 {Step 3: for j = 0 to p-1 {

If(i == 0) Rj=0(Rj는 w+1 비트의 크기)If (i == 0) R j = 0 (R j is the size of w + 1 bits)

Else Rj=Tj(Tj는 w 비트의 크기)Else R j = T j (T j is the size of w bits)

Step 4 : for b = 0 to w-1 { (단 b는 비트의 순서)Step 4: for b = 0 to w-1 {(where b is bit order)

Rj=Rj+Ajb ×Bi R j = R j + A jb × B i

if(j == 0) mb=Rj0(m은 w 비트의 크기)if (j == 0) m b = R j0 (m is the size of w bits)

else mb=mb else m b = m b

Rj=Rj+mNj R j = R j + m b × N j

Shift_datab=Rj0(shift_data는 w 비트의 크기)Shift_data b = R j0 (shift_data is the size of w bits)

Rj=Rj/2R j = R j / 2

end for b        end for b

Step 5 : (Carry_pre, Tj)=Rj+Carry_preStep 5: (Carry_pre, T j ) = R j + Carry_pre

(Carry_next, Tj-1)=Tj-1+Shift_data+Carry_next(Carry_next, T j -1) = T j -1 + Shift_data + Carry_next

} end for j        } end for j

} end for i  } end for i

Step 6 : If(T>N) T = T-N (단, T는 최종 carry를 포함한 n+1 비트의 크기)Step 6: If (T> N) T = T-N (where T is the size of n + 1 bits including the last carry)

Step 7 : return (T)Step 7: return (T)

수학식 3에서 임의의 비트 수 w를 결정할 때, 전체 비트 n 보다 2비트 이상 큰 비트 수 n'(n' ≥ n+2)를 전체 비트 수로 하여 n' = w × p의 형태로 구현될 수 있도록 한다. 이때, p는 임의의 정수이며 n보다 큰 비트의 값은 0으로 한다. When determining the arbitrary number of bits w in the equation (3), it can be implemented in the form of n '= w × p with the number of bits n' (n '≥ n + 2) larger than the total bit n as the total number of bits Make sure At this time, p is an arbitrary integer and the value of the bit larger than n is 0.

이는, 모듈러 연산의 결과 값이 항상 2N 보다 작으므로 그 결과 값이 주어진 비트 크기 내에 모두 표현될 수 있도록 한다.This allows the resulting values to be represented all within a given bit size since the result of the modular operation is always less than 2N.

그리고, 본 발명의 실시 예에 따른 모듈러 곱셈 장치가 모듈러 지수승만을 위한 장치임을 고려한다면, 이렇게 2비트 이상 큰 비트 수로 계산을 수행하면 모듈러 곱셈 연산의 결과가 N보다 클 경우에 매번 결과 값에서 N을 빼는 비교 과정을 수행하지 않아도 최종 모듈러 지수승의 결과 값은 항상 N 보다 작은 값으로 귀결된다. And, considering that the modular multiplier according to an embodiment of the present invention is a device for modular exponential power only, if the calculation is performed with a bit number larger than 2 bits, N in each result value when the result of the modular multiplication operation is greater than N The result of the final modular exponential power always results in a value less than N, even if the comparison process without subtracting is performed.

따라서, 수학식 3의 Step 6은 하드웨어로 구현할 때 생략 가능하다. 본 발명의 실시 예에서 고려하는 시스템의 경우, 수학식 3을 기본으로 하여 임의의 워드 단위로 설계되는 모듈러 곱셈 장치를 적용하게 된다. Therefore, Step 6 of Equation 3 may be omitted when implemented in hardware. In the case of the system considered in the embodiment of the present invention, a modular multiplication apparatus designed in units of arbitrary words based on Equation 3 is applied.

그러면, 본 발명이 적용되는 시스템에 대해 먼저 알아본다.Then, the system to which the present invention is applied will be described first.

도 1은 본 발명이 적용되는 시스템의 구성을 도시한 도면이다.1 is a diagram showing the configuration of a system to which the present invention is applied.

도 1에 도시되어 있듯이, 본 발명이 적용되는 시스템(100)은 중앙 제어 장치(CPU, 110) 및 메모리(RAM, 120)를 포함하며, 본 발명의 실시 예에 따른 모듈러 곱셈 장치(Modular Multiplier, 200)를 더 포함한다.As shown in FIG. 1, the system 100 to which the present invention is applied includes a central control unit (CPU) 110 and a memory (RAM) 120, and according to an embodiment of the present invention, a modular multiplier, 200).

구체적으로, 중앙 제어 장치(110)는 모듈러 곱셈 과정을 수행하기 위해, 메모리(120)로부터 필요한 데이터를 가져온 후, 가져온 데이터를 모듈러 곱셈 장치(200)로 전송한다.In detail, the central control apparatus 110 obtains necessary data from the memory 120 and transmits the obtained data to the modular multiplication apparatus 200 in order to perform the modular multiplication process.

모듈러 곱셈 장치(200)는 전송 받은 데이터를 토대로 워드-베이스 모듈러 곱셈을 연속적으로 수행한 후, 그 수행 결과를 중앙 제어 장치(110)로 다시 알려 준다. 그러면, 중앙 제어 장치(110)는 수신된 결과를 메모리(120)로 이동 저장시킨다. The modular multiplication apparatus 200 continuously performs word-base modular multiplication based on the received data, and then informs the central control apparatus 110 of the result. Then, the central control unit 110 transfers and stores the received result to the memory 120.

이처럼, 본 발명의 실시 예에 따른 모듈러 곱셈 장치(200)는 초기의 데이터 입력 및 결과 값 전달에 대해서만 중앙 제어 장치(110)와의 입출력 동작을 수행한다. 그 외, 워드-베이스 모듈러 곱셈 과정을 연속적으로 수행하는 동안에는 매 워드 단위 모듈러 곱셈 후 발생하는 중간 결과 값의 출력 및 새로운 워드 단위의 데이터 입력을 위한 중앙 제어 장치(110)와의 입출력 동작을 전혀 수행하지 않는다. 이는 곧, 입출력 동작으로 인한 시간 지연을 제거하거나 줄일 수 있다. As such, the modular multiplication apparatus 200 according to an embodiment of the present invention performs input / output operations with the central control apparatus 110 only for initial data input and result value transfer. In addition, while continuously performing the word-base modular multiplication process, the input / output operation with the central control unit 110 for outputting the intermediate result value generated after every word-unit modular multiplication and inputting a new word unit is not performed at all. Do not. This may eliminate or reduce the time delay caused by the input / output operation.

그러면, 도 1에 도시된 모듈러 곱셈 장치(200)에 대해 알아본다.Next, the modular multiplication apparatus 200 illustrated in FIG. 1 will be described.

도 2는 본 발명의 실시 예에 따른 모듈러 곱셈 장치의 구조를 도시한 도면이다.2 is a diagram showing the structure of a modular multiplication apparatus according to an embodiment of the present invention.

도 2에 도시되어 있듯이, 본 발명의 실시 예에 따른 모듈러 곱셈 장치(200)는 모듈러 인터페이스부(210), 모듈러 곱셈부(220) 및 메모리(230, mmRAM)를 포함한다. As illustrated in FIG. 2, the modular multiplication apparatus 200 according to an exemplary embodiment of the present invention includes a modular interface 210, a modular multiplier 220, and a memory 230 (mmRAM).

그리고, 모듈러 인터페이스부(210)는 시스템 입출력 제어부(211), 모듈러 입출력 제어부(212) 및 메모리 입출력 제어부(213)를 포함한다. 모듈러 곱셈부(220)는 입력 레지스터(221, 222, 223, 224), 모듈러 제어부(225), 모듈러 하드웨어 코어부(226), 상태 레지스터(227) 및 출력 레지스터(228, 229)를 포함한다. The modular interface 210 includes a system input / output control unit 211, a modular input / output control unit 212, and a memory input / output control unit 213. The modular multiplier 220 includes an input register 221, 222, 223, 224, a modular controller 225, a modular hardware core 226, a status register 227, and an output register 228, 229.

구체적으로, 모듈러 인터페이스부(210)는 중앙 제어 장치(110), 메모리(230) 및 모듈러 곱셈부(220)간의 인터페이스를 담당한다. 그리고, 중앙 제어 장치(110)로 하여금 본 발명의 실시 예에 따른 모듈러 곱셈 장치(200)가 메모리(230) 크기 만큼의 메모리 맵을 가지는 정상적인 주변 장치로 동작하고 있음을 인식하도록 한다. Specifically, the modular interface 210 is responsible for the interface between the central control unit 110, the memory 230 and the modular multiplier 220. In addition, the central control apparatus 110 recognizes that the modular multiplication apparatus 200 according to the embodiment of the present invention operates as a normal peripheral device having a memory map as large as the memory 230.

또한, 모듈러 인터페이스부(210)는 모듈러 곱셈부(220)로 하여금 연속적인 데이터 입출력이 가능하도록 하여, 모듈러 인터페이스부(210)와 모듈러 곱셈부(220)간의 데이터 입출력으로 인한 시간 지연 없이 연속적인 워드 베이스(word-base) 모듈러 곱셈 연산이 가능하도록 한다. In addition, the modular interface 210 enables the modular multiplier 220 to continuously input and output data, thereby allowing continuous words without a time delay due to data input and output between the modular interface 210 and the modular multiplier 220. Enables word-base modular multiplication.

먼저, 모듈러 인터페이스부(210)의 시스템 입출력 제어부(211)는 시스템(이하 '중앙 제어 장치'라 함)과 모듈러 인터페이스부(210)간의 입출력을 담당하며, 중앙 제어 장치(110) 및 모듈러 인터페이스부(210)간에 상호 입출력되는 각종 신호들을 처리한다. First, the system input / output control unit 211 of the modular interface unit 210 is responsible for input and output between the system (hereinafter referred to as the 'central control unit') and the modular interface unit 210, the central control unit 110 and the modular interface unit Process various signals input and output between the 210 and 210.

즉, 시스템 입출력 제어부(211)는 중앙 제어 장치(110)로부터 입력되는 제어(control) 및 주소(address) 신호의 동기를 맞추며, 동기된 신호를 통해 메모리(230)에 접근하는 신호(A_bus, C_bus)를 생성한다. That is, the system input / output control unit 211 synchronizes the control and address signals input from the central control unit 110, and the signals A_bus and C_bus approaching the memory 230 through the synchronized signals. )

참고로, A_xxx 및 C_xxx 등으로 표기되는 신호의 A 및 C는 각각 주소(address) 및 제어 신호(control)를 의미한다.For reference, A and C of signals denoted by A_xxx, C_xxx, etc. mean an address and a control signal, respectively.

그리고, 시스템 입출력 제어부(211)는 중앙 제어 장치(110)로부터 입력되는 데이터(Data)를 메모리 입출력 제어부(213)로 전달한다(Di_bus). In addition, the system input / output controller 211 transfers the data Data input from the central controller 110 to the memory input / output controller 213 (Di_bus).

또한, 시스템 입출력 제어부(211)는 모듈러 입출력 제어부(212)로부터 입력된 상태(Status) 값 및, 메모리 입출력 제어부(213)로부터 출력되는, 시스템의 요청으로 메모리(230) 내의 원하는 주소의 값을 읽어 들인 값(Do_bus)을 중앙 제어 장치(110)로 출력한다. 그리고, 이를 알리는 제어 신호(Co_bus)를 중앙 제어 장치(110)로 출력한다. In addition, the system input / output control unit 211 reads a status value input from the modular input / output control unit 212 and a desired address value in the memory 230 at the request of the system output from the memory input / output control unit 213. The input value Do_bus is output to the central control unit 110. Then, the control signal Co_bus informing of this is output to the central control device 110.

참고로, Di_xxx 및 Do_xxx로 표기되는 값의 Di 및 Do는 각각 입력 데이터 및 출력 데이터를 의미한다. 그리고, Co_xxx로 표기되는 값의 Co는 출력 제어 신호를 의미한다.For reference, Di and Do of values denoted by Di_xxx and Do_xxx mean input data and output data, respectively. In addition, Co of a value denoted by Co_xxx means an output control signal.

그리고, 시스템 입출력 제어부(211)는 모듈러 곱셈 동작 과정에서는 초기 값 을 시스템의 메모리(120)로부터 읽어 들여 모듈러 곱셈 장치(200)의 메모리(230)에 기록한다. 모듈러 곱셈이 완료되면, 메모리(230)에 저장된 최종 출력 값을 읽어 들여 시스템의 메모리(120)로 전송한다. In addition, the system input / output controller 211 reads an initial value from the memory 120 of the system and records the initial value in the memory 230 of the modular multiplication apparatus 200 in the process of modular multiplication. When the modular multiplication is completed, the final output value stored in the memory 230 is read and transmitted to the memory 120 of the system.

다음, 모듈러 입출력 제어부(212)는 모듈러 곱셈부(220)의 동작 흐름에 따라, 적절한 시점에 메모리(330)에 정확히 접근하는 기능을 수행한다. Next, the modular input / output controller 212 performs a function of accurately accessing the memory 330 at an appropriate point in time according to the operation flow of the modular multiplier 220.

즉, 모듈러 입출력 제어부(212)는 모듈러 곱셈부(220)로부터 출력되는 상태(Status) 값을 토대로 모듈러 곱셈부(220)와의 동기를 맞추며, 이 동기 신호를 통해 메모리(230)에 접근하기 위한 신호(A_mm, C_mm)를 생성한다. That is, the modular input / output controller 212 synchronizes with the modular multiplier 220 based on a status value output from the modular multiplier 220, and a signal for accessing the memory 230 through the synchronization signal. Create (A_mm, C_mm).

그리고, 모듈러 입출력 제어부(212)는 모듈러 곱셈부(220)의 두 출력 값(pre_sum과 post_sum)을 동기 신호에 따라 한 신호(Di_mm)로 선택하며, 선택된 신호를 메모리 입출력 제어부(213)로 전송한다.The modular input / output controller 212 selects two output values (pre_sum and post_sum) of the modular multiplier 220 as one signal Di_mm according to a synchronization signal, and transmits the selected signals to the memory input / output controller 213. .

또한, 메모리 입출력 제어부(213)로부터 출력되는 값인, 모듈러 곱셈부(220)의 요청으로 메모리(230) 내의 원하는 주소에 저장되어 있는 값(Do_mm)을 모듈러 곱셈부(220)의 입력 데이터(mm_input_data)로 출력한다. In addition, the input data (mm_input_data) of the modular multiplier 220 is converted into a value Do_mm stored at a desired address in the memory 230 at the request of the modular multiplier 220, which is a value output from the memory input / output controller 213. Will output

즉, 모듈러 입출력 제어부(212)는 모듈러 곱셈 동작 과정에서는 워드 단위 모듈러 곱셈을 수행할 때마다, 메모리(230)로부터 입력 값을 읽어 들이고, 출력 값을 메모리(230)에 기록한다. That is, in the modular multiplication operation, the modular input / output controller 212 reads an input value from the memory 230 and writes an output value in the memory 230 each time the modular word multiplication is performed.

다음, 메모리 입출력 제어부(213)는 시스템 입출력 제어부(211)의 메모리(230) 접근 요청 및, 모듈러 입출력 제어부(212)의 메모리(230) 접근 요청 중 어느 하나를 선택하는 기능을 수행한다.Next, the memory input / output control unit 213 performs a function of selecting one of the memory 230 access request of the system input / output control unit 211 and the memory 230 access request of the modular input / output control unit 212.

먼저, 메모리 입출력 제어부(213)는 중앙 제어 장치(110)로부터 입력되는 특정 값을 통해 선택을 위한 제어 신호를 생성하며, 모듈러 곱셈부(220)를 구동하는 신호(mm_input_ctrl)를 생성한다. 그리고, 생성된 제어 신호를 토대로, 시스템 입출력 제어부(211) 및 모듈러 입출력 제어부(212)로부터 수신되는 메모리(230)와 관련된 두 종류의 입력 신호 중 어느 한 신호를 선택하여 메모리(230)로 전송한다. First, the memory input / output controller 213 generates a control signal for selection through a specific value input from the central control apparatus 110, and generates a signal mm_input_ctrl driving the modular multiplier 220. Based on the generated control signal, one of two types of input signals related to the memory 230 received from the system input / output controller 211 and the modular input / output controller 212 is selected and transmitted to the memory 230. .

또한, 메모리 입출력 제어부(213)는 제어 신호를 토대로, 메모리(230)로부터 출력되는 데이터를 중앙 제어 장치(110) 및 모듈러 곱셈부(220) 중 어느 한 쪽으로 전송한다. In addition, the memory input / output controller 213 transmits data output from the memory 230 to either the central controller 110 or the modular multiplier 220 based on the control signal.

즉, 메모리 입출력 제어부(213)는 모듈러 곱셈 동작 과정에서 메모리(230)로의 접근을 최종적으로 담당하여 메모리(230)의 데이터 입출력을 책임지며, 모듈러 곱셈부(220)의 구동을 담당한다.That is, the memory input / output controller 213 is responsible for access to the memory 230 in the process of modular multiplication, and is responsible for data input / output of the memory 230, and is responsible for driving the modular multiplication unit 220.

다음, 모듈러 곱셈부(220)는 앞서 언급한 수학식 3에 따른 연산을 수행한다. 먼저, 모듈러 곱셈부(200)는 모듈러 인터페이스부(210)로부터 모듈러 곱셈부(220)의 구동 및 연산 횟수에 관한 정보가 포함된 신호인 제어 신호(mm_input_ctrl)를 수신한다. Next, the modular multiplier 220 performs an operation according to Equation 3 mentioned above. First, the modular multiplier 200 receives a control signal mm_input_ctrl, which is a signal including information about the number of driving and operations of the modular multiplier 220 from the modular interface 210.

그리고, 수신된 제어 신호가 모듈러 제어부(225)에 입력되면, 모듈러 제어부(225)는 입력된 제어 신호를 토대로 모듈러 곱셈부(220) 전체의 동작을 제어한다. When the received control signal is input to the modular controller 225, the modular controller 225 controls the operation of the entire modular multiplier 220 based on the input control signal.

또한, 모듈러 제어부(225)는 모듈러 인터페이스부(210)로부터 워드-베이스 연산을 수행하기 위한 데이터(mm_input_data)가 입력되면, 자체 발생한 신 호(input_reg_ctrl)에 따라 입력된 데이터를 해당되는 입력 레지스터(221, 222, 223, 224)에 저장한다. In addition, when the data (mm_input_data) for performing a word-base operation is input from the modular interface unit 210, the modular controller 225 receives the input data according to the generated signal (input_reg_ctrl). , 222, 223, 224).

참고로, 4개의 입력 레지스터(221, 222, 223, 224)는 2단 레지스터로 구성되어, 다음 번의 워드 연산시 입력 데이터가 미리 저장되도록 한다. 이는, 모듈러 인터페이스부(210)와 모듈러 곱셈부(220)간의 입출력 지연을 최소화한다. For reference, the four input registers 221, 222, 223, and 224 are configured as two stage registers, so that the input data is stored in advance in the next word operation. This minimizes the input / output delay between the modular interface 210 and the modular multiplier 220.

모듈러 하드웨어 코어부(226)는 입력된 데이터를 토대로 워드-베이스 모듈러 곱셈 연산을 수행한다. 이때, 앞서 언급한 수학식 3의 step5의 Tj 및 Tj -1에 해당하는 값(pre_sum, post_sum)이 각각 발생하게 되는데, 모듈러 하드웨어 코어부(226)는 각 값을 출력 레지스터(pre_sum output register, post_sum output register, 228, 229)에 저장한다. The modular hardware core unit 226 performs a word-based modular multiplication operation based on the input data. In this case, values (pre_sum and post_sum) corresponding to T j and T j −1 of step 5 of Equation 3 described above are generated, respectively. The modular hardware core unit 226 outputs each value to an output register (pre_sum output register). , post_sum output register, 228, 229).

그리고, 모듈러 인터페이스부(210)를 거쳐 메모리(230)의 해당 영역에 저장한다. Then, the data is stored in the corresponding area of the memory 230 via the modular interface 210.

또한, 모듈러 하드웨어 코어부(226)는 연산 과정의 모든 상태 값들을 상태 레지스터(Status register, 227)에 저장하며, 저장된 값은 모듈러 인터페이스부(210)로 전송하여 새로운 입력 신호(mm_input_ctrl)를 생성하는데 사용되도록 한다. 참고로, 상기한 과정을 반복 수행하여 워드 단위의 모듈러 곱셈을 통해 전체 모듈러 곱셈 과정을 완료하도록 한다.In addition, the modular hardware core unit 226 stores all the status values of the calculation process in a status register 227, and transmits the stored values to the modular interface unit 210 to generate a new input signal mm_input_ctrl. To be used. For reference, the above process is repeated to complete the entire modular multiplication process by modular multiplication in word units.

이처럼, 본 발명의 실시 예에 따른 모듈러 곱셈 장치는 그 내부에 메모리를 별도로 내장한다. 그리고, 연속적인 워드-베이스 모듈러 곱셈 과정을 수행하는 동 안, 내장된 메모리와 모듈러 인터페이스부간의 데이터 입출력을 수행한다. 즉, 메모리를 직접적으로 제어함으로써, 데이터 입출력에 따른 시간 지연을 제거하여 고속의 데이터 입출력 처리가 가능하도록 한다.As such, the modular multiplication apparatus according to the embodiment of the present invention separately embeds a memory therein. And, while performing a continuous word-base modular multiplication process, it performs data input and output between the built-in memory and the modular interface. In other words, by directly controlling the memory, a high-speed data input / output processing is possible by eliminating the time delay caused by the data input / output.

또한, 본 발명의 실시 예는 내장된 메모리 내부의 세그먼트를 RSA 연산을 위한 모듈러 지수승 연산에 최적화하여 할당함으로써, 모듈러 지수승 연산을 세그먼트에 저장된 값의 변경 또는 갱신을 통해 순차적으로 진행할 수 있다.In addition, according to an embodiment of the present invention, the modular exponential operation may be sequentially performed by changing or updating a value stored in the segment by optimizing and assigning a segment in the embedded memory to a modular exponential operation for the RSA operation.

또한, 본 발명의 실시 예에 따른 모듈러 곱셈 장치를 구동하지 않는 경우, 내장된 메모리를 시스템이 사용할 수 있도록 함으로써, 시스템이 활용할 수 있는 메모리로서의 가치도 가지게 한다.In addition, when not driving the modular multiplication apparatus according to an embodiment of the present invention, by allowing the system to use the built-in memory, it also has a value as a memory that can be utilized by the system.

그러면, 위에 기술된 구조로 이루어지는 모듈러 곱셈 장치를 토대로, 본 발명의 실시 예에 따른 모듈러 지수승 과정에 대해 설명한다.Next, a modular exponentiation process according to an embodiment of the present invention will be described based on the modular multiplication apparatus having the above-described structure.

도 3은 도 2에 도시된 모듈러 곱셈 장치의 모듈러 지수승을 수행하는 과정을 순차적으로 도시한 흐름도이다.3 is a flowchart sequentially illustrating a process of performing a modular exponential power of the modular multiplication apparatus illustrated in FIG. 2.

참고로, 도 3은 RSA 연산을 수행하는 모듈러 지수승 연산 과정을, 메모리(230) 내의 세그먼트(segment) 값을 중심으로 도시한 흐름도이다.For reference, FIG. 3 is a flowchart illustrating a modular exponential calculation process for performing an RSA operation, centering on a segment value in the memory 230.

도 3에 도시되어 있듯이, 모듈라 지수승 연산이 시작되면, 모듈러 곱셈부(220)는 먼저 기본적인 입력 데이터를 지정된 메모리(230) 내 세그먼트에 저장한다(S301). 여기서, 세그먼트로 이루어진 메모리(230) 및 수학식 4에 대해 알아본다.As shown in FIG. 3, when the modular exponential operation is started, the modular multiplier 220 first stores basic input data in a segment in the designated memory 230 (S301). Here, the memory 230 composed of segments and Equation 4 will be described.

도 4는 도 2에 도시된 메모리의 구조를 도시한 도면이다.FIG. 4 is a diagram illustrating the structure of a memory illustrated in FIG. 2.

도 4에 도시되어 있듯이, 본 발명의 실시 예에 따른 메모리(230)는 기본적으로 7개의 세그먼트(231, 232, 233, 234, 235, 236, 237)를 가진다. As shown in FIG. 4, the memory 230 according to an embodiment of the present invention basically has seven segments 231, 232, 233, 234, 235, 236, and 237.

참고로, 본 발명의 실시 예는 가장 기본적인 모듈러 지수승 방법인 L-R 바이너리(Binary) 방법을 적용한다. For reference, an embodiment of the present invention applies the L-R binary method, which is the most basic modular exponential method.

구체적으로, 모듈러 지수승 방법인 L-R 바이너리 방법은 아래의 수학식 4와 같다.Specifically, the L-R binary method, which is a modular exponential method, is represented by Equation 4 below.

Inputs : N(modulus), e(exponent), M(message), R2modN(mapping factor)Inputs: N (modulus), e (exponent), M (message), R2modN (mapping factor)

Step 1 : MRmodN = MM(M, R2modN), C = 1RmodN = MM(1, R2modN)Step 1: MRmodN = MM (M, R 2 modN), C = 1RmodN = MM (1, R 2 modN)

Step 2 : for i = n-1 to 0 do {Step 2: for i = n-1 to 0 do {

C = MM(C, C)            C = MM (C, C)

If (ei=1)thenIf (e i = 1) then

C = MM(C, MRmodN)              C = MM (C, MRmodN)

else C = C }            else C = C}

Step 3 : C = MM(C, 1)Step 3: C = MM (C, 1)

Step 4 : return (C)Step 4: return (C)

Output : C = MemodN, 0≤C<NOutput: C = M e modN, 0≤C <N

수학식 4의 각 단계들을 진행하는 과정에서 발생하는 모든 입출력 값 및 중간 값은 메모리(230)에 저장되며, 메모리(230)는 해당 값들을 저장하기 위해 앞서 언급한 바와 같이 모두 7개의 세그먼트로 구성된다. All input and output values and intermediate values generated in the course of the steps of Equation 4 are stored in the memory 230, and the memory 230 is composed of seven segments as mentioned above for storing the corresponding values. do.

이후, 모듈러 곱셈부(220)는 추후 언급할 수학식 4의 step 1에서 이루어지는 두 번의 매핑 과정을 수행하는데, 먼저 소정의 값(MRmodN)을 계산하여 메모리의 세그먼트에 저장한다(S302). Thereafter, the modular multiplier 220 performs two mapping processes performed in step 1 of Equation 4, which will be described later. First, a predetermined value MRmodN is calculated and stored in a segment of the memory (S302).

이후, 모듈러 곱셈부(220)는 소정의 값(1RmodN)을 계산한 후, 계산된 값을 세그먼트 4(235)에 저장한다(S303). Thereafter, the modular multiplier 220 calculates a predetermined value 1RmodN and stores the calculated value in the segment 4 235 (S303).

그리고, 이후의 동작을 수행하기 위해 모듈러 곱셈부(220)는 필요한 플래그(Flag) 값을 0으로 초기화하고, 지수 값 키(Key)의 비트 크기를 카운트(Count)에 지정한다(S304). In order to perform the subsequent operation, the modular multiplier 220 initializes a required flag value to 0 and assigns a bit size of an exponent value key to a count (S304).

이어, 모듈러 곱셈부(220)는 수학식 4의 step 2에서 이루어지는 제곱 연산을 수행(S305)한 후, 현재 카운트에 해당하는 키 비트 값이 1인지를 확인한다(S306). 확인 결과 키 비트 값이 1이면, 소정 값(MRmodN)과 현재 값을 모듈러 곱셈한다(S307).Subsequently, the modular multiplier 220 performs a square operation performed in step 2 of Equation 4 (S305), and then checks whether the key bit value corresponding to the current count is 1 (S306). If the key bit value is 1 as a result of the check, the predetermined value MRmodN and the current value are modularly multiplied (S307).

반면, 현재 카운트에 해당하는 키 비트 값이 1이 아니면, 모듈러 곱셈부(220)는 플래그 값을 토글(Toggle)시킨다(S308).On the other hand, if the key bit value corresponding to the current count is not 1, the modular multiplier 220 toggles the flag value (S308).

이후, 모듈러 곱셈부(220)는 카운트 값이 0인지를 확인(S309)한 후, 확인 결과 카운터 값이 0이 아니면 카운터 값을 1 감소(S310) 시키고, 제곱 연산을 수행(S305)하는 과정부터 다시 시작한다.Thereafter, the modular multiplier 220 checks whether the count value is 0 (S309), and if the counter value is not 0, decreases the counter value by 1 (S310) and performs a square operation (S305). Start over.

반면, 카운트 값이 0이면, 모듈러 곱셈부(220)는 모든 지수승 연산이 완료되었으므로, 수학식 4의 step 3에서 이루어지는 재 매핑(re-mapping)을 수행(S311)한 후, 모든 과정을 종료한다. On the other hand, when the count value is 0, the modular multiplier 220 has completed all exponential power operations, and thus performs all reprocessing operations (S311) after completing remapping in step 3 of Equation 4 (S311). do.

참고로, 수학식 4의 step 2 과정을 수행하는데 있어 키 비트가 0일 때와 1일 때의 동작 과정이 각기 달라진다. 따라서, 상기한 연산 과정에 있어 플래그 값은, 직전 수행된 결과 값이 세그먼트 4(235)와 세그먼트 5(236) 중 어느 세그먼트에 저장되어 있는지를 알려준다.For reference, in performing step 2 of Equation 4, an operation process when the key bit is 0 and when the key bit is 1 is different. Therefore, in the above operation, the flag value indicates which segment of segment 4 235 and segment 5 236 is the result of the previous execution.

이처럼, 본 발명의 실시 예에 따른 모듈러 곱셈 장치는 그 내부에 메모리를 내장한다. 그리고, 내장된 메모리와 모듈러 인터페이스부간의 데이터 입출력을 통해, 워드-베이스 모듈러 곱셈 과정을 연속적으로 수행한다. 즉, 메모리를 직접적으로 제어함으로써, 데이터 입출력에 따른 시간 지연을 제거한다.As such, the modular multiplication apparatus according to the embodiment of the present invention embeds a memory therein. Then, word-based modular multiplication is continuously performed through data input / output between the built-in memory and the modular interface. That is, by directly controlling the memory, time delay caused by data input / output is eliminated.

이상에서 설명한 본 발명의 실시 예는 장치 및 방법을 통해서만 구현이 되는 것은 아니며, 본 발명의 실시 예의 구성에 대응하는 기능을 실현하는 프로그램 또는 그 프로그램이 기록된 기록 매체를 통해 구현될 수도 있으며, 이러한 구현은 앞서 설명한 실시 예의 기재로부터 본 발명이 속하는 기술 분야의 전문가라면 쉽게 구현할 수 있는 것이다. The embodiments of the present invention described above are not implemented only through the apparatus and the method, but may be implemented through a program for realizing a function corresponding to the configuration of the embodiment of the present invention or a recording medium on which the program is recorded. Implementation can be easily implemented by those skilled in the art from the description of the above-described embodiments.

이상에서 본 발명의 실시 예에 대하여 상세하게 설명하였지만 본 발명의 권리 범위는 이에 한정되는 것은 아니고 다음의 청구 범위에서 정의하고 있는 본 발명의 기본 개념을 이용한 당업자의 여러 변형 및 개량 형태 또한 본 발명의 권리범위에 속하는 것이다.Although the embodiments of the present invention have been described in detail above, the scope of the present invention is not limited thereto, and various modifications and improvements of those skilled in the art using the basic concepts of the present invention defined in the following claims are also provided. It belongs to the scope of rights.

도 1은 본 발명이 적용되는 시스템의 구성을 도시한 도면이다.1 is a diagram showing the configuration of a system to which the present invention is applied.

도 2는 본 발명의 실시 예에 따른 모듈러 곱셈 장치의 구조를 도시한 도면이다.2 is a diagram showing the structure of a modular multiplication apparatus according to an embodiment of the present invention.

도 3은 도 2에 도시된 모듈러 곱셈 장치의 모듈러 지수승을 수행하는 과정을 순차적으로 도시한 흐름도이다.3 is a flowchart sequentially illustrating a process of performing a modular exponential power of the modular multiplication apparatus illustrated in FIG. 2.

도 4는 도 2에 도시된 메모리의 구조를 도시한 도면이다.FIG. 4 is a diagram illustrating the structure of a memory illustrated in FIG. 2.

Claims (9)

모듈러 곱셈 연산을 반복적으로 수행하는 모듈러 곱셈부;A modular multiplier that repeatedly performs a modular multiplication operation; 상기 모듈러 곱셈부가 수행하는 연산 과정 중 발생하는 적어도 하나의 결과 값이 저장되는 메모리; 및A memory configured to store at least one result value generated during an operation performed by the modular multiplier; And 상기 메모리에 저장되는 결과 값 중 어느 하나를 이용하여 상기 모듈러 곱셈부와의 동기를 맞추고, 맞춰진 동기에 따라 상기 모듈러 곱셈부로부터 출력되는 값을 상기 메모리에 저장하며, 상기 모듈러 곱셈부가 요청하는 적어도 하나의 값을 상기 메모리에서 읽어 들여 상기 모듈러 곱셈부로 제공하는 모듈러 인터페이스부At least one of synchronizing with the modular multiplier using any one of the result values stored in the memory, storing a value output from the modular multiplier in the memory according to the synchronized synchronization, and requesting the modular multiplier Modular interface unit for reading the value of from the memory to the modular multiplier 를 포함하는 모듈러 곱셈 장치. Modular multiplication device comprising a. 제1 항에 있어서,According to claim 1, 상기 모듈러 인터페이스부는,The modular interface unit, 외부로부터 입력되는 신호들의 동기를 맞춘 후, 상기 맞춰진 신호를 이용하여 상기 메모리에 접근하기 위한 신호를 생성하며, 상기 생성된 신호를 통해 외부로부터 요청 받은 상기 메모리 내의 주소에 저장된 값을 읽어 들인 후, 상기 읽어 들인 값 및 상기 읽어 들인 값을 알리는 제어 신호를 상기 외부로 출력하는 시스템 입출력 제어부 After synchronizing the signals input from the outside, and generates a signal for accessing the memory using the matched signal, and after reading the value stored in the address in the memory requested from the outside through the generated signal, A system input / output control unit configured to output a control signal informing of the read value and the read value to the outside 를 포함하는 모듈러 곱셈 장치.Modular multiplication device comprising a. 제2 항에 있어서,The method of claim 2, 상기 모듈러 인터페이스부는,The modular interface unit, 상기 모듈러 곱셈부로부터 출력되는 상태 값을 이용하여 상기 모듈러 곱셈부와의 동기를 맞춘 후, 상기 맞춰진 동기에 따라 상기 모듈러 곱셈부로부터 출력되는 연산 결과 값을 상기 메모리에 저장하며, 상기 모듈러 곱셈부가 요청하는 메모리 내의 소정의 주소에 저장된 값을 읽어 들여 상기 모듈러 곱셈부로 제공하는 모듈러 입출력 제어부; 및After synchronizing with the modular multiplier by using the state value output from the modular multiplier, the operation result value output from the modular multiplier is stored in the memory according to the matched synchronization, and the modular multiplier requests A modular input / output controller for reading a value stored at a predetermined address in a memory and providing the value to the modular multiplier; And 외부로부터 입력된 데이터를 통해 제어 신호를 생성하며, 상기 생성된 제어 신호를 토대로 상기 메모리에 접근하려는 적어도 하나의 기능부 중 어느 하나를 선택한 후, 상기 선택된 기능부에게 메모리로의 접근을 허용하며, 상기 생성된 제어 신호를 이용하여 상기 모듈러 곱셈부를 구동하는 메모리 입출력 제어부Generate a control signal through data input from the outside, select one of the at least one functional unit to access the memory based on the generated control signal, and then allow the selected functional unit to access the memory; A memory input / output controller which drives the modular multiplier using the generated control signal 를 더 포함하는 모듈러 곱셈 장치.Modular multiplication device further comprising. 제1 항 내지 제3 항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 3, 상기 모듈러 곱셈부는,The modular multiplier, 상기 외부로부터 입력된 데이터를 상기 모듈러 인터페이스부로부터 전달 받아 저장하는 소정 개수의 입력 레지스터;A predetermined number of input registers for receiving and storing data input from the outside from the modular interface unit; 상기 저장된 데이터를 이용하여 소정 단위의 모듈러 곱셈 연산을 반복적으로 수행하는 모듈러 하드웨어 코어부;A modular hardware core unit repeatedly performing a modular multiplication operation of a predetermined unit by using the stored data; 상기 모듈러 곱셈 과정 중 발생하는 적어도 하나의 출력 값을 저장하는 소정 개수의 출력 레지스터; 및A predetermined number of output registers for storing at least one output value generated during the modular multiplication process; And 상기 모듈러 곱셈 과정 중 발생하는 적어도 하나의 상태 값을 저장하는 상태 레지스터A status register for storing at least one status value generated during the modular multiplication process 를 포함하는 모듈러 곱셈 장치.Modular multiplication device comprising a. 제4 항에 있어서,The method of claim 4, wherein 상기 메모리는,The memory, 소정 개수의 세그먼트를 포함하며,Includes a certain number of segments, 상기 세그먼트는, 상기 모듈러 곱셈부로부터 출력되는 값을 저장하는 모듈러 곱셈 장치.And the segment stores a value output from the modular multiplier. 외부로부터 입력되는 신호들의 동기를 맞춘 후, 상기 맞춰진 신호를 통해 메모리에 접근하기 위한 신호를 생성하는 단계; Synchronizing signals input from the outside, and generating a signal for accessing a memory through the matched signal; 상기 생성된 신호를 이용하여 상기 외부로부터 요청 받은 상기 메모리 내의 주소에 저장된 값을 읽어 들인 후, 상기 읽어 들인 값 및 상기 읽어 들인 값을 알리는 제어 신호를 상기 외부로 출력하는 단계;Reading a value stored at an address in the memory requested from the outside using the generated signal, and then outputting a control signal notifying the read value and the read value to the outside; 소정의 값을 통해 모듈러 곱셈 연산을 수행하는 기능부와의 동기를 맞춘 후, 상기 맞춰진 동기에 따라, 상기 기능부의 출력 값 중 적어도 하나를 상기 메모리에 저장하는 단계;Synchronizing with a function unit that performs a modular multiplication operation through a predetermined value, and storing at least one of output values of the function unit in the memory according to the matched synchronization; 상기 기능부가 요청하는 상기 메모리의 주소에 저장된 값을 읽어 들여 상기 기능부로 제공하는 단계;Reading a value stored in an address of the memory requested by the function unit and providing the value to the function unit; 상기 외부로부터 입력되는 신호 중 어느 하나를 이용하여 제어 신호를 생성한 후, 상기 생성된 제어 신호를 이용하여 상기 메모리에 접근하려는 기능부 중 어느 하나의 기능부를 선택하는 단계; 및Generating a control signal using any one of the signals input from the outside, and then selecting any one of the functional units to access the memory using the generated control signals; And 상기 선택된 기능부의 신호를 상기 메모리로 전송하며, 상기 메모리로부터 출력되는 값을 상기 메모리에 접근하려는 기능부 중 어느 하나에 전송하는 단계Transmitting a signal of the selected functional unit to the memory, and transmitting a value output from the memory to any one of the functional units to access the memory 를 포함하는 모듈러 곱셈 방법.Modular multiplication method comprising a. 제6 항에 있어서,The method of claim 6, 상기 메모리를 소정 개수의 세그먼트로 구성하는 단계; 및Organizing the memory into a predetermined number of segments; And 상기 구성된 세그먼트에 상기 모듈러 지수승 연산 과정 및 입출력 과정 중 발생하는 결과 값에서 상기 메모리에 저장해야 하는 결과 값을 선택하여 저장하는 단계Selecting and storing a result value to be stored in the memory from the result value generated during the modular exponential operation and input / output process in the configured segment 를 더 포함하는 모듈러 곱셈 방법.Modular multiplication method further comprising. 제7 항에 있어서,The method of claim 7, wherein 기본적인 데이터를 지정된 세그먼트에 저장한 후, 소정의 값을 계산하여 해당 세그먼트에 각각 저장하는 단계;Storing basic data in a designated segment, and calculating a predetermined value and storing the basic data in the corresponding segment; 플래그 값을 초기화한 후, 지수 값 키의 비트 크기를 카운터에 지정한 후, 제곱 연산을 수행하는 단계;After initializing a flag value, assigning a bit size of an index value key to a counter, and then performing a square operation; 현재 카운트에 해당하는 키 비트 값을 확인한 후, 상기 확인된 값에 따라 상기 소정의 값과 현재 값을 모듈러 곱셈하는 단계;Checking a key bit value corresponding to a current count and then modularly multiplying the predetermined value and the current value according to the checked value; 상기 확인된 값에 따라 플래그 값을 토글시키는 단계;Toggling a flag value according to the identified value; 상기 카운트 값을 확인한 후, 상기 확인된 값에 따라 상기 카운트 값을 감소시키고 상기 제곱 연산을 다시 수행하는 단계; 및After checking the count value, decreasing the count value according to the checked value and performing the square operation again; And 상기 확인된 카운트 값에 따라, 최종 결과값을 계산하는 단계Calculating a final result according to the identified count value 를 더 포함하는 모듈러 곱셈 방법.Modular multiplication method further comprising. 제8 항에 있어서,The method of claim 8, 상기 확인된 키 비트 값에 따라, 이전 단계에서 수행된 결과 값이 어느 세그먼트에 저장되어 있는지를 알려주는 단계; 및Informing, according to the identified key bit value, in which segment the result value performed in the previous step is stored; And 상기 세그먼트 중 하나를 선택하여 상기 결과 값을 저장하는 단계Selecting one of the segments to store the result value 를 더 포함하는 모듈러 곱셈 방법.Modular multiplication method further comprising.
KR1020070127020A 2007-12-07 2007-12-07 Apparatus and method for modular multiplier KR100939356B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020070127020A KR100939356B1 (en) 2007-12-07 2007-12-07 Apparatus and method for modular multiplier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020070127020A KR100939356B1 (en) 2007-12-07 2007-12-07 Apparatus and method for modular multiplier

Publications (2)

Publication Number Publication Date
KR20090059921A KR20090059921A (en) 2009-06-11
KR100939356B1 true KR100939356B1 (en) 2010-01-29

Family

ID=40989945

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020070127020A KR100939356B1 (en) 2007-12-07 2007-12-07 Apparatus and method for modular multiplier

Country Status (1)

Country Link
KR (1) KR100939356B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130128695A (en) * 2012-05-17 2013-11-27 삼성전자주식회사 Modular arithmetic unit and secure system having the same

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101733871B1 (en) * 2015-08-10 2017-05-24 한국전력공사 Apparatus, method and program for mixed square operation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100481586B1 (en) * 2002-11-22 2005-04-08 한국전자통신연구원 Apparatus for modular multiplication

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100481586B1 (en) * 2002-11-22 2005-04-08 한국전자통신연구원 Apparatus for modular multiplication

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130128695A (en) * 2012-05-17 2013-11-27 삼성전자주식회사 Modular arithmetic unit and secure system having the same
US9098381B2 (en) 2012-05-17 2015-08-04 Samsung Electronics Co., Ltd. Modular arithmatic unit and secure system including the same

Also Published As

Publication number Publication date
KR20090059921A (en) 2009-06-11

Similar Documents

Publication Publication Date Title
EP0801345B1 (en) Circuit for modulo multiplication and exponentiation arithmetic
US6691143B2 (en) Accelerated montgomery multiplication using plural multipliers
US8903882B2 (en) Method and data processing unit for calculating at least one multiply-sum of two carry-less multiplications of two input operands, data processing program and computer program product
US6209017B1 (en) High speed digital signal processor
KR100875836B1 (en) Instruction instruction compression apparatus and method for parallel processing BLU computer
CN108108614B (en) Secure processor and method of operating the secure processor
KR100436814B1 (en) apparatus for RSA Crypto Processing of IC card
CN110096542A (en) Data verification processing method, device, system and the medium of decentralization
Pham‐Quoc et al. A high‐performance fpga‐based bwa‐mem dna sequence alignment
EP1191740A2 (en) Methods and apparatus for hardware normalization and denormalization
US10140090B2 (en) Computing and summing up multiple products in a single multiplier
KR100939356B1 (en) Apparatus and method for modular multiplier
Zhang et al. {FLASH}: Towards a high-performance hardware acceleration architecture for cross-silo federated learning
CN114371829A (en) Data processing method in polynomial multiplier, polynomial multiplier and processor
CN113467750A (en) Large integer bit width division circuit and method for SRT algorithm with radix of 4
KR101128505B1 (en) method and apparatus for modular multiplication
KR20080050226A (en) Modular multiplication device and method for designing modular multiplication device
KR100950117B1 (en) Method and apparatus for processing arbitrary key bit length encryption operations with similar efficiencies
KR20060011068A (en) Modular multiplier having structure capable of operating separately and cryptography system with the modular multiplier
CN100392584C (en) Carry save adder and its system
EP3758288A1 (en) Digital signature verification engine for reconfigurable circuit devices
CN114371828A (en) Polynomial multiplier and processor with same
Fischer et al. Scalable RSA processor in reconfigurable hardware-a SoC building block
KR20040045152A (en) Apparatus for modular multiplication
CN113467752B (en) Division operation device, data processing system and method for private calculation

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
FPAY Annual fee payment

Payment date: 20121206

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20130730

Year of fee payment: 18