JP2002162904A - Hash function processor - Google Patents

Hash function processor

Info

Publication number
JP2002162904A
JP2002162904A JP2000360211A JP2000360211A JP2002162904A JP 2002162904 A JP2002162904 A JP 2002162904A JP 2000360211 A JP2000360211 A JP 2000360211A JP 2000360211 A JP2000360211 A JP 2000360211A JP 2002162904 A JP2002162904 A JP 2002162904A
Authority
JP
Japan
Prior art keywords
data
processing
key
processing circuit
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2000360211A
Other languages
Japanese (ja)
Inventor
Nobusato Kadowaki
信諭 門脇
Satoshi Hyodo
聡 兵頭
Tatsuo Masuda
達男 増田
Hideki Kamiyanagi
秀樹 上柳
Yasukazu Miyazaki
靖一 宮崎
Hiroshige Nakatani
浩茂 中谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP2000360211A priority Critical patent/JP2002162904A/en
Publication of JP2002162904A publication Critical patent/JP2002162904A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PROBLEM TO BE SOLVED: To realize the speeding up of processing of the hash function processor of a HMAC method. SOLUTION: The hash function processor is provided with a key processing circuit 2 to perform first and second key processing for a first and a second input values A and B, respectively, and a data processing circuit 3 which makes the processing data of the second key processing into a second initial value Bo to perform second data processing to the output data X of a first data processing circuit, while making the processing data of the first key processing into a first initial value Ao to perform first data processing to processing object data D. The speeding up of hash processing can be realized by performing the second key processing in the key processing circuit 2 and the first data processing in the data processing circuit 3, in parallel.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、情報通信データの
暗号化等のコンピュータネットワークにおけるセキュリ
ティを確保する技術に関し、特にメッセージを逆変換困
難な値であるハッシュ値に変換するハッシュ関数処理装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for ensuring security in a computer network such as encryption of information communication data, and more particularly to a hash function processing device for converting a message into a hash value which is difficult to reversely convert.

【0002】[0002]

【従来の技術】従来、HMAC方式のハッシュ関数処理
装置はソフトウエアにより処理されている。この方式自
体は「"HMAC:Keyed-Hashing for Message Authenticati
on" RFC 2104(1997)」で開示されており、MD5やSH
A−1などの反復暗号ハッシュ関数を秘密の共有鍵と組
み合わせて使用するものである。HMAC方式のハッシ
ュ関数はキーデータと設定値A、BとからXOR値を求
め、所定のキー処理及び所定のデータ処理等を行うこと
によりハッシングを行うものである。またこれらのキー
処理及びデータ処理はMD5等のハッシュ関数が適用さ
れる。MD5等のハッシュ関数は、128ビットの初期
値を予め設定し、メッセージ等の処理データを例えば5
12ビット毎に区分し、ハッシュ関数に導いて所定の回
数の転置処理等を繰り返して128ビットの出力データ
を得るものである。
2. Description of the Related Art Conventionally, a hash function processing device of the HMAC system is processed by software. This method itself is called "" HMAC: Keyed-Hashing for Message Authenticati
on "RFC 2104 (1997)", MD5 and SH
An iterative cryptographic hash function such as A-1 is used in combination with a secret shared key. The hash function of the HMAC method obtains an XOR value from key data and set values A and B, and performs hashing by performing predetermined key processing and predetermined data processing. For these key processing and data processing, a hash function such as MD5 is applied. For a hash function such as MD5, a 128-bit initial value is set in advance, and processing data such as a message
The data is divided into 12 bits, and a transposition process or the like is repeated a predetermined number of times by leading to a hash function to obtain 128-bit output data.

【0003】[0003]

【発明が解決しようとする課題】HMAC方式のハッシ
ュ関数処理装置においては、対象データを暗号化しデー
タの容易な解読を防止する必要がある。したがって、処
理の複雑化は避けることができない。一方、暗号化の高
速化は必要であり、それを実現するための検討が望まれ
ている。
In the hash function processing device of the HMAC system, it is necessary to encrypt the target data to prevent the data from being easily decrypted. Therefore, complication of processing cannot be avoided. On the other hand, high-speed encryption is necessary, and studies for realizing it are desired.

【0004】本発明は上記の課題を解決するためになさ
れたものであり、HMAC方式のハッシュ関数処理装置
においてその構成をハードウエアで実現した場合、ハー
ドウエア的にハッシングの高速化を実現可能にするハッ
シュ関数処理装置を提供することを目的とする。.
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problem, and when the configuration is realized by hardware in a hash function processing device of the HMAC system, the speeding up of hashing can be realized by hardware. It is an object of the present invention to provide a hash function processing device that performs .

【0005】[0005]

【課題を解決するための手段】請求項1記載の発明は、
第1、第2の入力値に対してそれぞれハッシュ演算処理
を行う第1、第2のキー処理回路と、前記第1のキー処
理回路からの処理データを第1の初期値として処理対象
データにハッシュ演算処理を行う第1のデータ処理回路
と、前記第2のキー処理回路からの処理データを第2の
初期値として前記第1のデータ処理回路の出力データに
ハッシュ演算処理を行う第2のデータ処理回路とを備
え、前記第2のキー処理回路と前記第1のデータ処理回
路とを並列処理させるようにしたハッシュ関数処理回路
である。
According to the first aspect of the present invention,
First and second key processing circuits for performing a hash operation on the first and second input values, respectively, and processing data from the first key processing circuit as processing target data as a first initial value. A first data processing circuit for performing a hash operation process; and a second data processing circuit for performing a hash operation process on output data of the first data processing circuit using the processing data from the second key processing circuit as a second initial value. A hash function processing circuit including a data processing circuit, wherein the second key processing circuit and the first data processing circuit are processed in parallel.

【0006】この構成によれば、第1のデータ処理と第
2のキー処理をデータ処理が同時に行われるので、その
分、ハッシングの高速化が実現される。
According to this configuration, since the first data processing and the second key processing are performed simultaneously, hashing can be speeded up accordingly.

【0007】請求項2記載の発明は、前記第1、第2の
キー処理回路を共有すると共に、前記第1、第2のデー
タ処理回路を共有し、前記第1、第2の入力値を順番に
共有したキー処理回路に導くと共に、前記第1の入力値
に対して行われたキー処理の結果を第1の初期値として
行われる前記共有したデータ処理回路の結果を処理対象
データとして、このデータ処理回路に再入力する構成と
したことを特徴とする請求項1記載のハッシュ関数処理
回路である。この構成によれば、第1、第2のデータ処
理を行うデータ処理回路と、第1、第2のキー処理を行
うキー処理回路はそれぞれ1つずつとなり、しかも、第
1のデータ処理と第2のキー処理とが同時に実行される
こととなり、その分高速化される。
According to a second aspect of the present invention, the first and second key processing circuits are shared, the first and second data processing circuits are shared, and the first and second input values are shared. Along with sequentially leading to the shared key processing circuit, a result of the shared data processing circuit performed as a first initial value using a result of the key processing performed on the first input value as processing target data, 2. The hash function processing circuit according to claim 1, wherein the data is re-input to the data processing circuit. According to this configuration, the number of the data processing circuits for performing the first and second data processing and the number of the key processing circuits for performing the first and second key processing are each one. 2 is simultaneously executed with the key processing of FIG.

【0008】請求項3記載の発明は、第1、第2のキー
データに対応させて第1、第2の設定値との間で論理演
算を行って第1、第2の入力値を得る第1、第2の排他
的論理和回路と、第1、第2の入力値に対してそれぞれ
ハッシュ演算処理を行う第1、第2のキー処理回路と、
前記第1のキー処理回路からの処理データを第1の初期
値として処理対象データにハッシュ演算処理を行う第1
のデータ処理回路と、前記第2のキー処理回路からの処
理データを第2の初期値として前記第1のデータ処理回
路の出力データにハッシュ演算処理を行う第2のデータ
処理回路とを有するハッシュ関数処理装置であって、デ
ータを記憶可能な第1、第2のレジスタと、前記第1、
第2の初期値をそれぞれ第1、第2のレジスタに記憶さ
せる記憶処理手段と、第1、第2のデータ処理動作に対
応させて前記第1、第2のレジスタから前記第1、第2
の初期値を出力するスイッチ手段とを備えたことを特徴
とするハッシュ関数処理装置である。
According to a third aspect of the present invention, first and second input values are obtained by performing a logical operation between the first and second set values in correspondence with the first and second key data. A first and a second exclusive OR circuit, a first and a second key processing circuit for performing a hash operation on the first and second input values, respectively,
A first operation for performing a hash operation on data to be processed using the processing data from the first key processing circuit as a first initial value
And a second data processing circuit that performs a hash operation on output data of the first data processing circuit using the processing data from the second key processing circuit as a second initial value. A function processing device, comprising: first and second registers capable of storing data;
Storage processing means for storing a second initial value in first and second registers, respectively; and storing the first and second registers from the first and second registers in correspondence with first and second data processing operations.
And a switch means for outputting an initial value of the hash function.

