KR100581662B1 - Common engine for plural hash functions having different algorithms - Google Patents
Common engine for plural hash functions having different algorithms Download PDFInfo
- Publication number
- KR100581662B1 KR100581662B1 KR1020050080532A KR20050080532A KR100581662B1 KR 100581662 B1 KR100581662 B1 KR 100581662B1 KR 1020050080532 A KR1020050080532 A KR 1020050080532A KR 20050080532 A KR20050080532 A KR 20050080532A KR 100581662 B1 KR100581662 B1 KR 100581662B1
- Authority
- KR
- South Korea
- Prior art keywords
- intermediate value
- function
- hash
- common
- calculating
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
본 발명은 함수 연산 엔진에 관한 것으로서, 더욱 상세하게는 알고리즘이 다른 복수의 해쉬 함수를 연산할 수 있는 하드웨어로 구현된 해쉬 함수 연산 엔진에 관한 것이다. 본 발명에 따른 함수 연산 엔진은 알고리즘이 다른 적어도 둘 이상의 해쉬 함수 연산에 필요한 중간값을 공유하거나, 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수를 연산하기 위하여 구비되는 연산회로에서 공통되는 회로를 공유할 수 있다. 따라서, 알고리즘의 구조가 유사한 복수의 해쉬 함수를 처리하기 위한 회로에서, 동일한 하드웨어 구성요소를 공유할 수 있도록 설계함으로써, 함수 처리에 필요한 하드웨어를 줄일 수 있다.The present invention relates to a function calculation engine, and more particularly, to a hash function calculation engine implemented in hardware capable of computing a plurality of hash functions different algorithms. The function calculation engine according to the present invention may share a common value in a calculation circuit in which algorithms are provided for computing at least two or more hash functions, which are different from each other, or algorithms for calculating at least two or more hash functions. have. Therefore, in a circuit for processing a plurality of hash functions with similar algorithm structures, the hardware required for the function processing can be reduced by designing to share the same hardware components.
해쉬 함수, 해쉬 엔진, SHA-1, HAS, 공통 엔진 Hash Function, Hash Engine, SHA-1, HAS, Common Engine
Description
본 명세서에 첨부되는 다음의 도면들은 본 발명의 바람직한 실시예를 예시하는 것이며, 후술하는 발명의 상세한 설명과 함께 본 발명의 기술사상을 더욱 이해쉬키는 역할을 하는 것이므로, 본 발명은 그러한 도면에 기재된 사항에만 한정되어 해석되어서는 아니된다.The following drawings, which are attached to this specification, illustrate the preferred embodiments of the present invention, and together with the detailed description of the invention that serves to further understand the spirit of the present invention, the present invention is described in such drawings. It should not be construed as limited to matters.
도 1은 종래기술에 따른 해쉬 함수 연산 엔진을 개략적으로 도시한 도면이다. 1 is a view schematically showing a hash function calculation engine according to the prior art.
도 2는 종래기술에 따른 복수의 해쉬 함수 처리부를 구비한 함수 연산 엔진의 구성도이다. 2 is a block diagram of a function calculation engine having a plurality of hash function processing units according to the prior art.
도 3은 종래기술에 따른 해쉬 함수 연산 엔진에서 복수의 중간값 처리부를 나타내는 도면이다.3 is a diagram illustrating a plurality of intermediate value processing units in the hash function calculation engine according to the related art.
도 4는 본 발명의 일 실시예에 따른 해쉬 함수 연산을 위한 공통엔진의 구성도이다.4 is a block diagram of a common engine for a hash function operation according to an embodiment of the present invention.
도 5는 본 발명의 다른 실시예에 따른 해쉬 함수 연산을 위한 공통엔진의 구성도이다.5 is a configuration diagram of a common engine for a hash function operation according to another embodiment of the present invention.
도 6은 도 4의 해쉬 함수 연산을 위한 공통엔진의 상세 구성도이다. FIG. 6 is a detailed configuration diagram of a common engine for computing the hash function of FIG. 4.
<도면의 주요 참조부호에 대한 설명><Description of main reference numerals in the drawings>
1, 7...입력 버퍼 2, 40, 60, 80...중간값 처리부1, 7
210...SHA-1 중간값 처리부 220...HAS 중간값 처리부210 ... SHA-1 intermediate
310...SHA-1 함수 처리부 320...HAS 함수 처리부310 ... SHA-1
3, 50, 70, 90...함수 연산부 81...저장 블록3, 50, 70, 90 ...
82...중간값 변수 연산부 83...SHA-1 선택 버퍼82 ...
84...SHA-1 중간값 연산회로 85...HAS 선택 버퍼84 ... SHA-1 intermediate
86...HAS 중간값 연산회로 91...선택회로86 ... HAS intermediate
92...함수값 저장 블록 93...함수 선택부92 ... Save
94...공통함수 연산부 95...차등함수 연산부94.
96...캐리 가산기 97...쉬프터96. Carry
98...출력가산기 99...출력 버퍼98 ...
본 발명은 해쉬 함수 연산 엔진에 관한 것으로서, 더욱 상세하게는 알고리즘이 다른 복수의 해쉬 함수를 연산할 수 있는 하드웨어로 구현된 해쉬 함수 연산 엔진에 관한 것이다.The present invention relates to a hash function calculation engine, and more particularly, to a hash function calculation engine implemented in hardware capable of computing a plurality of different hash functions.
해쉬라는 개념은 하나의 문자열을 원래의 것을 상징하는 더 짧은 길이의 값이나 키로 변환하는 것을 말한다. 짧은 해쉬값을 사용하여 항목을 찾으면 원래의 값을 이용하여 찾는 것보다 더 빠르기 때문에 데이터베이스 내의 항목들을 검색하는 데 주로 사용되었으며 이러한 해쉬기술을 함수의 형태로 암호화 기술에 적용한 것이 해쉬 알고리즘이다.The idea of a hash is to convert a string into a shorter value or key that symbolizes the original. Finding an item using a short hash value is faster than using an original value to find an item. It is mainly used to search items in the database. The hash algorithm is applied to encryption technology as a function.
이러한, 해쉬 알고리즘은 전자 서명에 많이 사용되며, 대표적인 해쉬 알고리즘으로는 MD(message-digest)4, MD5, SHA(Secure Hash Algorithm)-1, RMD(RACE Integrity Primitives Evaluation message-digest)160, HAS(Hash Algorithm)등이 있다. 여기서, 해쉬 알고리즘은 대부분 MD4에 기반하여 설계되었으므로 구조가 유사하다.Such a hash algorithm is widely used for digital signatures, and typical hash algorithms include message-digest (MD) 4, MD5, Secure Hash Algorithm (SHA) -1, RACE Integrity Primitives Evaluation message-digest (RMD) 160, and HAS (HAS). Hash Algorithm). Here, since the hash algorithm is mostly designed based on MD4, the structure is similar.
한편, 일반적으로 함수를 연산하는 방법은 소프트웨어를 이용하여 구현하는 방법과 하드웨어를 이용하여 구현하는 방법이 있다. 소프트웨어를 이용하여 구현하는 경우 융통성이 뛰어나지만 연산 속도가 떨어지고, 안정성이 떨어진다. On the other hand, generally, a method of calculating a function includes a method implemented using software and a method implemented using hardware. When implemented using software, it is flexible, but computational speed is slow and stability is low.
따라서, 해쉬 함수 연산에는 도 1과 같은 하드웨어 엔진이 사용된다. 하드웨어로 구현된 해쉬 함수 연산 엔진은 입력 데이터를 임시 저장하는 입력 버퍼(1), 입력 버퍼(1)로부터 수신한 중간값을 이용하여 해쉬 함수 처리에 필요한 중간값을 생성하는 중간값 처리부(2) 및 해쉬 함수를 연산하는 함수 처리부(3)를 구비한다. 이러한, 상기 해쉬 함수 연산 엔진의 구조에서 서로 다른 해쉬 함수를 연산할 경우, 각각의 해쉬 함수 연산에 필요한 적어도 둘 이상의 해쉬 함수 연산 엔진이 요구된다. 또한, 서로 다른 알고리즘의 해쉬 함수에는 서로 다른 중간값이 입력된다. 따라서, 서로 다른 해쉬 함수를 연산하기 위해서는 각각의 해쉬 함수에 입력되는 중간값을 연산할 수 있는 적어도 둘 이상의 중간값 처리부가 구비된다.Therefore, the hardware engine shown in FIG. 1 is used for hash function calculation. The hash function calculation engine implemented in hardware includes an input buffer (1) for temporarily storing input data and an intermediate value processing unit (2) for generating an intermediate value for hash function processing using an intermediate value received from the input buffer (1). And a
도 2는 종래기술에 따른 서로 다른 해쉬 함수(SHA-1, HAS)를 연산하기 위하여 복수의 함수 처리부(310, 320)를 구비한 해쉬 함수 연산 엔진의 구성도이다. 도 2를 참조하면, 종래기술에 따라 두 개의 함수를 연산하기 위하여 구현되는 해쉬 함수 연산 엔진은 입력 버퍼(1), SHA-1 함수 처리부(310), SHA-1 중간값 처리부(210), HAS 함수 처리부(320) 및 HAS 중간값 처리부(210)를 구비한다.2 is a configuration diagram of a hash function calculation engine including a plurality of
SHA-1 함수 처리부(310)는 SHA-1에 따른 함수를 처리하기 위하여 선택회로(311), 함수값 저장 블록(312), SHA-1 함수 연산부(313), 캐리 가산기(314), 출력 가산기(315) 및 출력 버퍼(316)를 구비하고, HAS 함수 처리부(320)는 HAS에 따른 함수를 처리하기 위하여 선택회로(321), 함수값 저장 블록(322), HAS 함수 연산부(323), 캐리 가산기(324), 출력 가산기(325) 및 출력 버퍼(326)를 구비한다.The SHA-1
여기서, SHA-1 함수 연산부(313), HAS 함수 연산부(323), SHA-1 중간값 처리부(210) 및 HAS 중간값 처리부(220)를 제외한 다른 구성요소의 하드웨어적 구성은 동일하다. 즉, SHA-1 함수 처리부(310)의 선택회로(311)와 HAS 함수 처리부(320)의 선택회로(321), SHA-1 함수 처리부(310)의 함수값 저장 블록(312)과 HAS 함수 처리부(320)의 함수값 저장 블록(322), SHA-1 함수 처리부(310)의 캐리 가산기(314)와 HAS 함수 처리부(320)의 캐리 가산기(324), SHA-1 함수 처리부(310)의 출력 가산기(315)와 HAS 함수 처리부(320)의 출력 가산기(325) 및 SHA-1 함수 처리부(310)의 출력 버퍼(316)와 HAS 함수 처리부(320)의 출력 버퍼(326)를 구성하는 하드웨어는 서로 동일하다.Here, the hardware configuration of the other components except for the SHA-1
따라서, 동일한 하드웨어를 각각의 함수 연산부(SHA-1 함수 연산부(313) 및 HAS 함수 연산부(323))에 마련함으로써, 데이터를 연산하는 하드웨어가 불필요하게 소모된다.Therefore, by providing the same hardware in each function calculating section (SHA-1
또한, SHA-1 중간값 처리부(210) 및 HAS 중간값 처리부(220)의 상세한 구성을 도시한 도 3을 참조하면, SHA-1 중간값 처리부(210)는 SHA-1 중간값 저장 블록(211), SHA-1 중간값 변수 연산부(212), SHA-1 중간값 선택 버퍼(213) 및 SHA-1 중간값 연산회로(214)를 구비하고, HAS 중간값 처리부(220)는 HAS 중간값 저장 블록(221), HAS 중간값 변수 연산부(222), HAS 중간값 선택 버퍼(223) 및 HAS 중간값 연산회로(224)를 구비한다. SHA-1 중간값 처리부(210)의 A블록과 HAS 중간값 처리부(220)의 C블록은 입력 버퍼에서 입력되는 16개의 동일한 데이터가 저장되는 블록이다. 따라서, 동일한 데이터를 각각 다른 공간의 저장 블록(A블록과 C블록)에 저장함으로써, 데이터를 저장하는 저장 블록이 불필요하게 소모된다.3 illustrates a detailed configuration of the SHA-1 intermediate
전술한 예에서와 같이 적어도 둘 이상의 함수의 알고리즘이 유사한 경우(예컨대, SHA-1 알고리즘과 HAS 알고리즘과 같은 경우), 다수의 동일한 회로가 구비됨으로써, 회로설계에 많은 전기소자의 낭비가 발생한다.If the algorithms of at least two or more functions are similar (eg, such as SHA-1 algorithm and HAS algorithm), as in the above example, a large number of identical circuits are provided, resulting in a waste of a lot of electrical elements in the circuit design.
또한, 함수 처리부에 불필요한 전기소자가 많이 구비됨에 따라 상기 전기소자들의 배치를 위한 설계에 많은 시간과 노력이 요구되고, 다수의 전기소자로 인해 하드웨어의 부피가 증가한다.In addition, as a large number of unnecessary electric elements are provided in the function processor, a lot of time and effort are required for designing the arrangement of the electric elements, and the volume of hardware increases due to the number of electric elements.
본 발명은 상기와 같은 문제점을 해결하기 위한 것으로 알고리즘이 다른 복수의 해쉬 함수 연산에 필요한 하드웨어 구성요소를 공유함으로써, 해쉬 함수 연산 엔진에 구비되는 전기소자의 양을 줄이고, 소형의 해쉬 함수 연산 엔진을 제공하는데 그 목적이 있다. The present invention is to solve the above problems, the algorithm is to share the hardware components necessary for a plurality of different hash function calculation, reducing the amount of electrical elements provided in the hash function calculation engine, and a small hash function calculation engine The purpose is to provide.
상기와 같은 목적을 달성하기 위하여 본 발명의 일 측면에 따른 해쉬 함수 연산을 위한 공통엔진은, 입력되는 데이터를 소정의 비트 단위로 블록을 생성하여 저장하는 입력 버퍼; 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수 연산에 필요한 중간값 중에서 공통되는 중간값을 공유하고, 상기 해쉬 함수 연산에 필요한 중간값 변수를 생성하는 중간값 처리부; 및 상기 중간값을 이용하여 상기 해쉬 함수를 연산하는 함수 처리부;를 구비한다.In order to achieve the above object, a common engine for a hash function operation according to an aspect of the present invention, an input buffer for generating and storing a block of the input data in a predetermined bit unit; An intermediate value processing unit for generating an intermediate value variable for the hash function operation and sharing a common intermediate value among intermediate values required for at least two different hash function operations different from each other; And a function processor for calculating the hash function using the intermediate value.
바람직하게, 상기 함수 처리부는 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수에서 공통되는 연산자를 공유하여 함수를 연산할 수 있다.Preferably, the function processing unit may operate a function by sharing operators common to at least two or more hash functions having different algorithms.
본 발명의 다른 측면에 따른 해쉬 함수 연산을 위한 공통엔진은, 입력되는 데이터를 소정의 비트 단위로 블록을 생성하여 저장하는 입력 버퍼; 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수 연산에 필요한 중간값 변수를 생성하고 저장하는 중간값 처리부; 및 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수에서 공통되는 연산자를 공유하여 해쉬 함수를 연산하는 함수 처리부;를 구비한다.In accordance with another aspect of the present invention, a common engine for a hash function calculation may include: an input buffer configured to generate and store blocks of input data in predetermined bit units; An intermediate value processing unit for generating and storing intermediate value variables required for at least two hash function operations different from each other; And a function processing unit that calculates a hash function by sharing operators common to at least two hash functions having different algorithms.
바람직하게, 상기 중간값 처리부는 알고리즘이 서로 다른 적어도 둘 이상의 해쉬 함수에서 공통되는 중간값을 공유할 수 있다.Preferably, the median processing unit may share a median common between at least two hash functions with different algorithms.
이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다. 이에 앞서, 본 명세서 및 청구범위에 사용된 용어나 단어는 통상적이거 나 사전적인 의미로 한정해서 해석되어서는 아니되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다. 따라서, 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다. 각 도면에 도시된 참조부호 중 동일한 참조부호는 동일한 부재를 나타낸다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Prior to this, the terms or words used in this specification and claims should not be construed as having a conventional or dictionary meaning, and the inventors should properly introduce the concept of terms in order to best explain their invention. It should be interpreted as meanings and concepts in accordance with the technical spirit of the present invention based on the principle that it can be defined. Therefore, the embodiments described in the specification and the drawings shown in the drawings are only the most preferred embodiment of the present invention and do not represent all of the technical idea of the present invention, various modifications that can be replaced at the time of the present application It should be understood that there may be equivalents and variations. The same reference numerals among the reference numerals shown in each drawing represent the same members.
도 4는 본 발명의 일 실시예에 따른 함수 연산 엔진의 구성도이다. 본 발명의 일 실시예에서는 알고리즘이 서로 유사한 해쉬 함수(SHA-1, HAS)를 연산하기 위하여 동일한 중간값을 저장하는 저장블록을 공유하는 중간값 처리부를 포함하는 함수 연산 엔진을 예시한다. 4 is a block diagram of a function calculation engine according to an embodiment of the present invention. In one embodiment of the present invention, the algorithm illustrates a function calculation engine including an intermediate value processing unit that shares a storage block storing the same intermediate value in order to calculate similar hash functions SHA-1 and HAS.
도 4를 참조하면, 본 발명의 일 실시예에 따른 함수 연산 엔진은 입력 버퍼(7), 중간값 처리부(40) 및 함수 처리부(50)를 구비한다.Referring to FIG. 4, the function calculation engine according to an exemplary embodiment of the present invention includes an
입력 버퍼(7)는 중간값 생성에 필요한 512비트의 패딩(padding)된 데이터와 SHA-1 함수와 HAS 함수를 처리하기 위한 160비트의 초기값을 저장한다.The
중간값 처리부(40)는 함수연산에 필요한 중간값(Wn)을 연산하여 함수처리부(50)로 전송하기 위하여 저장 블록(41), 중간값 변수 연산부(42), SHA-1 선택 버퍼(43), SHA-1 중간값 연산회로(44), HAS 선택 버퍼(45) 및 HAS 중간값 연산회로(46)를 구비한다.The intermediate
저장 블록(41)은 입력 버퍼(7)로부터 전송받은 16개의 중간값(Wn)과 SHA-1 중간값 연산회로(44) 및 HAS 중간값 연산회로(46)가 연산하여 전송하는 중간값(Wn)을 저장한다. 공통블록에는 입력 버퍼(7)로부터 전송받은 16개의 중간값(Wn)이 저장되고, SHA-1 블록에는 SHA-1 중간값 연산회로(44)로부터 수신하는 중간값(Wn)이 저장되고, HAS 블록에는 HAS 중간값 연산회로(46)로부터 수신한 중간값(Wn)이 저장된다.The
중간값 변수 연산부(42)는 n번째 단계의 함수를 처리하는데 필요한 중간값 계산에 요구되는 중간값 변수(Wn')를 연산하여 SHA-1 선택 버퍼(43) 및 HAS 선택 버퍼(45)로 전송한다.The intermediate value
한편, 알고리즘이 다른 함수는 동일한 단계에서 서로 다른 중간값(Wn)을 요구하므로, 이에 대한 중간값 변수(Wn')를 각각의 알고리즘에 적용하여 연산한다. 따라서, 동일한 단계에서 SHA-1 선택 버퍼(43) 및 HAS 선택 버퍼(45)로 전송되는 중간값 변수(Wn')는 서로 다를 수 있다.On the other hand, since functions with different algorithms require different median values Wn at the same step, the median variable Wn 'is applied to each algorithm. Therefore, in the same step, the median variable Wn 'transmitted to the SHA-1
SHA-1 선택 버퍼(43)는 중간값 변수 연산부(42)로부터 n번째 단계의 SHA-1 함수를 처리하는데 필요한 중간값 변수(Wn')를 수신하고, 상기 변수(Wn')에 대응하는 중간값(Wn)을 저장 블록(41)으로부터 추출하여 SHA-1 중간값 연산회로(44)로 전송한다.The SHA-1
SHA-1 중간값 연산회로(44)는 SHA-1 선택 버퍼(43)로부터 전송받은 중간값 변수(Wn')를 소정의 중간값 연산식에 적용하여 중간값(Wn)을 생성하고, 상기 생성된 중간값(Wn)을 n번째 단계에 대응하는 블록에 저장한다.The SHA-1 intermediate
HAS 선택 버퍼(45)는 중간값 변수 연산부(42)로부터 n번째 단계의 HAS 함수를 처리하는데 필요한 중간값 변수(Wn')를 수신하고, 상기 변수(Wn')에 대응하는 중간값(Wn)을 저장 블록(41)으로부터 추출하여 HAS 중간값 연산회로(46)로 전송한다.The
여기서, SHA-1 함수 연산은 총 80단계로 구성되며, 80단계의 연산을 수행하기 위하여 입력 버퍼(1)로부터 수신한 16개의 중간값(Wn)과 SHA-1 중간값 연산회로(84)로부터 생성되는 64개의 중간값(Wn)을 합쳐 총 80개의 중간값(Wn)을 필요로 한다. 따라서, 전체 80단계 중 1~16단계의 함수연산에 필요한 중간값(Wn)은 입력 버퍼(7)에서 입력된 512비트를 32비트로 나누어 생성되는 16개의 데이터를 사용하고, 17단계부터 80단계의 함수연산에 필요한 중간값(Wn)은 수학식 1에 따라 연산하여 생성되는 64개의 데이터를 사용한다. 따라서, SHA-1 중간값 연산회로(44)는 수학식 1을 연산하는 회로를 구비하며, SHA-1 중간값 변수 연산부(42)는 중간값 연산에 필요한 변수((n-3), (n-8), (n-14), (n-16))를 연산하는 회로를 구비한다.Here, the SHA-1 function calculation is composed of a total of 80 steps, from the 16 intermediate values Wn received from the
(ROLT는 1비트 서큘러 레프트 쉬프트 연산, XOR은 비트의 배타 논리합)(ROLT is 1 bit circular left shift operation, XOR is exclusive OR of bits)
HAS 선택 버퍼(45)는 중간값 변수 연산부(42)로부터 n번째 단계의 HAS 함수를 처리하는데 필요한 중간값 변수(Wn')를 수신하고, 상기 변수(Wn')에 대응하는 중간값(Wn)을 저장 블록(41)으로부터 추출하여 HAS 중간값 연산회로(46)로 전송한다.The
HAS 중간값 연산회로(46)는 HAS 선택 버퍼(45)로부터 전송받은 중간값 변수(Wn')를 소정의 중간값 연산식에 적용하여 중간값(Wn)을 생성하고, 상기 생성된 중간값(Wn)을 n번째 단계에 대응하는 블록에 저장한다.The HAS intermediate
HAS 함수 연산은 20단계를 4번 반복하여 총 80단계로 구성되며, 20단계의 연산을 수행하기 위하여 입력 버퍼(1)로부터 수신한 16개와 HAS 중간값 연산회로(46)로부터 생성되는 4개를 합쳐 총 20개의 중간값(Wn)을 필요로 한다. 따라서, HAS 중간값 연산회로(46)는 수학식 2를 연산하는 회로를 구비하며, 중간값 변수 연산부(42)는 중간값 연산에 필요한 변수(Wn')를 수학식 2에 기초하여 선택한다.HAS function calculation consists of 80 steps by repeating 20 steps 4 times, and 16 received from
W17=W15 XOR W2 XOR W5 XOR W8W17 = W15 XOR W2 XOR W5 XOR W8
W18=W11 XOR W14 XOR W1 XOR W4W18 = W11 XOR W14 XOR W1 XOR W4
W19=W7 XOR W10 XOR W13 XOR W0W19 = W7 XOR W10 XOR W13 XOR W0
따라서, 저장 블록(41)의 공통블록에는 입력 버퍼(1)로부터 전송받은 16개의 중간값(Wn)을 저장하기 위한 16개의 블록이 구비되고, SHA-1 블록에는 SHA-1 중간값 연산회로(44)로부터 수신하는 64개의 중간값(Wn)을 저장하기 위한 64개의 블록이 구비된다. 또한, HAS 블록에는 HAS 중간값 연산회로(46)로부터 수신하는 4개의 중간값(Wn)을 저장하기 위한 4개의 블록이 구비된다.Therefore, the common block of the
함수 처리부(50)는 저장 블록(41)으로부터 중간값을 수신하여 SHA-1 함수 또는 HAS 함수에 적용하고, 함수에 상응하는 연산을 통해 결과값을 출력한다.The
여기서, SHA-1은 80단계를 4라운드로 나누어 각각의 라운드는 20단계로 설정하고, 각 단계는 표 1의 함수와 상수에 기초하여 연산된다. HAS 알고리즘도 SHA-1 알고리즘에서와 같이 80단계를 4라운드로 나누며, 각각의 라운드는 20단계로 구성된다. 각 단계는 표 2의 함수와 상수에 기초하여 연산된다.Here, SHA-1 divides 80 steps into 4 rounds and sets each round to 20 steps, and each step is calculated based on the functions and constants of Table 1. As in the SHA-1 algorithm, the HAS algorithm divides 80 steps into four rounds, and each round consists of 20 steps. Each step is calculated based on the functions and constants in Table 2.
SHA-1 알고리즘과 HAS 알고리즘은 함수의 구조가 동일하고, 알고리즘에 사용되는 함수는 3라운드를 제외한 나머지(1, 2, 4라운드) 함수(F0(B,C,D), F1(B,C,D), F3(B,C,D))는 모두 동일하다. 따라서, 함수 처리부(50)가 상기 두 함수(SHA-1, HAS)를 처리함에 있어서, 상기 두 함수에서 1, 2, 4라운드에 공통으로 사용되는 연산자를 공유하는 것이 바람직하다.The SHA-1 algorithm and the HAS algorithm have the same structure, and the functions used in the algorithm are the functions (F0 (B, C, D), F1 (B, C) except the third round (1, 2, 4 rounds). , D) and F3 (B, C, D)) are all the same. Therefore, when the
도 5는 본 발명의 다른 실시예에 따른 함수 연산 엔진의 구성도이다. 본 발명의 다른 실시예에서는 알고리즘이 서로 유사한 해쉬 함수(SHA-1, HAS)의 연산에 있어서, 공통으로 사용되는 연산자를 공유하여 상기 두 함수(SHA-1, HAS)를 연산하는 함수 처리부(70)를 포함하는 함수 연산 엔진을 예시한다. 도 5를 참조하면, 본 발명의 다른 실시예에 따른 함수 연산 엔진은 입력 버퍼(7), 중간값 처리부(60) 및 함수 처리부(70)를 구비한다.5 is a configuration diagram of a function calculation engine according to another embodiment of the present invention. In another embodiment of the present invention, in the calculation of hash functions SHA-1 and HAS similar to each other, a
입력 버퍼(7)는 중간값 생성에 필요한 512비트의 패딩(padding)된 데이터와 SHA-1 함수와 HAS 함수를 처리하기 위한 160비트의 초기값을 저장한다.The
중간값 처리부(60)는 수학식 1 및 수학식 2에 기초하여 SHA-1함수와 HAS함수 연산에 필요한 중간값을 각각 연산하여 함수처리부(70)로 전송한다.The
중간값 처리부(60)는 알고리즘이 서로 유사한 해쉬 함수(SHA-1, HAS)에서 공통되는 중간값(Wn)을 저장하는 저장영역을 공유할 수 있도록 구비되는 것이 바람직하다. 비록 본 발명의 실시예에서 중간값 처리부(60)는 적어도 둘 이상의 함수에서 공통되는 중간값(Wn)을 저장하는 저장영역을 공유하는 것을 예시하였으나, 본 발명에서 이를 한정하는 것은 아니며, 예컨대, 함수 처리에 필요한 중간값(Wn)을 연산하고, 저장할 수 있는 통상의 회로가 될 수도 있다.The intermediate
함수 처리부(70)는 초기값과 중간값을 정해진 함수 연산회로에 적용하여 함수값을 연산한다. 함수처리부(70)는 알고리즘이 다른 복수의 함수를 연산하기 위하여 선택회로(71), 함수값 저장 블록(72), 함수 선택부(73), 공통함수 연산부(74), 차등함수 연산부(75), 캐리 가산기(76), 출력 가산기(77) 및 출력 버퍼(78)를 구비한다.The
선택회로(71)는 함수 연산의 반복에 따른 제어신호를 수신하여 이에 대응하는 신호를 선택하여 함수값 저장 블록(72)으로 전송한다. The
함수값 저장 블록(72)은 초기값과 함수 연산의 반복에 따라 생성되는 함수값을 32비트로 블록화하여 저장한다.The function
공통함수 연산부(74)는 함수값 저장 블록(72)에 32비트로 블록화되어 저장되는 함수값에서 SHA-1함수와 HAS 함수에서 공통되는 1, 2, 4라운드의 연산을 수행하는 함수에 적용한다.The common
차등함수 연산부(75)는 SHA-1 함수 연산부(751)와 HAS 함수 연산부(752)를 구비하며, 상기 두 함수(SHA-1 함수, HAS 함수)의 연산에 있어서, 서로 다른 부분의 연산을 처리한다. 즉, SHA-1 함수 연산부(751)는 상기 표 1에 나타난 3라운드의 연산을 처리하고, HAS 함수 연산부(752)는 상기 표 2에 나타난 3라운드의 연산을 처리한다.The differential
캐리 가산기(76)는 중간값 처리부로부터 수신하는 중간값(Wn), 공통함수 연산부(74) 또는 차등함수 연산부(75)에서 연산된 함수값 및 함수값 저장 블록(72)에 저장되는 데이터를 수신하여 SHA-1 함수 또는 HAS 함수에 적용하여 가산하고, 가산된 데이터는 선택회로(71)로 전송된다.The
출력가산기(77)는 입력 버퍼(7)에서 소정의 비트로 블록화된 초기값에 함수값 저장 블록(72)에 저장되는 블록화된 함수값을 가산하여 출력 버퍼(78)로 전송하고, 출력 버퍼(78)는 출력가산기(77)의 출력신호를 버퍼링한다.The
이하, 도 6을 참조하여 본 발명의 일 실시예에 따른 해쉬 함수 연산 엔진의 작동을 SHA-1 함수 연산을 중심으로 설명한다.Hereinafter, the operation of the hash function calculation engine according to an embodiment of the present invention will be described with reference to SHA-1 function calculation.
입력 버퍼(7)는 512비트로 패딩(padding)된 데이터를 32비트씩 분할하여 16개의 중간값을 생성하여 저장 블록(81)의 공통블록에 저장한다. The
중간값 변수 연산부(82)는 SHA-1 함수 연산 처리 신호를 수신하여 SHA-1 함수에 대응하는 중간값 변수(Wn')를 연산한다. 0~15단계의 중간값은 공통블록에 저장된 16개의 중간값(Wn)을 사용하므로 중간값 연산은 16단계의 중간값(W16) ~ 79단계의 중간값(W79)의 연산에 필요한 중간값 변수(Wn'; (n-3), (n-8), (n-14), (n-16))를 차례대로 연산한다. The median
중간값 변수 연산부(82)에서 연산된 중간값 변수(Wn')는 SHA-1 중간값 선택버퍼(83)로 전송되고, 이를 수신한 중간값 선택버퍼(83)는 저장블록(81)으로부터 상기 중간값 변수(Wn')에 대응하는 중간값(Wn)을 추출하여 저장한다. SHA-1 중간값 선택버퍼(83)에 저장된 중간값(Wn)은 SHA-1 중간값 연산회로(84)로 전송되어 상기 수학식 1에 상응하는 연산회로를 통해 연산 처리된다. 연산 처리된 중간값(Wn)은 저장블록(81)의 SHA-1블록으로 저장된다.The intermediate value variable Wn 'calculated by the intermediate value
예컨대, 16단계의 중간값(W16)을 연산하기 위해서는 (n-3), (n-8), (n-14), (n-16)의 변수가 필요하므로 중간값 변수 연산부(82)는 n=16을 대입하여 13, 12, 2, 3을 연산한다. 연산된 중간값 변수(W16'; 13, 12, 2, 0)는 중간값 선택버퍼(83)로 전송되고, 중간값 선택버퍼(83)는 저장블록(81) 내의 공통블록의 W13, W12, W2, W3을 추출하여 임시 저장한다. W13, W12, W2, W3은 SHA-1 중간값 연산회로(84)에 전송되어 수학식 1의 연산을 통해 16번째 중간값(W16)을 생성하고, 생성된 16번째 중간값(W16)은 저장블록(81)의 SHA-1블록에 저장된다.For example, in order to calculate the intermediate value W16 in step 16, the variables of (n-3), (n-8), (n-14), and (n-16) are required. Calculate 13, 12, 2, 3 by substituting n = 16. The calculated intermediate value variable W16 '13, 12, 2, 0 is transferred to the intermediate
중간값 연산에 있어서, 중간값 변수 연산부(82)가 HAS 함수 연산 처리 신호를 수신하는 경우를 살펴보면, 0~15단계의 중간값(Wn)은 공통블록에 저장된 16개의 중간값(Wn)을 공통으로 사용하므로 HAS 함수 연산에 필요한 중간값은 16단계의 중간값(W16) ~ 19단계의 중간값(W19)이 필요하다. HAS 함수의 경우 4개의 중간값(Wn)만을 생성하면 되므로 중간값 변수 연산부(82)는 중간값 연산에 필요한 중간값 변수(Wn')의 연산을 수행하지 않고, 각 단계에 대응하는 중간값 연산에 필요한 중간값 변수를 저장한다. 따라서, 중간값 변수 연산부(82)가 각 단계에 대응하는 중간값(Wn) 연산에 필요한 중간값 변수(Wn')를 선택하여 HAS 중간값 선택버퍼(85)에 전송하고, HAS 중간값 선택버퍼(85)는 상기 중간값 변수(Wn)에 대응하는 중간값을 저장한다. HAS 중간값 연산회로(86)는 HAS 중간값 선택버퍼(85)에 저장된 중간값(Wn)을 상기 수학식 2에 대응하는 연산회로를 통해 중간값(Wn)을 생성하여 저장블록(81)의 HAS 블록에 저장한다. In the intermediate value calculation, when the intermediate value
한편, 입력 버퍼(7)에 32비트씩 5개로 분할된 160비트의 초기값은 선택회로(91)로 전송되고, 선택회로(91)는 함수 연산 처리 신호를 수신하여 초기값을 함수값 저장 블록(92)으로 전송한다. 이때, 초기값은 5개의 블록(A, B, C, D, E)으로 분할되어 저장된다. 5개의 블록으로 나뉘어 저장된 초기값 중 함수 연산에 필요한 B, C, D블록의 초기값은 공통함수 연산부(94) 및 차등 함수 연산부(95)로 전송된다. 함수 선택부(93)는 SHA-1 함수 또는 HAS 함수 연산의 단계를 확인하고, 이에 대응하는 함수 연산 신호를 전송한다. SHA-1 함수의 초기값을 수신하여 연산하는 단계를 예시하고 있으므로 함수의 연산은 SHA-1 함수의 0번째 단계이다. SHA-1 함수와 HAS 함수는 3라운드의 단계를 제외하고 모두 동일한 함수를 사용하여 연산하므로 함수 선택부(93)는 공통함수 연산부(94)에 작동신호를 전송한다. 이에 따라, 공통함수 연산부(94)는 표 1의 F0(B,C,D)에 대응하는 연산을 수행하고, 연산 결과를 출력한다.On the other hand, the 160-bit initial value divided into five 32-bits in the
한편, 제 1쉬프터(971)는 함수값 저장블록(92)의 A블록에 저장된 데이터를 5비트 서큘러 레프트(circular left) 연산하여 제 1캐리 가산기(961)로 전송한다. 제 1캐리 가산기는 공통함수 연산부(94)로부터 수신한 데이터에 제 1쉬프터(971)로부터 수신한 데이터를 가산하여 제 2캐리 가산기(962)로 전송한다. 제 2캐리 가산기(962)는 제 1캐리 가산기(961)로부터 수신한 데이터에 함수값 저장블록(92)의 E블록으로부터 수신한 데이터를 가산하여 제 3캐리 가산기(963)로 전송한다. 제 3캐리 가산기(963)는 제 2캐리 가산기(962)로부터 수신한 데이터에 중간값 저장블록(81)의 0번째 중간값을 수신하여 가산하고, 결과값을 제 4캐리 가산기(964)로 전송한다. 제 4캐리 가산기(964)는 제 3캐리 가산기(963)로부터 수신한 데이터에 상기 표 1의 상수값이 저장된 상수블록(966)으로부터 K0값을 수신하여 가산하고, 그 결과를 캐리 전달 가산기(965)로 전송한다. 캐리 전달 가산기(965)는 제 4캐리 가산기(964)로부터 수신한 데이터를 선택회로(91)의 최상위 비트에 위치한 선택기(a)로 전송한다.Meanwhile, the
한편, 함수값 저장블록(92)의 A블록에 저장된 초기값은 선택회로(91)의 최상위 비트로부터 두 번째에 위치한 선택기(b)로 전송되고, 함수값 저장블록(92)의 A블록에 저장된 초기값은 30비트 서큘러 레프트 연산되어 최상위 비트로부터 세 번째에 위치한 선택기(c)로 전송된다. 또한, 함수값 저장블록(92)의 C블록에 저장된 초기값은 선택회로(91)의 최상위 비트로부터 네 번째에 위치한 선택기(d)로 전송되고, 함수값 저장블록(92)의 D블록에 저장된 초기값은 최하위 비트에 위치한 선택기(e)로 전송된다.On the other hand, the initial value stored in the A block of the function
또한, 함수값 저장블록(92)에 5개(A, B, C, D, E)로 블록화되어 저장되는 데이터는 출력가산기(98)에 구비되는 5개의 가산기(add0, add1, add2, add3, add4)에 차례로 전송되어 초기값에 가산된다.In addition, the data stored in blocks of five (A, B, C, D, E) in the function
입력 버퍼(7)로부터 입력된 초기값은 전술한 과정을 반복하여 수행하여 총 80단계의 연산을 반복하고, 연산된 결과는 출력가산기(98)를 통해 계속 가산되며, 가산된 결과는 출력버퍼(99)를 통해 160비트의 신호로 버퍼링한다.The initial value input from the
한편, 연산의 반복에 있어서, SHA-1의 3라운드(표 1 참조)를 연산하는 경우, 함수 선택부(93)는 SHA-1 함수 연산부(951)를 작동시키고, HAS의 3라운드(표 2 참조)를 연산하는 경우, HAS 함수 연산부를 작동시켜 각각의 알고리즘에 대응하는 함수를 연산한다. 또한, HAS를 연산하는 경우 제 1쉬프터(971) 대신 제 3쉬프터(973), 제 2쉬프터(972) 대신 제 4쉬프터(974)를 사용한다. 이때, 제 3쉬프터(973)는 함수 선택부(93)로부터 각 단계의 정보를 입력받아 표 3에 도시된 비트 수 만큼의 서큘러 레프트 연산을 수행하며, 20단계의 연산을 4라운드 반복하여 연산한다. 또한, 제 4쉬프터(974)는 함수 선택부(93)로부터 각 단계의 정보를 입력받아 표 4에 도시된 비트 수 만큼의 서큘러 레프트 연산을 수행On the other hand, in the repetition of the operation, when calculating the third round of SHA-1 (see Table 1), the
이상에서 본 발명은 비록 한정된 실시예와 도면에 의해 설명되었으나, 본 발명은 이것에 의해 한정되지 않으며 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 본 발명의 기술사상과 아래에 기재될 특허청구범위의 균등범위 내에서 다양한 수정 및 변형이 가능함은 물론이다.Although the present invention has been described above by means of limited embodiments and drawings, the present invention is not limited thereto and will be described below by the person skilled in the art to which the present invention pertains. Of course, various modifications and variations are possible within the scope of the claims.
상술한 바와 같이, 본 발명의 해쉬 함수 연산을 위한 공통엔진에 따르면, 알고리즘의 구조가 유사한 복수의 함수를 처리하기 위하여 동일한 하드웨어 구성요소를 공유하는 해쉬 함수 연산 엔진을 설계함으로써, 함수 처리에 불필요한 전기소자를 줄일 수 있다.As described above, according to the common engine for hash function calculation of the present invention, by designing a hash function calculation engine that shares the same hardware components in order to process a plurality of functions having a similar structure of the algorithm, it is unnecessary to the function processing The device can be reduced.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020050080532A KR100581662B1 (en) | 2005-08-31 | 2005-08-31 | Common engine for plural hash functions having different algorithms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020050080532A KR100581662B1 (en) | 2005-08-31 | 2005-08-31 | Common engine for plural hash functions having different algorithms |
Publications (1)
Publication Number | Publication Date |
---|---|
KR100581662B1 true KR100581662B1 (en) | 2006-05-22 |
Family
ID=37181738
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020050080532A KR100581662B1 (en) | 2005-08-31 | 2005-08-31 | Common engine for plural hash functions having different algorithms |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100581662B1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8086864B2 (en) | 2007-07-09 | 2011-12-27 | Electronics And Telecommunications Research Institute | Low power HMAC encryption apparatus |
US8275126B2 (en) | 2008-12-08 | 2012-09-25 | Electronics And Telecommunications Research Institute | Apparatus and method for hash cryptography |
CN113794567A (en) * | 2021-09-13 | 2021-12-14 | 上海致居信息科技有限公司 | Synthesis acceleration method and device of SHA256 Hash algorithm zero-knowledge proof circuit |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001080483A2 (en) | 2000-04-13 | 2001-10-25 | Broadcom Corporation | Authentication engine architecture and method |
US20020191791A1 (en) | 2001-06-13 | 2002-12-19 | Anand Satish N. | Apparatus and method for a hash processing system using multiple hash storage areas |
KR20030004771A (en) * | 2001-07-06 | 2003-01-15 | 최준림 | Word generation circuit used in the Secure Hash Algorithm-1 |
KR20030081348A (en) * | 2000-12-13 | 2003-10-17 | 인피네온 테크놀로지스 아게 | Cryptographic processor |
-
2005
- 2005-08-31 KR KR1020050080532A patent/KR100581662B1/en not_active IP Right Cessation
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2001080483A2 (en) | 2000-04-13 | 2001-10-25 | Broadcom Corporation | Authentication engine architecture and method |
KR20030081348A (en) * | 2000-12-13 | 2003-10-17 | 인피네온 테크놀로지스 아게 | Cryptographic processor |
US20020191791A1 (en) | 2001-06-13 | 2002-12-19 | Anand Satish N. | Apparatus and method for a hash processing system using multiple hash storage areas |
KR20030004771A (en) * | 2001-07-06 | 2003-01-15 | 최준림 | Word generation circuit used in the Secure Hash Algorithm-1 |
Non-Patent Citations (2)
Title |
---|
1020030004771 |
1020050080532 - 579531 |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8086864B2 (en) | 2007-07-09 | 2011-12-27 | Electronics And Telecommunications Research Institute | Low power HMAC encryption apparatus |
US8275126B2 (en) | 2008-12-08 | 2012-09-25 | Electronics And Telecommunications Research Institute | Apparatus and method for hash cryptography |
CN113794567A (en) * | 2021-09-13 | 2021-12-14 | 上海致居信息科技有限公司 | Synthesis acceleration method and device of SHA256 Hash algorithm zero-knowledge proof circuit |
CN113794567B (en) * | 2021-09-13 | 2024-04-05 | 上海致居信息科技有限公司 | Synthetic acceleration method and device for SHA256 hash algorithm zero knowledge proof circuit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Lee et al. | Correlation manipulating circuits for stochastic computing | |
JP3014391B2 (en) | Cryptography and cryptographic processor for implementing the method | |
WO2015145964A1 (en) | Encryption processing device, encryption processing method, and program | |
US7590917B2 (en) | Parameter generation for interleavers | |
KR100581662B1 (en) | Common engine for plural hash functions having different algorithms | |
Imana et al. | Efficient hardware arithmetic for inverted binary ring-lwe based post-quantum cryptography | |
Sun et al. | Design and optimized implementation of the SHA-2 (256, 384, 512) hash algorithms | |
US20010025293A1 (en) | Divider | |
CN109687972B (en) | Circuit supporting multiple Hash algorithms | |
KR100731985B1 (en) | Device and method for pipelined parallel crc | |
US7437657B2 (en) | High speed add-compare-select processing | |
JPWO2009020216A1 (en) | Calculation method and calculation device | |
Nakashima et al. | AES S-box hardware with efficiency improvement based on linear mapping optimization | |
JP2009169316A (en) | Hash function operational device, signature device, program and hash function operational method | |
CN113254072B (en) | Data processor, data processing method, chip, computer device, and medium | |
Piestrak | Design of multi-residue generators using shared logic | |
US20110176673A1 (en) | Encrypting apparatus | |
KR101318992B1 (en) | Modulo n calculation method and apparatus thereof | |
KR100417793B1 (en) | Word generation circuit used in the Secure Hash Algorithm-1 | |
US8707224B2 (en) | Method of optimizing combinational circuits | |
Song et al. | Optimum primitive polynomials for low-area low-power finite field semi-systolic multipliers | |
Che et al. | An efficient partial sums generator for constituent code based successive cancellation decoding of polar codes | |
US20110145311A1 (en) | Method and apparatus for modulo n operation | |
JP3317079B2 (en) | Variable length code decoding device | |
JP4859536B2 (en) | Data converter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
A302 | Request for accelerated 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: 20120612 Year of fee payment: 7 |
|
FPAY | Annual fee payment |
Payment date: 20130510 Year of fee payment: 8 |
|
LAPS | Lapse due to unpaid annual fee |