【0009】この構成によれば、第1、第2の初期値を
それぞれ第1、第2のレジスタに記憶し、これらのレジ
スタから第1、第2のデータ処理の要求に応じて第1、
第2の初期値を読み出すことにより前記第1、第2のキ
ー処理を行う必要が無くなり、ハッシュ処理の高速化が
可能となる。
According to this configuration, the first and second initial values are stored in the first and second registers, respectively, and the first and second initial values are stored in the first and second registers in response to the first and second data processing requests.
By reading the second initial value, there is no need to perform the first and second key processing, and the speed of the hash processing can be increased.

【0010】請求項4記載の発明は、前記第1、第2の
データ処理回路は第1、第2の初期値をそれぞれ一時的
に格納するメモリ部を有し、さらに前記第1、第2のレ
ジスタを共有し、前記スイッチ手段は、前記第1、第2
のデータ処理回路の動作に同期して前記共有するレジス
タの内容を前記メモリ部との間で交互に入れ替えるもの
であることを特徴とする請求項3記載のハッシュ関数処
理装置である。この構成によれば、前記第1、第2のレ
ジスタの個数が1個で済むこととなり、回路が簡素化さ
れる。
According to a fourth aspect of the present invention, the first and second data processing circuits have a memory section for temporarily storing first and second initial values, respectively, and the first and second data processing circuits are further provided. , And the switch means includes the first and second registers.
4. The hash function processing device according to claim 3, wherein the contents of the shared register are alternately exchanged with the memory unit in synchronization with the operation of the data processing circuit. According to this configuration, the number of the first and second registers is reduced to one, and the circuit is simplified.

【0011】請求項5記載の発明は、第1、第2のキー
データに対応させて第1、第2の設定値との間で論理演
算を行って第1、第2の入力値を得る第1、第2の排他
的論理和回路と、第1、第2の入力値に対してそれぞれ
所定データ長毎にハッシュ演算処理を行う第1、第2の
キー処理回路と、前記第1のキー処理回路からの処理デ
ータを第1の初期値として所定データ長毎の処理対象デ
ータにハッシュ演算処理を行う第1のデータ処理回路
と、前記第2のキー処理回路からの処理データを第2の
初期値として前記第1のデータ処理回路の出力データに
ハッシュ演算処理を行う第2のデータ処理回路とを備
え、前記第1、第2のデータ処理回路による処理を所定
周期で行わせると共に、前記第2のキー処理回路と前記
第1のデータ処理回路とを並列処理する処理制御手段を
備えたことを特徴とするハッシュ関数処理回路であっ
て、前記第1、第2のキーデータを共通にすると共に、
前記共通するキーデータのデータ長が前記所定データ長
を超えるとき、前記所定データ長のキーデータを作成す
る前段回路を備え、前記処理制御手段は、前記前段回路
による処理が終了するまで前記第1のデータ処理回路の
処理の開始を遅延する遅延手段を備えたことを特徴とす
るハッシュ関数処理装置である。
According to a fifth aspect of the present invention, first and second input values are obtained by performing a logical operation between the first and second set values in correspondence with the first and second key data. A first and a second exclusive OR circuit, a first and a second key processing circuit for performing a hash operation on the first and second input values for each predetermined data length, and the first and the second key processing circuits; A first data processing circuit for performing a hash operation on data to be processed for each predetermined data length using processing data from the key processing circuit as a first initial value, and processing data from the second key processing circuit as a second data. A second data processing circuit that performs a hash operation on output data of the first data processing circuit as an initial value of the first and second data processing circuits. The second key processing circuit and the first data processing circuit The A hash function processing circuit, characterized in that it includes a processing control unit for parallel processing, the first, as well as a common second key data,
When the data length of the common key data exceeds the predetermined data length, a pre-stage circuit for generating the key data of the predetermined data length is provided, and the processing control means is configured to execute the first control until the processing by the pre-stage circuit ends. And a delay unit for delaying the start of processing of the data processing circuit.

【0012】この構成によれば、キーデータが所定デー
タ長を超えるような長い場合、第1のデータ処理が一定
時間遅らされるので、第1のキー処理が終了してから第
1のデータ処理が開始されることとなり、適正なハッシ
ュ値が求められる。
According to this configuration, if the key data is longer than the predetermined data length, the first data processing is delayed for a predetermined time, so that the first data processing is terminated after the first key processing is completed. Processing is started, and an appropriate hash value is obtained.

【0013】請求項6記載の発明は、第1、第2の入力
値に対してそれぞれハッシュ演算処理を行う第1、第2
のキー処理回路と、前記第1のキー処理回路からの処理
データを第1の初期値として処理対象データに所定デー
タ長毎のハッシュ演算処理を行う第1のデータ処理回路
と、前記第2のキー処理回路からの処理データを第2の
初期値として前記第1のデータ処理回路の出力データに
ハッシュ演算処理を行う第2のデータ処理回路とを備
え、前記第2のキー処理回路と前記第1のデータ処理回
路とを並列処理する処理制御手段を備えたことを特徴と
するハッシュ関数処理回路であって、前記第1のデータ
処理回路に入力される処理対象データ長が前記所定デー
タ長を超えるとき、前記処理対象データを所定データ長
毎に前記第1のデータ処理回路で所定データ長になるま
でハッシュ処理する変換回路構成を有し、前記処理制御
手段は、前記変換回路構成による処理が終了するまで前
記第2のデータ処理回路の処理結果の出力を遅延する遅
延手段を備えたことを特徴とするハッシュ関数処理装置
である。
According to a sixth aspect of the present invention, the first and second input values are respectively subjected to a hash operation process.
A key processing circuit, a first data processing circuit that performs a hash operation for each predetermined data length on the processing target data using the processing data from the first key processing circuit as a first initial value, and a second data processing circuit. A second data processing circuit that performs a hash operation on output data of the first data processing circuit with processing data from the key processing circuit as a second initial value, wherein the second key processing circuit and the second 1. A hash function processing circuit comprising: processing control means for performing parallel processing with one data processing circuit, wherein a length of data to be processed input to the first data processing circuit is equal to the predetermined data length. A data conversion circuit configured to perform a hash process on the data to be processed in the first data processing circuit for each predetermined data length until the data length reaches a predetermined data length; A hash function processing apparatus characterized by processing by the configuration has a delay means for delaying the output of the processing result of the second data processing circuit until the end.

【0014】この構成によれば、処理対象データに対す
る処理単位が所定データ長を超えるような長いときに
は、第1のデータ処理にその分時間を要することとなる
が、第2のデータ処理が一定時間遅らされるので、第1
のデータ処理が終了してから第2のデータ処理が開始さ
れることとなり、適正なハッシュ値が求められる。
According to this configuration, when the processing unit for the data to be processed is longer than the predetermined data length, the first data processing takes a longer time, but the second data processing takes a certain time. Because it is delayed, the first
After the data processing is completed, the second data processing is started, and an appropriate hash value is obtained.

【0015】[0015]

【発明の実施の形態】図1は、HMAC方式のハッシュ
関数処理装置の基本処理の工程S1〜S4を示す図であ
る。図1に示す第1、第2のキー処理及び第1、第2の
データ処理は同一回路構成を有する。本実施形態では、
初期値を用いて入力値からハッシュ値を求めるMD5等
のハッシュ処理を行うハッシュ関数処理回路が採用され
ている。 (処理S1) キーデータと設定値AとからXOR(排
他的論理和)処理を行って得た第1の入力値に第1のキ
ー処理を施して第1の初期値Aoを求める。 (処理S2) 第1の初期値Aoを用いて処理対象デー
タDに第1のデータ処理を施してデータ入力値Xを求め
る。 (処理S3) キーデータと設定値BとからXOR処理
を行って得た第2の入力値に第2のキー処理を施して第
2の初期値Boを求める。 (処理S4) 第2の初期値Boを用いて第2のデータ入
力値Xに第2のデータ処理を施して値Yを得る。この値
Yがハッシュ値となる。
FIG. 1 is a diagram showing steps S1 to S4 of the basic processing of an HMAC type hash function processing apparatus. The first and second key processing and the first and second data processing shown in FIG. 1 have the same circuit configuration. In this embodiment,
A hash function processing circuit that performs hash processing such as MD5 that obtains a hash value from an input value using an initial value is employed. (Process S1) A first key value is applied to a first input value obtained by performing an XOR (exclusive OR) process on the key data and the set value A to obtain a first initial value Ao. (Process S2) First data processing is performed on the processing target data D using the first initial value Ao to obtain a data input value X. (Process S3) A second key process is performed on a second input value obtained by performing an XOR process on the key data and the set value B to obtain a second initial value Bo. (Process S4) A second data processing is performed on the second data input value X using the second initial value Bo to obtain a value Y. This value Y is a hash value.

【0016】このように、図1の工程によれば、ハッシ
ュ値を求めるのに4工程を要する。以下、本発明の各実
施形態について説明する。
As described above, according to the steps of FIG. 1, four steps are required to obtain a hash value. Hereinafter, embodiments of the present invention will be described.

【0017】(実施形態1)図2は、図1の処理をベー
スにして第1のデータ処理S2と第2のキー処理S3を
平行して行う実施形態1の処理を示している。図1から
明らかなように、第1のデータ処理S2と第2のキー処
理S3とは処理に因果関係がない。従って、以下のよう
な処理工程が採用可能である。 (処理S1) キーデータと設定値AとからXOR(排
他的論理和)処理を行って得た第1の入力値に第1のキ
ー処理を施して第1の初期値Aoを求める。 (処理S2) 第1の初期値Aoを用いて処理対象デー
タDに第1のデータ処理を施してデータ入力値Xを求め
る。同時に、キーデータと設定値BとからXOR処理を
行って得た第2の入力値に第2のキー処理を施して第2
の初期値Boを求める。 (処理S3) 第2の初期値Boを用いて第2のデータ入
力値Xに第2のデータ処理を施して値Yを得る。この値
Yがハッシュ値となる。
(Embodiment 1) FIG. 2 shows a process of Embodiment 1 in which a first data process S2 and a second key process S3 are performed in parallel based on the process of FIG. As is clear from FIG. 1, the first data processing S2 and the second key processing S3 have no causal relationship in the processing. Therefore, the following processing steps can be adopted. (Process S1) A first key value is applied to a first input value obtained by performing an XOR (exclusive OR) process on the key data and the set value A to obtain a first initial value Ao. (Process S2) First data processing is performed on the processing target data D using the first initial value Ao to obtain a data input value X. At the same time, a second key processing is performed on a second input value obtained by performing an XOR processing on the key data and the set value B, and a second
Is obtained. (Process S3) A second data processing is performed on the second data input value X using the second initial value Bo to obtain a value Y. This value Y is a hash value.

【0018】このように、図2の工程によれば、ハッシ
ュ値が3工程で求められ、処理工程を1工程分低減する
ことで、処理時間の短縮を図ることができる。かかる図
2の各処理をハッシュ関数処理回路で構成することで、
処理時間が短縮されたHMAC方式のハッシュ関数処理
装置を実現することができる。
As described above, according to the process of FIG. 2, the hash value is obtained in three processes, and the processing time can be reduced by reducing the number of processing processes by one process. By configuring each of the processes in FIG. 2 with a hash function processing circuit,
It is possible to realize a hash function processing device of the HMAC system in which the processing time is reduced.

【0019】図3は、図2に示す実施形態1の処理を実
際の回路に適用した場合のブロック図である。XOR処
理回路1はキーデータと設定値A、設定値Bとが入力側
に導かれ、キーデータと設定値Aとで、及びキーデータ
と設定値BとでXOR処理を交互に行って、第1、第2
の入力値を生成するものである。キー処理回路2はハッ
シュ関数回路からなり、交互に入力される第1、第2の
入力値にキー処理を行い、第1、第2の出力値Ao、Bo
をそれぞれ出力するものである。データ処理回路3は第
1、第2の初期値Ao、Boが交互に入力されると共に、
これらと同期して処理対象データD、処理データXが入
力され、初期値Aoを用いて処理対象データDから処理
データXを求めると共に、初期値Boを用いて処理デー
タXから処理データYを求めるものである。マルチプレ
クサ4は処理対象データDと処理データXとを交互にデ
ータ処理回路3に出力するもので、最初に処理対象デー
タDを、このときのデータ処理回路3からの出力である
処理データXを次にデータ処理回路3に再入力する。な
お、XOR処理回路1への設定値A、Bの交互入力は図
略の制御部等により行われている。
FIG. 3 is a block diagram when the processing of the first embodiment shown in FIG. 2 is applied to an actual circuit. The XOR processing circuit 1 guides the key data, the set value A, and the set value B to the input side, and performs XOR processing alternately between the key data and the set value A and between the key data and the set value B. 1st, 2nd
Is generated. The key processing circuit 2 is composed of a hash function circuit and performs key processing on the first and second input values that are input alternately, and outputs the first and second output values Ao and Bo.
Are respectively output. The data processing circuit 3 receives the first and second initial values Ao and Bo alternately,
In synchronization with these, the processing target data D and the processing data X are inputted, the processing data X is obtained from the processing target data D using the initial value Ao, and the processing data Y is obtained from the processing data X using the initial value Bo. Things. The multiplexer 4 alternately outputs the processing target data D and the processing data X to the data processing circuit 3. The multiplexer 4 first outputs the processing target data D and the processing data X output from the data processing circuit 3 at this time. To the data processing circuit 3 again. The alternate input of the set values A and B to the XOR processing circuit 1 is performed by a controller (not shown).

【0020】このブロック構成によれば、図2に示す2
回分のキー処理を1個のキー処理回路2で、かつ2回分
のデータ処理を1個のデータ処理回路3で実現し得るこ
ととなり、処理時間の短縮を可能にしながらHMAC方
式のハッシュ関数処理装置をハードウェアで構成するこ
とができる。
According to this block configuration, 2 shown in FIG.
A key processing circuit for two times can be realized by one key processing circuit 2 and a data processing for two times can be realized by one data processing circuit 3. Can be configured by hardware.

【0021】(実施形態2)図4は、図1の基本処理工
程に対し、さらに処理の高速化を実現する処理工程を説
明する図である。
(Embodiment 2) FIG. 4 is a view for explaining processing steps for realizing a higher processing speed than the basic processing steps of FIG.

【0022】図4において、Aoの記憶処理は、第1の
キー処理により得られた第1の初期値Aoを、例えばレ
ジスタ等に記憶する処理である。Boの記憶処理は、第
2のキー処理により得られた第2の初期値Boを例えば
レジスタ等に記憶する処理である。図1では、第1、第
2のキー処理をその都度実行するものであったが、本実
施形態では、第1、第2の初期値Ao、Boは処理の都度
変化する値ではないことに着目して、この初期値Ao、
Boを一旦得た後は、格納するようにしたものである。 (処理S1) キーデータと設定値AとからXOR処理
を行って得た第1の入力値に第1のキー処理を施して第
1の初期値Aoを求め、さらに、第1の初期値Aoに対し
て、Aoの記憶処理を行う。 (処理S2) 第1の初期値Aoを読み出して(あるいは
Aoの記憶処理と平行して)、処理対象データDに第1
のデータ処理を施してデータ入力値X1を求める。同時
に、キーデータと設定値BとからXOR処理を行って得
た第2の入力値に第2のキー処理を施して第2の初期値
Boを求め、第2の初期値Boに対して、Bo記憶処理を
行う。 (処理S3) 第2の初期値Boを読み出して(あるいは
Boの記憶処理と平行して)、第2のデータ入力値X1
に第2のデータ処理を施して値Y1を得る。
In FIG. 4, the storage process of Ao is a process of storing the first initial value Ao obtained by the first key process in, for example, a register. The process of storing Bo is a process of storing the second initial value Bo obtained by the second key process in, for example, a register. In FIG. 1, the first and second key processes are executed each time, but in the present embodiment, the first and second initial values Ao and Bo are not values that change each time the process is performed. Focusing on this initial value Ao,
Once Bo is obtained, it is stored. (Process S1) The first input value obtained by performing the XOR process on the key data and the set value A is subjected to a first key process to obtain a first initial value Ao, and further, a first initial value Ao is obtained. Ao is subjected to the storage processing of Ao. (Process S2) The first initial value Ao is read out (or in parallel with the storage process of Ao), and the first
To obtain the data input value X1. At the same time, the second input value obtained by performing the XOR process on the key data and the set value B is subjected to a second key process to obtain a second initial value Bo. With respect to the second initial value Bo, Perform Bo storage processing. (Process S3) The second initial value Bo is read out (or in parallel with the process of storing Bo), and the second data input value X1 is read.
Is subjected to the second data processing to obtain a value Y1.

【0023】処理S1〜S3の工程を経て1回目のサイ
クルが終了する。次いで、2サイクル目(乃至はそれ以
降のサイクル目)の処理S4〜に移行する。 (処理S4) 第1の初期値Aoを読み出して、第1の
初期値Aoから処理対象データDに第1のキー処理を施
し2サイクル目のデータ入力値X2を得る。 (処理S5) 第2の初期値Boを読み出して、第2の
初期値Boから2サイクル目のデータ入力値X2に第2
のデータ処理を施して2サイクル目の出力値とY2を得
る。
The first cycle is completed through the processes S1 to S3. Next, the processing shifts to the processing S4 to the second cycle (or subsequent cycles). (Process S4) The first initial value Ao is read, and the first key processing is performed on the processing target data D from the first initial value Ao to obtain the data input value X2 in the second cycle. (Process S5) The second initial value Bo is read out, and the second input value X2 in the second cycle is read from the second initial value Bo.
To obtain the output value of the second cycle and Y2.

【0024】処理S4〜S5の工程を経て2回目のサイ
クルを終了する。以後、キーデータの変更がなければ、
3サイクル目以降、第1、第2のデータ処理工程に代え
て、第1の初期値Ao、第2の初期値Boの読み出し処理
のみで済むこととなり、第1、第2のキー処理を省略す
ることができ、その分、処理時間の短縮化が図れる。
After the steps S4 to S5, the second cycle is completed. Thereafter, if there is no change in key data,
After the third cycle, only the first initial value Ao and the second initial value Bo need to be read out instead of the first and second data processing steps, and the first and second key processes are omitted. And the processing time can be shortened accordingly.

【0025】図5は、図4に示す実施形態2の処理を実
際の回路に適用した場合のブロック図である。図5は、
図3に示すブロック図に、比較器8、マルチプレクサ
7、スイッチ9、第1のレジスタ5及び第2のレジスタ
6を敷設したものである。
FIG. 5 is a block diagram when the processing of the second embodiment shown in FIG. 4 is applied to an actual circuit. FIG.
In the block diagram shown in FIG. 3, a comparator 8, a multiplexer 7, a switch 9, a first register 5, and a second register 6 are laid.

【0026】第1のレジスタ5は、図4のAoの記憶処
理に相当するもので、キー処理回路2で処理された第1
の初期値Aoを記憶するものである。第2のレジスタ6
は、図4のBoの記憶処理に相当するもので、キー処理
回路2で処理された第2の初期値Boを記憶するもので
ある。マルチプレクサ7は、第1のレジスタ5、第2の
レジスタ6及びキー処理回路2からの出力を選択的に切
り換えてデータ処理回路3に導くものである。
The first register 5 corresponds to the storage processing of Ao in FIG.
Is stored. Second register 6
Is equivalent to the storing process of Bo in FIG. 4 and stores the second initial value Bo processed by the key processing circuit 2. The multiplexer 7 selectively switches outputs from the first register 5, the second register 6, and the key processing circuit 2 and guides the output to the data processing circuit 3.

【0027】比較器8は、図略のメモリから読み出され
たキーデータが前回分と同一か否かを判断し、同一であ
るときは、第1、第2のレジスタ5、6の第1、第2の初
期値Ao、Boを通過させるようにマルチプレクサ7への
切り換え指示を与え、異なるときは、キー処理回路2で
求めた第1、第2の初期値を通過させるようにマルチプ
レクサ7への切り換え指示を与えるものである。スイッ
チ9はキー処理回路の出力側と第1、第2のレジスタ
5、6との接続をキーデータが前回分と異なる時のみ好
ましくは1回だけ交互に切り換えて第1、第2の初期値
Ao、Boを第1、第2のレジスタ5、6に取り込ませる
ものである。
The comparator 8 determines whether or not the key data read from the memory (not shown) is the same as the previous key data. If the key data is the same, the first of the first and second registers 5 and 6 is checked. , A switching instruction to the multiplexer 7 to pass the second initial values Ao and Bo, and when different, the multiplexer 7 to pass the first and second initial values obtained by the key processing circuit 2. Is given. The switch 9 switches the connection between the output side of the key processing circuit and the first and second registers 5 and 6 alternately, preferably only once, only when the key data is different from the previous one, so that the first and second initial values are changed. Ao and Bo are loaded into the first and second registers 5 and 6, respectively.

【0028】キー処理回路2は所定のキー処理を行うと
共に、第1、第2の初期値Ao、Boのいずれが求められ
ているかの交互を示す識別信号をスイッチ9に出力し、
第1の初期値Aoを求めているときは第1のレジスタ5
と接続させ、第2の初期値Boを求めているときは第2
のレジスタ5と接続させる。第1の初期値Aoはデータ
処理回路3による第1のデータ処理のタイミングに合わ
せて第1のレジスタ5からマルチプレクサ7を介してデ
ータ処理回路3に対し出力されるようになっている。第
2の初期値Boはデータ処理回路3による第2のデータ
処理のタイミングに合わせて第2のレジスタ6からマル
チプレクサ7を介してデータ処理回路3に出力されるよ
うになっている。
The key processing circuit 2 performs a predetermined key processing and outputs an identification signal indicating which one of the first and second initial values Ao and Bo is obtained to the switch 9 alternately.
When the first initial value Ao is obtained, the first register 5
And when the second initial value Bo is obtained, the second
Is connected to the register 5. The first initial value Ao is output from the first register 5 to the data processing circuit 3 via the multiplexer 7 at the timing of the first data processing by the data processing circuit 3. The second initial value Bo is output from the second register 6 to the data processing circuit 3 via the multiplexer 7 at the timing of the second data processing by the data processing circuit 3.

【0029】前回のキーデータに変更があれば、データ
処理回路3が第1、第2のデータ処理を行うタイミング
に合わせて、キー処理回路2の処理データをデータ処理
回路3に出力すると共にスイッチ9を介して第1、第2
のレジスタ5、6に記憶する。
If there is a change in the previous key data, the processing data of the key processing circuit 2 is output to the data processing circuit 3 at the same time that the data processing circuit 3 performs the first and second data processing, and the switch is switched. 9 through 1st, 2nd
In the registers 5 and 6.

【0030】この構成によれば、キーデータに変更がな
ければ、XOR処理は1回で済むので、第1、第2のキ
ー処理を行う必要がなくなり、その分、処理時間の短縮
化を図ることができる。
According to this configuration, if there is no change in the key data, only one XOR process is required, so that the first and second key processes need not be performed, and the processing time can be shortened accordingly. be able to.

【0031】(実施形態3)図6は、実施形態2におい
て、第1の初期値Ao、第2の初期値Boに対応して設け
られた2個のレジスタを1個に減らした場合の処理を示
す図である。図1に示すように、HAMC方式のハッシ
ュ関数の基本処理工程においては各キー処理後のデータ
は同時に使用されることはない。したがって、図4及び
図5に示すような第1のレジスタ5及び第2のレジスタ
6の2個のレジスタを設けなくても、1個のレジスタ
と、データ処理回路3に元々設けられているレジスタを
使用し、これらのレジスタ間で交互にデータの入れ替え
を行うことにより、外付けのレジスタを1個設けるだけ
で、実施形態2の処理が可能となる。従って、以下の処
理工程が採用可能である。 (処理S1) 図1の処理S1と同一処理を行う。 (処理S2) 図1の処理S2と同一処理を行う。 (処理S3) 第1の初期値Aoを用いて処理対象データ
Dに第1のデータ処理を施して1回目のデータ入力X1
を求め、同時に、データ処理回路内のレジスタにある第
1の初期値Aoをレジスタ10に出力する。 (処理S4) 第2の初期値Boを用い、1回目のデータ
入力値に第2のデータ処理を施して出力Y1を求め、デ
ータ処理回路内のレジスタとレジスタ10との間でデー
タの入れ替えを行い、第1の初期値Aoをデータ処理回
路内のレジスタに、第2の初期値Boをデータ処理回路
内のレジスタに記憶する。 (処理S5) 第1の初期値Aoを用い、処理対象データ
Dに第1のデータ処理を施して2回目の第1の入力値X
2を求め、同時に、データ処理回路内のレジスタとレジ
スタとの間でデータの入れ替えを行い、第1の初期値A
oをレジスタに移し、第2の初期値Boをデータ処理回路
内にあるレジスタに移す。 (処理S6) 第2の初期値Boを用い、2回目の第2の
データ入力値X2に第2のデータ処理を施して出力Y2
を求め、同時に、処理5と同様に、レジスタ間でデータ
の入れ替えを行い、データ処理回路内のレジスタに第1
の初期値Aoを、レジスタに第2の初期値Boを記憶す
る。
(Embodiment 3) FIG. 6 shows a process in Embodiment 2 in which the two registers provided corresponding to the first initial value Ao and the second initial value Bo are reduced to one. FIG. As shown in FIG. 1, in the basic processing step of the hash function of the HAMC method, the data after each key processing is not used at the same time. Therefore, even if the two registers of the first register 5 and the second register 6 as shown in FIGS. 4 and 5 are not provided, one register and the register originally provided in the data processing circuit 3 are provided. And the data are alternately exchanged between these registers, so that the processing of the second embodiment can be performed only by providing one external register. Therefore, the following processing steps can be adopted. (Process S1) The same process as process S1 in FIG. 1 is performed. (Process S2) The same process as process S2 in FIG. 1 is performed. (Process S3) The first data processing is performed on the processing target data D using the first initial value Ao, and the first data input X1 is performed.
And outputs the first initial value Ao in the register in the data processing circuit to the register 10 at the same time. (Process S4) Using the second initial value Bo, the second data processing is performed on the first data input value to obtain the output Y1, and the data is exchanged between the register in the data processing circuit and the register 10. Then, the first initial value Ao is stored in a register in the data processing circuit, and the second initial value Bo is stored in a register in the data processing circuit. (Process S5) A first data processing is performed on the processing target data D by using the first initial value Ao, and the second input value X
2 and at the same time, the data is exchanged between the registers in the data processing circuit to obtain the first initial value A.
o is transferred to a register, and the second initial value Bo is transferred to a register in the data processing circuit. (Processing S6) The second data input value X2 is subjected to the second data processing using the second initial value Bo and output Y2
And, at the same time, the data is exchanged between the registers as in the process 5, and the first data is stored in the register in the data processing circuit.
Is stored in the register and the second initial value Bo is stored in the register.

【0032】図6には、さらに処理工程に応じたレジス
タのデータの記憶状態が示されており、前記した処理S
3、処理S4、処理S5及び処理S6と連動してレジス
タの記憶データが変更されている。
FIG. 6 further shows the data storage state of the register according to the processing steps.
3, the data stored in the register is changed in conjunction with the processes S4, S5, and S6.

【0033】図7は、図6に示す実施形態3の処理を実
際の回路に適用した場合のブロック図である。図8は
(a)、図7の回路構成において、データ処理回路3内
にあるレジスタ31及びレジスタ10周りの回路で、
(b)はタイムチャートである。
FIG. 7 is a block diagram when the processing of the third embodiment shown in FIG. 6 is applied to an actual circuit. FIG. 8A shows circuits around the register 31 and the register 10 in the data processing circuit 3 in the circuit configuration of FIG.
(B) is a time chart.

【0034】本回路は、図5の第1、第2のレジスタ
5、6部分にレジスタ10が採用された構成である点で
相違する。レジスタ10は、その入力側がキー処理回路
2の内部レジスタ31の出力端とデータ処理回路3の初
期値出力端とに接続され、出力側がマルチプレクサ7に
接続されている。そして、データ処理回路3が第1のデ
ータ処理、第2のデータ処理を行うのに連動して、比較
器8の指示に従ってレジスタ10とデータ処理回路3の
内部レジスタ31との間でマルチプレクサ7を介して第
1、第2の初期値Ao、Boの入れ替えを行うものであ
る。すなわち、レジスタ10から第1の初期値Aoが読
み出される時は、マルチプレクサ7を介して第1の初期
値Aoが第1のデータ処理回路3の内部レジスタ31に
導かれると共に、内部レジスタ31から第2の初期値B
oが読み出されてレジスタ10に更新的に書き込まれ
る。そして、データ処理回路3で初期値Aoを利用した
データ処理が終了すると、前記とは逆に、レジスタ10
から第2の初期値Boがマルチプレクサ7を介して内部
レジスタ31に導かれると共に、内部レジスタ31から
第1の初期値Aoが読み出されてレジスタ10に更新的
に書き込まれる。
This circuit differs from the first embodiment in that a register 10 is used for the first and second registers 5 and 6 in FIG. The input side of the register 10 is connected to the output terminal of the internal register 31 of the key processing circuit 2 and the initial value output terminal of the data processing circuit 3, and the output side is connected to the multiplexer 7. Then, in conjunction with the data processing circuit 3 performing the first data processing and the second data processing, the multiplexer 7 is connected between the register 10 and the internal register 31 of the data processing circuit 3 in accordance with an instruction from the comparator 8. The first and second initial values Ao and Bo are exchanged via the CPU. That is, when the first initial value Ao is read from the register 10, the first initial value Ao is guided to the internal register 31 of the first data processing circuit 3 via the multiplexer 7 and the first initial value Ao is read from the internal register 31. Initial value B of 2
o is read and updated in the register 10. When the data processing using the initial value Ao is completed in the data processing circuit 3, the register 10
, The second initial value Bo is guided to the internal register 31 via the multiplexer 7, and the first initial value Ao is read from the internal register 31 and written in the register 10 in an updated manner.

【0035】図8(b)について説明すると、期間T1
では、 レジスタ31に第1の初期値Ao(例えば、00
00)が、レジスタ10に第2の初期値Bo(例えば、F
FFF)が記憶されている。値で、制御信号が出力され
て期間T2に移行すると、レジスタ10と内部レジスタ
31との間でデータの入れ替えが行われ、レジスタ31
に第2の初期値Boが、レジスタ10に第2の初期値Bo
が記憶される。次いで、制御信号が出力されて期間T3
に移行すると、期間T2と同様にデータの入れ替えが行
われて、レジスタ31に第2の初期値Boが、レジスタ
10に第1の初期値Aoが記憶される。
Referring to FIG. 8B, the period T1
Then, the first initial value Ao (for example, 00
00) is stored in the register 10 as a second initial value Bo (for example, F
FFF) is stored. When the control signal is output with the value and the period shifts to the period T2, the data is exchanged between the register 10 and the internal register 31, and the register 31
The second initial value Bo is stored in the register 10.
Is stored. Next, a control signal is output for a period T3.
, The data is exchanged in the same manner as in the period T2, and the register 31 stores the second initial value Bo and the register 10 stores the first initial value Ao.

【0036】このようにすることで1個のレジスタを採
用するだけで回路構成の簡素化を図りながら処理の高速
化が図れる。
In this way, the processing can be sped up while simplifying the circuit configuration only by employing one register.

【0037】(実施形態4)図9は、キーデータのデー
タ長が所定長さより長い場合の処理を行う処理を示す図
である。
(Embodiment 4) FIG. 9 is a diagram showing processing for performing processing when the data length of key data is longer than a predetermined length.

【0038】HMAC方式のハッシュ関数処理装置にお
いて、キーデータのデータ長が512ビットを超える場
合、この原キーデータを512ビット毎に分割し、分割
キーデータK1、分割キーデータK2、...の各デー
タに対しハッシュ処理を施して、最終的なキーデータK
oを生成する前段処理が必要となる。この前段処理は、
実施形態1に比して原キーデータの分割数分に応じて余
分に時間を要することとなり、図略の制御部などからの
処理指令信号などに応じて通常の処理タイミングで第1
のデータ処理を開始してしまうと、キーデータKoに基
づいて生成される適正な第1の初期値Aoを利用しての
ハッシュ処理を実行することができず、この結果、適正
なハッシュ値Yを得ることができない。このため、本実
施形態では、キーデータKoが生成され、適正な第1の
初期値Aoが得られるまで第1のデータ処理を遅延する
処理を付設している。かかる処理について説明する。
(処理S1) 例えば1024ビットの原キーデータK
の場合、512ビット毎に分割し、分割キーデータK
1、K2とする。分割キーデータK1に第1のハッシュ
処理を施し、第1のハッシュ値K11を求める。分割キ
ーデータK2を用い第1のハッシュ値K11に第2のハ
ッシュ処理を施し第2のハッシュ値K21を得る。第2
のハッシュ値K21は128ビットであるが、キーデー
タとしては512ビットを要するため、第2のハッシュ
値K21に対し、所要ビット分の“0”を付加して、5
12ビットとする「0」パッティング処理を施し、51
2ビットのキーデータKoを生成する。 (処理S2) キーデータKoと設定値AとからXOR処
理を行って得た第1の入力値に第1のキー処理を施し、
第1の初期値Aoを求める。 (処理S3) 生成キーデータKoと設定値BとからXO
R処理を行って得た第2の入力値に第2のキー処理を施
し、第2の初期値Boを求める。 (処理S4) 少なくとも第1のキー処理の終了を待っ
てから(Wait)、第1の入力値Aoを用いて処理対
象データDに第1のキー処理を施し、データ入力値Xを
得る。 (処理S5) 第2の初期値Boを用いてデータ入力値X
に第2のデータ処理を施し、出力Yを得る。この値Yが
ハッシュ値となる。
In the HMAC hash function processing apparatus, when the data length of the key data exceeds 512 bits, the original key data is divided every 512 bits and divided key data K1, divided key data K2,. . . Is subjected to hash processing to obtain the final key data K
Pre-processing to generate o is required. This pre-processing is
Extra time is required in accordance with the number of divisions of the original key data as compared with the first embodiment, and the first processing is performed at normal processing timing in accordance with a processing command signal from a control unit (not shown) or the like.
, The hash processing using the proper first initial value Ao generated based on the key data Ko cannot be performed. As a result, the proper hash value Y Can not get. For this reason, in the present embodiment, processing for delaying the first data processing until key data Ko is generated and an appropriate first initial value Ao is obtained is added. This processing will be described.
(Process S1) For example, 1024-bit original key data K
In the case of, the key data K is divided every 512 bits.
1, K2. A first hash process is performed on the divided key data K1 to obtain a first hash value K11. A second hash process is performed on the first hash value K11 using the divided key data K2 to obtain a second hash value K21. Second
The hash value K21 of is 128 bits, but requires 512 bits as key data. Therefore, “0” for the required bits is added to the second hash value K21 to obtain 5 bits.
A “0” putting process of 12 bits is performed and 51
Generate 2-bit key data Ko. (Process S2) A first key process is performed on a first input value obtained by performing an XOR process on the key data Ko and the set value A,
A first initial value Ao is obtained. (Process S3) XO from the generated key data Ko and the set value B
A second key process is performed on the second input value obtained by performing the R process to obtain a second initial value Bo. (Process S4) After at least waiting for the end of the first key processing (Wait), the first key processing is performed on the processing target data D using the first input value Ao to obtain the data input value X. (Process S5) Data input value X using second initial value Bo
Is subjected to the second data processing to obtain an output Y. This value Y is a hash value.

【0039】このように、図9に示す工程によれば、第
1のキー処理の終了を待ってから、第1のデータ処理を
行うため、適正なハッシュ値を求めることができる。
As described above, according to the process shown in FIG. 9, since the first data processing is performed after the end of the first key processing, an appropriate hash value can be obtained.

【0040】図10は、図9に示す処理工程を実際の回
路に実現したときの回路図である。この回路は、XOR
処理回路1、キー処理回路2、データ処理回路3、マル
チプレクサ4、検知器11、マルチプレクサ12、及び
「0」パッティング処理回路13からなる。
FIG. 10 is a circuit diagram when the processing steps shown in FIG. 9 are realized in an actual circuit. This circuit is
It comprises a processing circuit 1, a key processing circuit 2, a data processing circuit 3, a multiplexer 4, a detector 11, a multiplexer 12, and a "0" putting processing circuit 13.

【0041】キー処理回路2はハッシュ関数回路からな
り、分割キーデータK1、K2を用いてハッシュ処理を
行うと共に、各排他的論理和処理から得られる第1、第
2の入力値を用いてハッシュ処理を行うものである。キ
ー処理回路2は分割キーデータK1が入力されるとき
は、第1のハッシュ処理を施して得られた第1のハッシ
ュ値K12をフィードバックし、該値K12を用いて、
分割キーデータK2に第2のハッシュ処理を施し、第2
のハッシュ値K21を求める。また、キー処理回路2は
第1、第2の入力値が入力されるときは、第1、第2の
キー処理を行い、第1、第2の初期値Ao、Boを求め
る。データ処理回路3は、図3のデータ処理回路3と同
様の機能を有することに加え、検知器11からの遅延指
示に従い、第1のキー処理の終了を待ってから第1のデ
ータ処理を行うように構成されている。
The key processing circuit 2 is composed of a hash function circuit, performs hash processing using the divided key data K1 and K2, and performs hash processing using the first and second input values obtained from each exclusive OR processing. The processing is performed. When the divided key data K1 is input, the key processing circuit 2 feeds back a first hash value K12 obtained by performing the first hash processing, and uses the value K12 to
A second hash process is performed on the divided key data K2,
Is obtained. When the first and second input values are input, the key processing circuit 2 performs first and second key processing to determine first and second initial values Ao and Bo. The data processing circuit 3 has the same function as the data processing circuit 3 of FIG. 3, and performs the first data processing after the completion of the first key processing in accordance with the delay instruction from the detector 11. It is configured as follows.

【0042】検知器11は、キー処理回路2の動作を監
視するもので、第1の初期値Aoが得られたか否かを検
知し、得られたことを検知すると、データ処理回路3に
対するウエイト信号の送出を解除するもので、これによ
りデータ処理回路3に第1のデータ処理の開始を指示す
るものである。マルチプレクサ12は、分割キーデータ
K1、K2と、第1、第2の入力値とを交互にキー処理
回路2に出力するもので、分割キーデータK1、分割キ
ーデータK2、第1の入力値、第2の入力値の順でキー
処理回路2へ出力する。「0」パッティング処理回路13
は、128ビットの第2のキーデータK12に対し、上
位乃至は下位の所定ビット位置に「0」を付け加えるもの
である。
The detector 11 monitors the operation of the key processing circuit 2 and detects whether or not the first initial value Ao has been obtained. The transmission of the signal is canceled, thereby instructing the data processing circuit 3 to start the first data processing. The multiplexer 12 alternately outputs the divided key data K1, K2 and the first and second input values to the key processing circuit 2, and outputs the divided key data K1, the divided key data K2, the first input value, Output to the key processing circuit 2 in the order of the second input value. "0" putting processing circuit 13
Is to add “0” to the upper or lower predetermined bit position with respect to the 128-bit second key data K12.

【0043】このブロック構成によれば、キーデータK
が512ビットを超える長いデータ長を有する場合であ
っても、データ処理回路3の第1のデータ処理をキー処
理回路2の第2のキー処理が終了するまで待つようにし
たため、適正なハッシュ値を得ることができる。
According to this block configuration, the key data K
Has a long data length of more than 512 bits, the first data processing of the data processing circuit 3 is waited until the second key processing of the key processing circuit 2 is completed. Can be obtained.

【0044】(実施形態5)図11は、処理対象データD
のデータ量が大きく例えば512ビットを超えるとき、
第2のデータ処理を待たせ、適正なハッシュ値を得るこ
とのできる実施態様5の処理を示している。
(Embodiment 5) FIG.
Is large and exceeds, for example, 512 bits,
The process according to the fifth embodiment, in which an appropriate hash value can be obtained by waiting the second data process, is shown.

【0045】処理対象データDのデータ長が大きく51
2ビットを超えるような場合、データ処理回路は、入力
値として512ビット以上のデータを1度に処理するこ
とができないため、処理対象データDを512ビット毎
に分割し、各分割データに対し複数のデータ処理を行う
必要がある。これらの工程を経て、データ入力値X1が
求まり、第2のデータ処理の入力値を得ることができ、
第2のデータ処理を行うことができる。しかし、第1の
データ処理が終了する前に、第2のデータ処理を行う
と、適正なハッシュ値を得ることができない。
The data length of the processing target data D is large 51
In the case of exceeding 2 bits, the data processing circuit cannot process data of 512 bits or more as an input value at a time, and therefore, divides the processing target data D into 512 bits, and Must be processed. Through these steps, the data input value X1 is obtained, and the input value of the second data processing can be obtained.
A second data processing can be performed. However, if the second data processing is performed before the end of the first data processing, an appropriate hash value cannot be obtained.

【0046】そこで、以下の処理工程を行う。Therefore, the following processing steps are performed.

【0047】(処理S1) 図1の基本処理の処理S1
と同一の処理を行う。
(Process S1) Process S1 of the basic process of FIG.
Perform the same processing as.

【0048】(処理S2) 図1の基本処理の処理S2と
同一の処理を行う。
(Process S2) The same process as the process S2 of the basic process in FIG. 1 is performed.

【0049】(処理S3) 例えば1024ビットの処理
対象データDを、512ビット毎に分割し、分割処理対
象データD1、D2とし、第1の初期値Aoを用い分割
処理対象データD1に第1のデータ処理を施し第1のデ
ータ処理値D12を得る。
(Processing S3) For example, the 1024-bit data D to be processed is divided into 512-bit data to be divided data D1 and D2, and the first data D1 is divided into the first data D1 using the first initial value Ao. Data processing is performed to obtain a first data processing value D12.

【0050】(処理S4) 第1の処理値D12を用い分
割処理対象データD2に第1のデータ処理を施しデータ
入力値Xを得る。
(Processing S4) The first processing value D12 is used to perform first data processing on the division target data D2 to obtain a data input value X.

【0051】(処理S5) 第1のデータ処理の終了を待
ってから、第2の初期値Boを用いデータ入力値Xに第
2のデータ処理を施し出力Yを求める。
(Process S5) After waiting for the end of the first data processing, the data input value X is subjected to the second data processing using the second initial value Bo to obtain the output Y.

【0052】このように、第1のデータ処理の終了を待
ってから、第2のデータ処理を行うことにより、適正な
ハッシュ値を求めることができる。
As described above, an appropriate hash value can be obtained by performing the second data processing after the completion of the first data processing.

【0053】図12は、図11の処理工程を実際の回路
に適用したときの回路図である。この回路は、XOR処
理回路1、マルチプレクサ4、検知器11は、図10の
対応する各回路ブロックと、キー処理回路2は、図3の
対応する回路ブロックと同一の機能を有するので説明を
省略する。
FIG. 12 is a circuit diagram when the processing steps of FIG. 11 are applied to an actual circuit. In this circuit, the XOR processing circuit 1, multiplexer 4, and detector 11 have the same functions as the corresponding circuit blocks in FIG. 10 and the key processing circuit 2 has the same functions as the corresponding circuit blocks in FIG. I do.

【0054】データ処理回路3は、ハッシュ処理回路か
らなり、分割処理データD1、D2の各々に対し第1の
データ処理を施し、データ入力値Xを求め、更に、マル
チプレクサ13から出力される第2の初期値Boを用
い、フィードバックしてマルチプレクサ4を介して入力
されたデータ入力値Xに、第2のデータ処理を施し、出
力値Yを得るものである。また、データ処理回路3は、
検知器11の指示に従い、第1のデータ処理が終了して
から第2のデータ処理を行う。このため、適正なハッシ
ュ値Yを得ることができる。
The data processing circuit 3 comprises a hash processing circuit, performs first data processing on each of the divided data D1 and D2, obtains a data input value X, and further outputs a second data output from the multiplexer 13. The second data processing is performed on the data input value X input via the multiplexer 4 by feedback using the initial value Bo of the above, and an output value Y is obtained. Further, the data processing circuit 3
According to the instruction of the detector 11, the second data processing is performed after the first data processing is completed. Therefore, an appropriate hash value Y can be obtained.

【0055】マルチプレクサ13は、データ処理回路3
のデータ処理のタイミングに連動して適正なデータをデ
ータ処理回路3へ出力するものである。すなわち、デー
タ処理回路3が、第1のデータ処理を行うときは第1の
処理値D12または、第1の初期値Aoを、第2のデー
タ処理を行うときは、第2の初期値Boをデータ処理回
路3へ出力する。
The multiplexer 13 is a data processing circuit 3
The appropriate data is output to the data processing circuit 3 in synchronization with the timing of the data processing. That is, when the data processing circuit 3 performs the first data processing, the first processing value D12 or the first initial value Ao is used. When the data processing circuit 3 performs the second data processing, the second processing value D12 is used. Output to the data processing circuit 3.

【0056】この構成により、第2のデータ処理を第1
のデータ処理の終了待ってから処理を開始することが可
能となり、適正なハッシュ値を得ることができる。
According to this configuration, the second data processing is performed by the first data processing.
It is possible to start the process after waiting for the end of the data process, and to obtain an appropriate hash value.

【0057】(実施形態6)図13は、実施形態5の処理
工程の手順を少し変化を加え、実施形態5と同一の効果
を得ることのできる実施形態6の処理を示している。第
2のデータ処理は、第2のキー処理が終了しなければ処
理を開始しないため、第2のキー処理を、処理対象デー
タD2の第1のデータ処理の開始と同時に始め、第2の
データ処理を遅らせることにより、処理対象データDの
データ量が大きい場合であっても、実施形態5と同様、
適正なハッシュ値を求めることができる。
(Embodiment 6) FIG. 13 shows a process of Embodiment 6 in which the same effects as those of Embodiment 5 can be obtained by slightly changing the procedure of the processing steps of Embodiment 5. Since the second data processing does not start unless the second key processing is completed, the second key processing is started simultaneously with the start of the first data processing of the processing target data D2, and the second data processing is started. By delaying the processing, even when the data amount of the processing target data D is large, similar to the fifth embodiment,
An appropriate hash value can be obtained.

【0058】(処理S1) 実施形態5の処理S1と同一
処理を行う。
(Process S1) The same process as process S1 of the fifth embodiment is performed.

【0059】(処理S2) 実施形態5の処理S2と同一
処理を行うが、処理S4と同時に実行する。このため、
データ入力値Xと第2の初期値Boのデータ処理回路へ
の入力の同期を図かることができ、適正なハッシュ値を
得ることができる。
(Process S2) The same process as process S2 of the fifth embodiment is performed, but is performed simultaneously with process S4. For this reason,
The input of the data input value X and the second initial value Bo to the data processing circuit can be synchronized, and an appropriate hash value can be obtained.

【0060】(処理S3) 実施形態5の処理S3と同一
処理を行う。
(Process S3) The same process as process S3 of the fifth embodiment is performed.

【0061】(処理S4) 実施形態5の処理S4と同一
処理を行う。
(Process S4) The same process as process S4 of the fifth embodiment is performed.

【0062】(処理S5) 実施形態5の処理S5と同一
処理を行う。
(Process S5) The same process as process S5 of the fifth embodiment is performed.

【0063】この構成によっても、処理対象データのデ
ータ量が多き実施形態5と同様、適正なハッシュ値を求
めることができる。
According to this configuration, an appropriate hash value can be obtained as in the case of the fifth embodiment in which the data amount of the data to be processed is large.

【0064】[0064]

【発明の効果】請求項1の発明によれば、HMAC方式
のハッシュ関数処理装置において処理工程をオーバーラ
ップさせることにより処理段数を減らし、ハッシュ処理
の高速化が実現できる。請求項2の発明によれば、回路
構成が簡素化できる。
According to the first aspect of the present invention, the number of processing stages can be reduced by overlapping the processing steps in the HMAC type hash function processing apparatus, and the hash processing can be speeded up. According to the invention of claim 2, the circuit configuration can be simplified.

【0065】請求項3の発明によれば、2個のレジスタ
を用いることでハッシュ処理の高速化を図ることができ
る。また、請求項4の発明によれば、レジスタ1個にし
て回路の簡素化を実現することができる。
According to the third aspect of the invention, the speed of the hash processing can be increased by using two registers. Further, according to the invention of claim 4, simplification of the circuit can be realized with one register.

【0066】請求項5、6の発明によれば、所定の遅延
処理を施すことで、適正なハッシュ値を求めることがで
きる。
According to the fifth and sixth aspects of the present invention, an appropriate hash value can be obtained by performing a predetermined delay process.

【図面の簡単な説明】[Brief description of the drawings]

【図1】HAMC方式のハッシュ関数処理装置の基本処
理図である。
FIG. 1 is a basic processing diagram of a hash function processing device of the HAMC system.

【図2】実施形態1の処理工程図である。FIG. 2 is a process chart of the first embodiment.

【図3】実施形態1の回路ブロック図である。FIG. 3 is a circuit block diagram of the first embodiment.

【図4】実施形態2の処理工程図である。FIG. 4 is a process chart of a second embodiment.

【図5】実施形態2の回路ブロック図である。FIG. 5 is a circuit block diagram according to a second embodiment.

【図6】実施形態3の処理工程図である。FIG. 6 is a process chart of a third embodiment.

【図7】実施形態3の回路ブロック図である。FIG. 7 is a circuit block diagram of a third embodiment.

【図8】実施形態3のデータ処理回路内のレジスタ31
とレジスタ10との関係を示した図である。
FIG. 8 shows a register 31 in the data processing circuit according to the third embodiment.
FIG. 2 is a diagram showing a relationship between the register and a register.

【図9】実施形態4の処理工程図である。FIG. 9 is a process chart of a fourth embodiment.

【図10】実施形態4の回路ブロック図である。FIG. 10 is a circuit block diagram of a fourth embodiment.

【図11】実施形態5の処理工程図である。FIG. 11 is a process chart of a fifth embodiment.

【図12】実施形態5の回路ブロック図である。FIG. 12 is a circuit block diagram according to a fifth embodiment.

【図13】実施形態6の処理工程図である。FIG. 13 is a process chart of a sixth embodiment.

【符号の説明】[Explanation of symbols]

1 XOR処理回路 2 キー処理回路 3 データ処理回路 4 7 12 13 マルチプレクサ 5 6 10 レジスタ 8 比較器 9 スイッチ 11 検知器 31 内部レジスタ DESCRIPTION OF SYMBOLS 1 XOR processing circuit 2 Key processing circuit 3 Data processing circuit 4 7 12 13 Multiplexer 5 6 10 Register 8 Comparator 9 Switch 11 Detector 31 Internal register

───────────────────────────────────────────────────── フロントページの続き (72)発明者 増田 達男 大阪府門真市大字門真1048番地 松下電工 株式会社内 (72)発明者 上柳 秀樹 大阪府門真市大字門真1048番地 松下電工 株式会社内 (72)発明者 宮崎 靖一 大阪府門真市大字門真1048番地 松下電工 株式会社内 (72)発明者 中谷 浩茂 大阪府門真市大字門真1048番地 松下電工 株式会社内 Fターム(参考) 5B056 AA05 BB11 HH01 5J104 AA18 NA12 NA22  ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Tatsuo Masuda 1048 Kadoma Kadoma, Osaka Pref.Matsushita Electric Works, Ltd. ) Inventor: Miyazaki, Keiichi 1048, Kadoma, Kadoma, Osaka, Japan Matsushita Electric Works, Ltd. AA18 NA12 NA22

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 第1、第2の入力値に対してそれぞれハ
ッシュ演算処理を行う第1、第2のキー処理回路と、前
記第1のキー処理回路からの処理データを第1の初期値
として処理対象データにハッシュ演算処理を行う第1の
データ処理回路と、前記第2のキー処理回路からの処理
データを第2の初期値として前記第1のデータ処理回路
の出力データにハッシュ演算処理を行う第2のデータ処
理回路とを備え、前記第2のキー処理回路と前記第1の
データ処理回路とを並列処理させるようにしたハッシュ
関数処理回路。
A first key processing circuit for performing a hash operation on each of the first and second input values, and processing data from the first key processing circuit as a first initial value. A first data processing circuit for performing a hash operation on data to be processed, and a hash operation on output data of the first data processing circuit using the processing data from the second key processing circuit as a second initial value. And a second data processing circuit that performs the following, and the second key processing circuit and the first data processing circuit are processed in parallel.
【請求項2】 前記第1、第2のキー処理回路を共有す
ると共に、前記第1、第2のデータ処理回路を共有し、
前記第1、第2の入力値を順番に共有したキー処理回路
に導くと共に、前記第1の入力値に対して行われたキー
処理の結果を第1の初期値として行われる前記共有した
データ処理回路の結果を処理対象データとして、このデ
ータ処理回路に再入力する構成としたことを特徴とする
請求項1記載のハッシュ関数処理回路。
2. The first and second key processing circuits are shared, and the first and second data processing circuits are shared.
The first and second input values are sequentially led to a shared key processing circuit, and the result of the key processing performed on the first input value is used as a first initial value. 2. The hash function processing circuit according to claim 1, wherein a result of the processing circuit is re-input to the data processing circuit as data to be processed.
【請求項3】 第1、第2のキーデータに対応させて第
1、第2の設定値との間で論理演算を行って第1、第2
の入力値を得る第1、第2の排他的論理和回路と、第
1、第2の入力値に対してそれぞれハッシュ演算処理を
行う第1、第2のキー処理回路と、前記第1のキー処理
回路からの処理データを第1の初期値として処理対象デ
ータにハッシュ演算処理を行う第1のデータ処理回路
と、前記第2のキー処理回路からの処理データを第2の
初期値として前記第1のデータ処理回路の出力データに
ハッシュ演算処理を行う第2のデータ処理回路とを有す
るハッシュ関数処理装置であって、データを記憶可能な
第1、第2のレジスタと、前記第1、第2の初期値をそ
れぞれ第1、第2のレジスタに記憶させる記憶処理手段
と、第1、第2のデータ処理動作に対応させて前記第
1、第2のレジスタから前記第1、第2の初期値を出力
するスイッチ手段とを備えたことを特徴とするハッシュ
関数処理装置。
3. A logical operation is performed between first and second set values corresponding to first and second key data to perform first and second key data.
First and second exclusive OR circuits for obtaining input values of the first and second input processing values, first and second key processing circuits for performing hash calculation processing on the first and second input values, respectively, A first data processing circuit that performs a hash operation on data to be processed using the processing data from the key processing circuit as a first initial value; and a processing data from the second key processing circuit as a second initial value. A hash function processing device comprising: a second data processing circuit that performs a hash operation on output data of a first data processing circuit, wherein the first and second registers are capable of storing data; Storage processing means for storing a second initial value in first and second registers, respectively; and storing the first and second registers from the first and second registers in correspondence with first and second data processing operations. Switch means for outputting the initial value of Hash function processing apparatus characterized by a.
【請求項4】 前記第1、第2のデータ処理回路は第
1、第2の初期値をそれぞれ一時的に格納するメモリ部
を有し、さらに前記第1、第2のレジスタを共有し、前
記スイッチ手段は、前記第1、第2のデータ処理回路の
動作に同期して前記共有するレジスタの内容を前記メモ
リ部との間で交互に入れ替えるものであることを特徴と
する請求項3記載のハッシュ関数処理装置。
4. The first and second data processing circuits have a memory section for temporarily storing first and second initial values, respectively, and further share the first and second registers. 4. The switching unit according to claim 3, wherein the contents of the shared register are alternately exchanged with the memory unit in synchronization with an operation of the first and second data processing circuits. Hash function processing device.
【請求項5】 第1、第2のキーデータに対応させて第
1、第2の設定値との間で論理演算を行って第1、第2
の入力値を得る第1、第2の排他的論理和回路と、第
1、第2の入力値に対してそれぞれ所定データ長毎にハ
ッシュ演算処理を行う第1、第2のキー処理回路と、前
記第1のキー処理回路からの処理データを第1の初期値
として所定データ長毎の処理対象データにハッシュ演算
処理を行う第1のデータ処理回路と、前記第2のキー処
理回路からの処理データを第2の初期値として前記第1
のデータ処理回路の出力データにハッシュ演算処理を行
う第2のデータ処理回路とを備え、前記第1、第2のデ
ータ処理回路による処理を所定周期で行わせると共に、
前記第2のキー処理回路と前記第1のデータ処理回路と
を並列処理する処理制御手段を備えたことを特徴とする
ハッシュ関数処理回路であって、前記第1、第2のキー
データを共通にすると共に、前記共通するキーデータの
データ長が前記所定データ長を超えるとき、前記所定デ
ータ長のキーデータを作成する前段回路を備え、前記処
理制御手段は、前記前段回路による処理が終了するまで
前記第1のデータ処理回路の処理の開始を遅延する遅延
手段を備えたことを特徴とするハッシュ関数処理装置。
5. A method according to claim 1, wherein a logical operation is performed between the first and second set values in correspondence with the first and second key data.
First and second exclusive OR circuits for obtaining input values of the first and second key processing circuits; and first and second key processing circuits for performing a hash operation on the first and second input values for each predetermined data length. A first data processing circuit for performing a hash operation on data to be processed for each predetermined data length using the processing data from the first key processing circuit as a first initial value; The processing data is set as the second initial value and the first
A second data processing circuit that performs a hash operation on output data of the data processing circuit, and performs processing by the first and second data processing circuits at a predetermined cycle.
A hash function processing circuit comprising processing control means for performing parallel processing of the second key processing circuit and the first data processing circuit, wherein the first and second key data are shared. When the data length of the common key data exceeds the predetermined data length, a pre-stage circuit for generating key data of the predetermined data length is provided, and the processing control means terminates the processing by the pre-stage circuit. A hash function processing device comprising: delay means for delaying the start of processing of the first data processing circuit until the first time.
【請求項6】 第1、第2の入力値に対してそれぞれハ
ッシュ演算処理を行う第1、第2のキー処理回路と、前
記第1のキー処理回路からの処理データを第1の初期値
として処理対象データに所定データ長毎のハッシュ演算
処理を行う第1のデータ処理回路と、前記第2のキー処
理回路からの処理データを第2の初期値として前記第1
のデータ処理回路の出力データにハッシュ演算処理を行
う第2のデータ処理回路とを備え、前記第2のキー処理
回路と前記第1のデータ処理回路とを並列処理する処理
制御手段を備えたことを特徴とするハッシュ関数処理回
路であって、前記第1のデータ処理回路に入力される処
理対象データ長が前記所定データ長を超えるとき、前記
処理対象データを所定データ長毎に前記第1のデータ処
理回路で所定データ長になるまでハッシュ処理する変換
回路構成を有し、前記処理制御手段は、前記変換回路構
成による処理が終了するまで前記第2のデータ処理回路
の処理結果の出力を遅延する遅延手段を備えたことを特
徴とするハッシュ関数処理装置。
6. A first and a second key processing circuit for performing a hash operation on first and second input values, respectively, and processing data from the first key processing circuit as a first initial value. A first data processing circuit for performing a hash operation on the data to be processed for each predetermined data length, and processing data from the second key processing circuit as a second initial value.
A second data processing circuit for performing a hash operation on output data of the data processing circuit, and a processing control means for performing parallel processing of the second key processing circuit and the first data processing circuit. A hash function processing circuit, wherein when the processing target data length input to the first data processing circuit exceeds the predetermined data length, the processing target data is divided by the first data processing length for each predetermined data length. The data processing circuit has a conversion circuit configuration for performing hash processing until a predetermined data length is reached, and the processing control means delays the output of the processing result of the second data processing circuit until the processing by the conversion circuit configuration ends. A hash function processing device, comprising:
JP2000360211A 2000-11-27 2000-11-27 Hash function processor Withdrawn JP2002162904A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000360211A JP2002162904A (en) 2000-11-27 2000-11-27 Hash function processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000360211A JP2002162904A (en) 2000-11-27 2000-11-27 Hash function processor

Publications (1)

Publication Number Publication Date
JP2002162904A true JP2002162904A (en) 2002-06-07

Family

ID=18831845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000360211A Withdrawn JP2002162904A (en) 2000-11-27 2000-11-27 Hash function processor

Country Status (1)

Country Link
JP (1) JP2002162904A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100656375B1 (en) 2005-12-10 2006-12-11 한국전자통신연구원 Low power hash function encryption device
WO2009073365A2 (en) * 2007-12-03 2009-06-11 Intel Corporation Method and apparatus for generic multi-stage nested hash processing
US8578172B2 (en) 2010-06-04 2013-11-05 Kabushiki Kaisha Toshiba Information processing device for obtaining an HMAC
US8930431B2 (en) 2010-12-15 2015-01-06 International Business Machines Corporation Parallel computation of a remainder by division of a sequence of bytes

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100656375B1 (en) 2005-12-10 2006-12-11 한국전자통신연구원 Low power hash function encryption device
WO2009073365A2 (en) * 2007-12-03 2009-06-11 Intel Corporation Method and apparatus for generic multi-stage nested hash processing
WO2009073365A3 (en) * 2007-12-03 2009-07-23 Intel Corp Method and apparatus for generic multi-stage nested hash processing
US8363827B2 (en) 2007-12-03 2013-01-29 Intel Corporation Method and apparatus for generic multi-stage nested hash processing
US8578172B2 (en) 2010-06-04 2013-11-05 Kabushiki Kaisha Toshiba Information processing device for obtaining an HMAC
US8848907B2 (en) 2010-06-04 2014-09-30 Kabushiki Kaisha Toshiba Computer program product and method for processing information to obtain an HMAC
US8930431B2 (en) 2010-12-15 2015-01-06 International Business Machines Corporation Parallel computation of a remainder by division of a sequence of bytes
US8935310B2 (en) 2010-12-15 2015-01-13 International Business Machines Corporation Parallel computation of a remainder by division of a sequence of bytes
US9405509B2 (en) 2010-12-15 2016-08-02 International Business Machines Corporation Parallel computation of a remainder by division of a sequence of bytes

Similar Documents

Publication Publication Date Title
US7249255B2 (en) Apparatus and method for a hash processing system using multiple hash storage areas
JP4127472B2 (en) Data conversion apparatus, data conversion method and program for data conversion apparatus, and computer-readable recording medium
US20020191792A1 (en) Apparatus and method for a hash processing system using integrated message digest and secure hash architectures
US20020032551A1 (en) Systems and methods for implementing hash algorithms
EP3531613B1 (en) Method and circuit for implementing a substitution table
US7403615B2 (en) Methods and apparatus for accelerating ARC4 processing
CN113504894B (en) Random number generator, method for generating pseudo-random number and chip
JP2002162904A (en) Hash function processor
EP3889764A1 (en) Parallel generation of a random matrix
US7769166B2 (en) Dual mode AES implementation to support single and multiple AES operations
KR100478974B1 (en) Serial finite-field multiplier
CN110034918B (en) SM4 acceleration method and device
JP5500923B2 (en) Information processing device
JP2003098959A (en) Cryptograph processing device
KR101126776B1 (en) Packet cipher algorithm based encryption processing device
EP3531612B1 (en) Method and device for performing substitution table operations
KR100446533B1 (en) Apparatus and method for ciphering in mobile communication system
JP2002297030A (en) Device and method for ciphering processing and program
TWI819516B (en) Processing method and circuit of the hash message authentication codes based key derivation function
TWI775467B (en) Machine learning model file decryption method and user device
TWI785952B (en) Cipher accelerator and differential fault analysis method for encryption and decryption operations
US20050047592A1 (en) Single-round enciphering apparatus and method using a reduced number of elements in a mobile communication system
US20240119158A1 (en) Boot Verification Method and Related Apparatus
JP2002162902A (en) Hash function processor
US10547447B2 (en) Collaborative computation of HMAC

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080205