[go: up one dir, main page]

JP2010044251A - Hash value generator, program and hash value generation method - Google Patents

Hash value generator, program and hash value generation method Download PDF

Info

Publication number
JP2010044251A
JP2010044251A JP2008208635A JP2008208635A JP2010044251A JP 2010044251 A JP2010044251 A JP 2010044251A JP 2008208635 A JP2008208635 A JP 2008208635A JP 2008208635 A JP2008208635 A JP 2008208635A JP 2010044251 A JP2010044251 A JP 2010044251A
Authority
JP
Japan
Prior art keywords
round
value
hash value
function
message
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.)
Pending
Application number
JP2008208635A
Other languages
Japanese (ja)
Inventor
Kota Ideguchi
恒太 井手口
Hirotaka Yoshida
博隆 吉田
Toru Owada
徹 大和田
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008208635A priority Critical patent/JP2010044251A/en
Priority to US12/393,227 priority patent/US20100040226A1/en
Publication of JP2010044251A publication Critical patent/JP2010044251A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic 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/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/20Manipulating the length of blocks of bits, e.g. padding or block truncation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/24Key scheduling, i.e. generating round keys or sub-keys for block encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

【課題】 安全性の評価が可能なハッシュ関数を提供すること。
【解決手段】 入力されたメッセージをメッセージブロック化部122で、複数のメッセージブロックに分割し、ラウンド定数生成部123で生成されたラウンド定数を用いて、第一ラウンド鍵生成部124又は第二ラウンド鍵生成部125で生成されたラウンド鍵を用いて、撹拌部126において、メッセージブロック毎にブロック暗号を用いて撹拌を行う。ブロック暗号においては、メッセージブロックを分割した複数の分割データのうちの特定の分割データをF関数により変換を行い、他の特定の分割データとの排他的論理和を算出する。F関数においては、少なくとも非線形変換を含む変換を複数回行う。
【選択図】図1
PROBLEM TO BE SOLVED: To provide a hash function capable of evaluating safety.
A message blocking unit 122 divides an input message into a plurality of message blocks, and uses a round constant generated by a round constant generating unit 123 to use a first round key generating unit 124 or a second round. Using the round key generated by the key generation unit 125, the stirring unit 126 performs stirring using a block cipher for each message block. In the block cipher, specific divided data among a plurality of divided data obtained by dividing a message block is converted by the F function, and an exclusive OR with other specific divided data is calculated. In the F function, conversion including at least nonlinear conversion is performed a plurality of times.
[Selection] Figure 1

Description

本発明は、ハッシュ値を生成する技術に関する。   The present invention relates to a technique for generating a hash value.

ハッシュ関数は、任意長のメッセージを入力として、特定の長さのハッシュ値を生成する関数である。   The hash function is a function that generates a hash value having a specific length by inputting an arbitrary length message.

一般的に、ハッシュ関数は固定長のメッセージブロックを入力するブロック暗号から構成され、入力されたメッセージに対してブロック暗号化を繰り返し行うことで、メッセージの攪拌を行い、最終的にハッシュ値として出力する。ハッシュ関数の代表例としてはSHA−1、または、SHA−256等のSHA−2ハッシュ族、などがある(非特許文献1参照)。   Generally, a hash function consists of a block cipher that inputs a fixed-length message block. By repeatedly performing block encryption on the input message, the message is agitated and finally output as a hash value. To do. Typical examples of the hash function include SHA-1 or SHA-2 hash family such as SHA-256 (see Non-Patent Document 1).

NIST FIPS 180-2, ”Secure Hash Standard”, 2002 August 1, pp. 9-23, http://csrc.nist.gov/publications /fips/fips180-2/fips180-2.pdfNIST FIPS 180-2, “Secure Hash Standard”, 2002 August 1, pp. 9-23, http://csrc.nist.gov/publications /fips/fips180-2/fips180-2.pdf

非特許文献1に記載のSHA−1は、ハッシュ関数が持つべき安全性である衝突耐性に問題があることが知られており、SHA−2ハッシュ族についても、SHA−1と類似した構造であることから、ハッシュ関数が持つべき安全性に問題を生ずる可能性がある。   SHA-1 described in Non-Patent Document 1 is known to have a problem in collision resistance, which is a security that the hash function should have, and the SHA-2 hash family also has a structure similar to SHA-1. For this reason, there is a possibility of causing a problem in the security that the hash function should have.

そこで、本発明は、安全性の評価が可能なハッシュ関数を提供することを目的とする。   Therefore, an object of the present invention is to provide a hash function that can be evaluated for security.

以上の課題を解決するため、本発明は、非線形変換を複数回行うF関数を備えるブロック暗号を用いてハッシュ値を生成する。   In order to solve the above problems, the present invention generates a hash value by using a block cipher having an F function that performs nonlinear transformation a plurality of times.

例えば、本発明は、メッセージを予め定められたデータ長のブロックにして、当該ブロックを分割した複数の分割データのうちの特定の分割データをF関数により変換を行い、他の特定の分割データとの排他的論理和を算出する撹拌処理を含むブロック暗号を用いて、前記メッセージのハッシュ値を生成するハッシュ値生成装置であって、前記F関数において、少なくとも非線形変換を含む変換を複数回行う制御部を備えること、を特徴とする。   For example, according to the present invention, a message is converted into a block having a predetermined data length, specific divided data among a plurality of divided data obtained by dividing the block is converted by the F function, and other specific divided data and A hash value generation device that generates a hash value of the message using a block cipher that includes an agitation process that calculates an exclusive OR of the control, and performs a plurality of conversions including at least nonlinear conversion in the F function It is characterized by providing a part.

以上のように、本発明によれば、安全性の評価が可能なハッシュ関数を提供することができる。   As described above, according to the present invention, it is possible to provide a hash function that can be evaluated for safety.

図1は、本発明の第一の実施形態であるハッシュ値生成装置100の概略図である。   FIG. 1 is a schematic diagram of a hash value generation device 100 according to the first embodiment of the present invention.

ここで、本実施形態においては、512ビットのハッシュ値を生成するようにしている。   Here, in this embodiment, a 512-bit hash value is generated.

図示するように、ハッシュ値生成装置100は、記憶部110と、制御部120と、入力部130と、出力部140と、を備える。   As illustrated, the hash value generation device 100 includes a storage unit 110, a control unit 120, an input unit 130, and an output unit 140.

記憶部110は、初期値記憶領域111と、定数ラウンド値記憶領域112と、鍵ラウンド値記憶領域113と、平文ラウンド値記憶領域114と、算出値記憶領域115と、ハッシュ値記憶領域116と、を備える。   The storage unit 110 includes an initial value storage area 111, a constant round value storage area 112, a key round value storage area 113, a plaintext round value storage area 114, a calculated value storage area 115, a hash value storage area 116, Is provided.

初期値記憶領域111には、ハッシュ値を生成する際の初期値を特定する情報が格納される。   The initial value storage area 111 stores information for specifying an initial value when generating a hash value.

本実施形態においては、ハッシュ値を生成する際の初期値として、定数ラウンド値の初期値と、算出値の初期値と、が記憶される。   In the present embodiment, an initial value of a constant round value and an initial value of a calculated value are stored as initial values when generating a hash value.

ここで、定数ラウンド値の初期値は、例えば、c(−1)=0xffffffffffffffffffffffffffffffffといった定数が記憶される。 Here, as the initial value of the constant round value, for example, a constant such as c (−1) = 0xffffffffffffffffffffffffffffffff is stored.

また、算出値の初期値は、H−1=(H−1.0,H−1.1,・・・,H−1.7)であり、H−1.0=0x0000000000000000、H−1.1=0x0000000000000000、H−1.2=0x0000000000000000、H−1.3=0x0000000000000000、H−1.4=0x0000000000000000、H−1.5=0x0000000000000000、H−1.6=0x0000000000000000、H−1.7=0x0000000000000000、といった定数が記憶される。 The initial value of the calculated value is H −1 = (H −1.0 , H −1.1 ,..., H −1.7 ), and H −1.0 = 0x0000000000000000, H −1. .1 = 0x0000000000000000, H- 1.2 = 0x0000000000000000, H- 1.3 = 0x0000000000000000, H- 1.4 = 0x0000000000000000, H- 1.5 = 0x0000000000000000, H- 1.6 = 0x0000000000000000, H- 1.7 = 0x0000000000000000 and other constants are stored.

なお、定数ラウンド値及び算出値の初期値に使用される定数はこれらに限定されるわけではなく、例えば、疑似乱数生成器等で生成された乱数を使用することも可能である。   The constants used for the constant round value and the initial value of the calculated value are not limited to these. For example, a random number generated by a pseudo-random number generator or the like can be used.

定数ラウンド値記憶領域112には、各々のメッセージブロックにおけるラウンド毎の定数ラウンド値を特定する情報が格納される。   The constant round value storage area 112 stores information for specifying a constant round value for each round in each message block.

なお、本実施形態においては、定数ラウンド値は、後述するラウンド定数生成部123で生成される。   In the present embodiment, the constant round value is generated by the round constant generation unit 123 described later.

鍵ラウンド値記憶領域113には、各々のメッセージブロックにおけるラウンド毎の鍵ラウンド値を特定する情報が格納される。   The key round value storage area 113 stores information for specifying a key round value for each round in each message block.

なお、本実施形態においては、鍵ラウンド値は、後述する第一ラウンド鍵生成部124又は第二ラウンド鍵生成部125で生成される。   In the present embodiment, the key round value is generated by a first round key generation unit 124 or a second round key generation unit 125 described later.

平文ラウンド値記憶領域114には、各々のメッセージブロックにおけるラウンド毎の平文ラウンド値を特定する情報が格納される。   The plaintext round value storage area 114 stores information for specifying a plaintext round value for each round in each message block.

なお、本実施形態においては、平文ラウンド値は、後述する撹拌部126で生成される。   In the present embodiment, the plaintext round value is generated by the stirring unit 126 described later.

算出値記憶領域115には、各々のメッセージブロックにおいて全てのラウンドを経て算出された算出値を特定する情報が格納される。   The calculated value storage area 115 stores information for specifying a calculated value calculated through all rounds in each message block.

なお、本実施形態においては、算出値は、後述する全体制御部121で生成される。   In the present embodiment, the calculated value is generated by the overall control unit 121 described later.

ハッシュ値記憶領域には、全てのメッセージブロックにおいて全てのラウンドを経て算出されたハッシュ値を特定する情報が格納される。   In the hash value storage area, information specifying hash values calculated through all rounds in all message blocks is stored.

なお、本実施形態においては、ハッシュ値は、後述する全体制御部121で生成される。   In the present embodiment, the hash value is generated by the overall control unit 121 described later.

制御部120は、全体制御部121と、メッセージブロック化部122と、ラウンド定数生成部123と、第一ラウンド鍵生成部124と、第二ラウンド鍵生成部125と、撹拌部126と、を備える。   The control unit 120 includes an overall control unit 121, a message blocking unit 122, a round constant generation unit 123, a first round key generation unit 124, a second round key generation unit 125, and a stirring unit 126. .

全体制御部121は、ハッシュ値生成装置100における処理の全体を制御する。   The overall control unit 121 controls the overall processing in the hash value generation device 100.

特に、本実施形態においては、ハッシュ値を算出するメッセージをブロック化したメッセージブロックを管理する処理や、ラウンド定数生成部123、第一ラウンド鍵生成部124、第二ラウンド鍵生成部125及び撹拌部126でのラウンドを管理する処理を行う。   In particular, in the present embodiment, a process for managing a message block obtained by blocking a message for calculating a hash value, a round constant generation unit 123, a first round key generation unit 124, a second round key generation unit 125, and a stirring unit The process of managing the round at 126 is performed.

また、全体制御部121は、全てのラウンドを経て撹拌部126において算出された平文ラウンド値と、当該ラウンドでの処理の対象となったメッセージブロックと、の排他的論理和を算出することで、算出値を算出する。   In addition, the overall control unit 121 calculates the exclusive OR of the plaintext round value calculated in the stirring unit 126 through all rounds and the message block subjected to processing in the round, Calculate the calculated value.

さらに、全体制御部121は、全てのメッセージブロック及び全てのラウンドを経て撹拌部126において算出された平文ラウンド値と、最後のメッセージブロックと、の排他的論理和を算出することで、ハッシュ値を算出する。   Further, the overall control unit 121 calculates the exclusive OR of the plaintext round value calculated in the agitation unit 126 through all message blocks and all rounds, and the last message block, thereby calculating the hash value. calculate.

メッセージブロック化部122は、ハッシュ値を算出する対象となるメッセージを予め定められたビット長のブロックに分割し、パディングを行う。   The message blocking unit 122 divides a message for which a hash value is calculated into blocks having a predetermined bit length and performs padding.

ここで、本実施形態では、ハッシュ値を算出する対象となるメッセージを512ビット毎のブロックに分割するようにしているが、このような態様に限定されるわけではない。   Here, in this embodiment, the message for which the hash value is calculated is divided into 512-bit blocks. However, the present invention is not limited to this mode.

また、例えば、本実施形態におけるパディングは、以下のようにして行う。   Further, for example, padding in the present embodiment is performed as follows.

まず、メッセージブロック化部122は、ハッシュ値を算出する対象となるメッセージのビット数が、512ビットで割り切れる場合には、当該メッセージを512ビット毎に分割することで各々のメッセージブロックを生成するとともに、メッセージブロックを追加して最後のメッセージブロックとする。   First, when the number of bits of a message whose hash value is calculated is divisible by 512 bits, the message blocking unit 122 generates each message block by dividing the message into 512 bits. The message block is added as the last message block.

そして、メッセージブロック化部122は、この最後のメッセージブロックにおいて、先頭ビットに「1」、先頭ビットの次のビットから数えて383ビットまでに「0」、最後の128ビットにメッセージのビット長、を特定する情報を格納する。   Then, in this last message block, the message blocking unit 122 sets “1” as the first bit, “0” up to 383 bits from the next bit of the first bit, bit length of the message as the last 128 bits, Stores information that identifies

次に、メッセージブロック化部122は、ハッシュ値を算出する対象となるメッセージのビット数が、512ビットで割り切れない場合には、当該メッセージを512ビット毎に分割することで各々のメッセージブロックを生成するとともに、分割した最後尾のメッセージブロックには最後のビットまで「0」を特定する情報を格納することで、512ビットにし、さらに、メッセージブロックを追加して最後のメッセージブロックとする。   Next, if the number of bits of the message for which the hash value is calculated cannot be divided by 512 bits, the message blocking unit 122 generates each message block by dividing the message into 512 bits. At the same time, the information specifying “0” up to the last bit is stored in the last message block divided to 512 bits, and a message block is further added to form the last message block.

そして、メッセージブロック化部122は、この最後のメッセージブロックにおいて、先頭ビットから数えて384ビットまでに「0」、最後の128ビットにメッセージのビット長、を特定する情報を格納する。   Then, the message blocking unit 122 stores information specifying “0” up to 384 bits counted from the first bit and the bit length of the message in the last 128 bits in this last message block.

なお、本実施形態においては、ハッシュ値を算出するメッセージをMとし、パディングにより、512ビットで割り切れるようなビット長にされたメッセージをM’とし、メッセージブロックの数をk+1(kは1以上の整数)とし、各々のメッセージブロックをM’(iは、0≦i≦kなる整数)とする。 In the present embodiment, a message for calculating a hash value is M, a message that has a bit length divisible by 512 bits by padding is M ′, and the number of message blocks is k + 1 (k is 1 or more). Integer), and each message block is M ′ i (i is an integer satisfying 0 ≦ i ≦ k).

ラウンド定数生成部123は、各ラウンドにおける定数ラウンド値及びラウンド定数を算出する。   The round constant generation unit 123 calculates a constant round value and a round constant in each round.

本実施形態においては、ラウンド定数生成部123は、最初のラウンドの場合には初期値記憶領域111に記憶されている定数ラウンド値の初期値から、または、最初のラウンドではない場合には定数ラウンド値記憶領域112に記憶されている前ラウンドにおける定数ラウンド値から、線形変換関数fを用いて、各ラウンドにおける定数ラウンド値を算出する。 In the present embodiment, the round constant generation unit 123 determines the constant round from the initial value of the constant round value stored in the initial value storage area 111 in the case of the first round, or in the case of not the first round. from the constant round value before the round stored in the value storage area 112, using a linear transformation function f c, calculates a constant round value in each round.

例えば、図2(線形変換関数fを示す概略図)に示すように、ラウンド定数生成部123は、前ラウンド(r−1)の定数ラウンド値c(r−1)(r=0の場合には定数ラウンド値の初期値)を関数fに入力して算出された値の上位ビット(本実施形態では、上位64ビット)と下位ビット(本実施形態では、下位64ビット)を入れ替えることにより、今ラウンド(r)の定数ラウンド値c(r)を算出する。 For example, as shown in FIG. 2 (a schematic showing a linear transformation function f c Figure), the round-constant generation unit 123, the previous round (r-1) constant round value c (r-1) (for r = 0 in the upper bits (the embodiment of the values that the initial value) was calculated by entering the function f L constant round value is in the upper 64 bits) and lower bits (the embodiment, by replacing the lower 64 bits) Thus, the constant round value c (r) of the current round ( r) is calculated.

即ち、下記の(1)式及び(2)式に示されるようにして、前ラウンドの定数ラウンド値c(r−1)(r=0の場合には定数ラウンド値の初期値)から今ラウンドの定数ラウンド値c(r)を算出する。 That is, as shown in the following equations (1) and (2), the current round is calculated from the constant round value c (r−1) of the previous round ( the initial value of the constant round value when r = 0). A constant round value c (r) of is calculated.

Figure 2010044251
Figure 2010044251

Figure 2010044251
Figure 2010044251

ここで、(1)式及び(2)式において、t及びtは、それぞれ、定数ラウンド値c(r−1)(r=0の場合には定数ラウンド値の初期値)を関数fに入力して算出された値の上位ビット及び下位ビットである。 Here, in Expressions (1) and (2), t H and t L are constant round values c (r−1) (initial values of constant round values when r = 0 ) , respectively, and function f These are the upper and lower bits of the value calculated by inputting to L.

また、関数fは、線形フィードバックシフトレジスタ(LFSR)を用いる。 The function f L uses a linear feedback shift register (LFSR).

一般に、LFSRは多項式で決定されるが、ここではLFSRを決定する多項式g(x)を、下記の(3)式のように定義する。   In general, the LFSR is determined by a polynomial. Here, a polynomial g (x) for determining the LFSR is defined as the following equation (3).

Figure 2010044251
Figure 2010044251

但し、g(x)は有限体GF(2)において定義される多項式である。   However, g (x) is a polynomial defined in the finite field GF (2).

なお、関数fの擬似コードは、下記の(4)のように示される。 Incidentally, the pseudo-code for the function f L is expressed by the following (4).

Figure 2010044251
Figure 2010044251

ここで、「<<X」は、Xビットの左シフトを示し、「>>Y」は、Yビットの右シフトを示し、「^」は、ビット毎の排他的論理和を示し、「&」は、ビット毎の論理積を示し、「|」は、ビット毎の論理和を示す。また、hは、定数ラウンド値c(r−1)における上位ビット(上位64ビット)、lは、定数ラウンド値c(r−1)における下位ビット(下位64ビット)である。 Here, “<< X” indicates a left shift of X bits, “>> Y” indicates a right shift of Y bits, “^” indicates an exclusive OR for each bit, and “&” "Represents a logical product for each bit, and" | "represents a logical sum for each bit. Further, h is upper bits of the constant round value c (r-1) (upper 64 bits), l is the lower-order bits of the constant round value c (r-1) (low-order 64 bits).

そして、ラウンド定数生成部123は、算出したラウンド(r)での定数ラウンド値c(r)の下位64ビットを、第rラウンドにおけるラウンド定数C(r)として、第一ラウンド鍵生成部124又は第二ラウンド鍵生成部125に出力する。 Then, the round constant generation unit 123 sets the lower 64 bits of the constant round value c (r) in the calculated round (r) as the round constant C (r) in the r-th round, or the first round key generation unit 124 or Output to the second round key generation unit 125.

以下に、R=96の場合におけるC(r)の一例を掲げる。 An example of C (r) in the case of R = 96 is given below.

(0)=0x9916b42b1075d3c4、C(1)=0xef660b4c6b97a9a1、C(2)=0x645ad0ac41d74f11、C(3)=0xdb7166e541d48abf、C(4)=0x81f2b60293356a19、C(5)=0x0b2cd041e8d806c6、C(6)=0x71ba676d3737d203、C(7)=0x5ac3fe60d882617f、C(8)=0xd670690748b71e50、C(9)=0x0de6b2578d83a9c6、C(10)=0x495850aeb6b42f1c、C(11)=0x379ac95e360ea718、C(12)=0x4388096e355a904b、C(13)=0xa81b9a1fa3d8e607、C(14)=0x1eb9d10b41021771、C(15)=0xa06e687e8f63981c、C(16)=0x7ae7442d04085dc5、C(17)=0x81b9a1fa3d8e6070、C(18)=0x8d745b60ffab5b2e、C(19)=0x7096388f8ddbfba6、C(20)=0x43a1d2e4854f16df、C(21)=0xd2c1168da307b8c4、C(22)=0x686e0046fab67746、C(23)=0x5b9dae851876b54c、C(24)=0xc7514acf0553f123、C(25)=0x7eef4ea7f5b2836d、C(26)=0x7bac60e8fac5e8b7、C(27)=0xeb24ce2c42a25be8、C(28)=0x8858c877049d8ee6、C(29)=0xbc0acc029ee139fd、C(30)=0x216321dc12763b99、C(31)=0xf02b300a7b84e7f4、C(32)=0x858c877049d8ee65、C(33)=0xa6458bfd0199b3ea、C(34)=0x6042a2a65c81c3f2、C(35)=0xef6690937d84b5cf、C(36)=0x91937e2ae66f5995、C(37)=0xdb7309991998fb06、C(38)=0x303d47cce25f1c32、C(39)=0x7d55d2d7f20bba44、C(40)=0xc0f51f33897c70c8、C(41)=0x93be008b27a4c52a、C(42)=0x134d887db199957d、C(43)=0x4ef8022c9e9314a8、C(44)=0x4d3621f6c66655f4、C(45)=0x5d09436695c67e9b、C(46)=0x244173688df1018c、C(47)=0x12cc464eb893d657、C(48)=0xe77572c54c267c57、C(49)=0x3d41a65d99ad233a、C(50)=0x8d4c3fa6a4f1a700、C(51)=0xf506997666b48ce9、C(52)=0x3530fe9a93c69c01、C(53)=0xb2f32e0d75581f9f、C(54)=0xa2b3450d34f80a62、C(55)=0xbdbc0752ae82041a、C(56)=0xfcbdab53a80253ee、C(57)=0x8080a22dc1ea6a0e、C(58)=0xe26f59fd346119e5、C(59)=0x020288b707a9a839、C(60)=0xef542c203e0e4baf、C(61)=0x7e7a9dbb6544da82、C(62)=0xadc944336c5178e0、C(63)=0x9f033d397a994632、C(64)=0xc155afaacaa799e6、C(65)=0x0a7c4b82918762ae、C(66)=0x15cf4a18bef631c4、C(67)=0x29f12e0a461d8ab8、C(68)=0x573d2862fbd8c710、C(69)=0xa7c4b82918762ae0、C(70)=0x3a1dea5f00e9307a、C(71)=0xe9625fc31a3ad1e7、C(72)=0x9e07161b7846bb8e、C(73)=0xb5108bbffc8311c1、C(74)=0x781c586de11aee39、C(75)=0xd4422efff20c4704、C(76)=0x86982a636be194de、C(77)=0x41914f4c5c594a4d、C(78)=0x1a60a98daf865378、C(79)=0x60ac76e59eef050f、C(80)=0x1ff21951c5fb3787、C(81)=0x92282f25efd44260、C(82)=0x7fc8654717ecde1d、C(83)=0x48a0bc97bf510980、C(84)=0x99c8dec8b039544f、C(85)=0x321b06ed692c705d、C(86)=0x67237b22c0e5513c、C(87)=0xc86c1bb5a4b1c174、C(88)=0xfa64a75fec1f68ca、C(89)=0x31299a6506af538d、C(90)=0x8f7bd6ab5ff78f13、C(91)=0xb2d6d6f3615f3452、C(92)=0x4b9fe5ca043c462a、C(93)=0xbd2be4aafe9eab2f、C(94)=0x3ee6639b84994ef5、C(95)=0xf4af92abfa7aacbc。 C (0) = 0x9916b42b1075d3c4, C (1) = 0xef660b4c6b97a9a1, C (2) = 0x645ad0ac41d74f11, C (3) = 0xdb7166e541d48abf, C (4) = 0x81f2b60293356a19, 0 ( e ) (7) = 0x5ac3fe60d882617f, C ( 8) = 0xd670690748b71e50, C (9) = 0x0de6b2578d83a9c6, C (10) = 0x495850aeb6b42f1c, C (11) = 0x379ac95e360ea718, C (12) = 0x4388096e355a904b, C (13) = 0xa81b9a1fa3d8e607, C ( 14) = 0x1eb9d10b41021771, C (15 ) = 0xa06e687e8f63981c, C (16) = 0x7ae7442d04085dc5, C (17) = 0x81b9a1fa3d8e6070, C (18) = 0x8d745b60ffab5b2e, C (19) = 0x7096388f8ddbfba6, C (20) = 0x43a1d2e4854f16df, C (21 ) = 0xd2c1168da307b8c4, C (22) = 0x686e0046fab67746, C (23) = 0x5b9dae851876b54c, C (24) = 0xc7514acf0553f123, C 25) = 0x7eef4ea7f5b2836d, C (26 ) = 0x7bac60e8fac5e8b7, C (27) = 0xeb24ce2c42a25be8, C (28) = 0x8858c877049d8ee6, C (29) = 0xbc0acc029ee139fd, C (30) = 0x216321dc12763b99, C (31) = 0xf02b300a7b84e7f4, C (32 ) = 0x858c877049d8ee65, C (33) = 0xa6458bfd0199b3ea, C (34) = 0x6042a2a65c81c3f2, C (35) = 0xef6690937d84b5cf, C (36) = 0x91937e2ae66f5995, C (37) = 0xdb7309991998fb06, C (38) = 0x303d47cce25f1c32, C (39) = 0x7d55d2d7f20bba44, C (40) = 0xc0f51f33897c70c8, C (41) = 0x93be008b27a4c52a, C (42) = 0x134d887db199957d, C (43) = 0x4ef8022c9e9314a8, C (44) = 0x4d3621f6c66655f4, C (45) = 0x5d09436695c67e9b, C (46) = 0x244173688df1018c, C (47) = 0x12cc464eb893d657, C (48) = 0xe77572c54c267c57, C (49) = 0 x3d41a65d99ad233a, C (50) = 0x8d4c3fa6a4f1a700 , C (51) = 0xf506997666b48ce9, C (52) = 0x3530fe9a93c69c01, C (53) = 0xb2f32e0d75581f9f, C (54) = 0xa2b3450d34f80a62, C (55) = 0xbdbc0752ae82041a, C (56) = 0xfcbdab53a80253ee , C (57) = 0x8080a22dc1ea6a0e, C (58) = 0xe26f59fd346119e5, C (59) = 0x020288b707a9a839, C (60) = 0xef542c203e0e4baf, C (61) = 0x7e7a9dbb6544da82, C (62) = 0xadc944336c5178e0, C (63) = 0x9f033d397a994632, C (64) = 0xc155afaacaa799e6, C (65) = 0x0a7c4b82918762ae, C (66) = 0x15cf4a18bef631c4, C (67) = 0x29f12e0a461d8ab8, C (68) = 0x573d2862fbd8c710, C (69) = 0xa7c4b82918762ae0, C (70) = 0x3a1dea5f00e9307a, C (71) = 0xe9625fc31a3ad1e7, C (72) = 0x9e07161b7846bb8e, C (73) = 0xb5108bbffc8311c 1, C (74) = 0x781c586de11aee39, C (75) = 0xd4422efff20c4704, C (76) = 0x86982a636be194de, C (77) = 0x41914f4c5c594a4d, C (78 ) = 0x1a60a98daf865378, C (80) , C (81) = 0x92282f25efd44260, C (82) = 0x7fc8654717ecde1d, C (83) = 0x48a0bc97bf510980, C (84) = 0x99c8dec8b039544f, C (85) = 0x321b06ed692c705d, C (86) = 0x67237b22c0e5513c, C (87) = 0xc86c1bb5a4b1c174, C (88) = 0xfa64a75fec1f68ca, C (89) = 0x31299a6506af538d, C (90) = 0x8f7bd6ab5ff78f13, C (91) = 0xb2d6d6f3615f3452, C (92) = 0x4b9fe5ca043c462a, C (93) = 0xbd2be4aafe9eab2f, C (94) = 0x3ee6639b84994ef5, C (95) = 0xf4af92abfa7aacbc.

第一ラウンド鍵生成部124は、各ラウンドにおける鍵ラウンド値及びラウンド鍵を算出する処理を行う。   The first round key generation unit 124 performs processing for calculating a key round value and a round key in each round.

例えば、第一ラウンド鍵生成部124による鍵ラウンド値の算出は、図3(第一鍵ラウンド値変換関数fの概略図)に示す第一鍵ラウンド値変換関数fを用いて行われる。 For example, the calculation of the key round value by the first round key generation unit 124 is performed using the first key round value conversion function f k shown in FIG. 3 (schematic diagram of the first key round value conversion function f k ).

図示するように、第一鍵ラウンド値変換関数fは、第r−1ラウンドの鍵ラウンド値k(r−1)(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値、または、初期値記憶領域111に記憶されている算出値の初期値)を8分割(ここでは、各々64ビット)した分割データであるk (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)を、それぞれ、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)に変換し、変換したこれらの値を連結することで、第rラウンドの鍵ラウンド値k(r)を生成する関数である。 As shown in the figure, the first key round value conversion function f k is stored in the calculated value storage area 115 when the key round value k (r−1) of the ( r−1) -th round (where r = 0 ). Calculated values or the initial values of the calculated values stored in the initial value storage area 111) are divided into eight divided data (here, 64 bits each) k 0 (r−1) and k 1 (r -1) , k 2 (r-1) , k 3 (r-1) , k 4 (r-1) , k 5 (r-1) , k 6 (r-1) , k 7 (r-1) ) , K 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 (r) , k 6 (r) , k 7 ( converted to r), by connecting the converted these values is a function of generating a key round value k (r) of the r rounds.

具体的には、第一鍵ラウンド値変換関数fでは、まず、第一ラウンド鍵生成部124が、鍵ラウンド値記憶領域113に記憶されている第r−1ラウンドの鍵ラウンド値(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値、または、初期値記憶領域111に記憶されている算出値の初期値)を、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)に8等分する。 Specifically, in the first key round value conversion function f k , first, the first round key generation unit 124 stores the key round value of the (r−1) -th round stored in the key round value storage area 113 (however, In the case of r = 0, the calculated value stored in the calculated value storage area 115 or the initial value of the calculated value stored in the initial value storage area 111) is expressed as k 0 (r−1) , k 1. (r-1), k 2 (r-1), k 3 (r-1), k 4 (r-1), k 5 (r-1), k 6 (r-1), k 7 (r -1) is divided into 8 equal parts.

次に、第一ラウンド鍵生成部124は、第r−1ラウンドの鍵ラウンド値の内のk (r−1)、k (r−1)、k (r−1)、k (r−1)、をそれぞれ第rラウンドの鍵ラウンド値の内のk (r)、k (r)、k (r)、k (r)、とする。 Next, the first round key generation unit 124 includes k 0 (r−1) , k 1 (r−1) , k 2 (r−1) , k 3 in the key round values of the (r−1) -th round. (R−1) and k 2 (r) , k 3 (r) , k 4 (r) , and k 5 (r) in the r-th round key round values, respectively.

次に、第一ラウンド鍵生成部124は、ラウンド定数生成部123で生成されたラウンド定数C(r)及び第r−1ラウンドのラウンド鍵の内のk (r−1)の排他的論理和の値aと、第r−1ラウンドのラウンド鍵の内のk (r−1)の値aと、を連結した値aをF関数である関数Fに入力した出力値の内の上位ビット(ここでは、上位64ビット)の値b(b=F(k (r−1) XOR C(r),k (r−1))と、下位ビット(ここでは、下位64ビット)の値b(b=F(k (r−1) XOR C(r),k (r−1))と、を算出する。 Next, the first round key generation unit 124 uses the exclusive logic of the round constant C (r) generated by the round constant generation unit 123 and k 4 (r−1) of the round keys of the (r−1) -th round. A value a obtained by concatenating the sum value a H and the value a L of k 5 (r−1) of the round keys of the (r−1) -th round is input to the function F k that is an F function. Value b H (b H = F k (k 4 (r−1) XOR C (r) , k 5 (r−1) ) H ) and lower bits A value b L (here, lower 64 bits) b L (b L = F k (k 4 (r−1) XOR C (r) , k 5 (r−1) ) L ) is calculated.

そして、第一ラウンド鍵生成部124は、値bと、第r−1ラウンドの鍵ラウンド値の内のk (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの鍵ラウンド値のk (r)とする。 Then, the first round key generation unit 124 calculates an exclusive OR of the value b H and k 6 (r−1) of the key round values of the (r−1) -th round, and calculates the calculated value. The key round value of the r-th round is k 0 (r) .

また、第一ラウンド鍵生成部124は、値bと、第r−1ラウンドの鍵ラウンド値の内のk (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの鍵ラウンド値のk (r)とする。 The first round key generation unit 124 calculates an exclusive OR of the value b L and k 7 (r−1) of the key round values of the (r−1) -th round, and calculates the calculated value. The key round value of the r-th round is k 1 (r) .

次に、第一ラウンド鍵生成部124は、第r−1ラウンドの鍵ラウンド値の内のk (r−1)、k (r−1)を、それぞれ第rラウンドの鍵ラウンド値k (r)、k (r)とする。 Next, the first round key generation unit 124 converts the key round values k 4 (r−1) and k 5 (r−1) of the key round values of the (r−1) -th round to the key round values k of the r-th round, respectively. 6 (r) and k 7 (r) .

そして、第一ラウンド鍵生成部124は、以上のようにして算出したk (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)を連結して第rラウンドの鍵ラウンド値として、第r−1ラウンドの鍵ラウンド値と入れ替えて鍵ラウンド値記憶領域113に記憶する。 The first round key generation unit 124 then calculates k 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 calculated as described above. (R) , k 6 (r) , and k 7 (r) are concatenated and stored in the key round value storage area 113 as the key round value of the r-th round, replaced with the key round value of the (r-1) -th round.

また、第一ラウンド鍵生成部124は、第rラウンドの鍵ラウンド値の内のk (r)を、第rラウンドのラウンド鍵K(r)として、撹拌部126に出力する。 Further, the first round key generation unit 124 outputs k 3 (r) in the key round value of the r-th round to the stirring unit 126 as the round key K (r) of the r-th round.

次に、第一ラウンド鍵生成部124で使用するF関数である関数Fについて説明する。 Next, the function F K that is the F function used in the first round key generation unit 124 will be described.

関数Fは、下記の(5)式に示すように、非線形変換γと、線形変換λと、の合成変換を行う関数である。 The function F K is a function that performs a combined transformation of the nonlinear transformation γ K and the linear transformation λ k as shown in the following equation (5).

Figure 2010044251
Figure 2010044251

また、線形変換λは、バイト置換πと、行列変換θと、の合成変換である。 The linear transformation λ k is a composite transformation of byte substitution π K and matrix transformation θ K.

ここで、関数Fへの入力をX、関数Fからの出力をYとして説明する。 Here, describing the input to the function F K X, the output from the function F K as Y.

本実施形態においては、X及びYは、128ビットのデータである。   In the present embodiment, X and Y are 128-bit data.

まず、非線形変換γでは、値Xを8ビット毎のサブデータ(s,s,・・・,s15)に分割して、分割した各々のサブデータを、下記の(6)式に示すように、置換テーブルS−boxを用いて非線形変換を行う。ここで、変換後のサブデータをs’,s’,・・・,s’15とする。 First, in the non-linear transformation γ K , the value X is divided into sub-data (s 0 , s 1 ,..., S 15 ) every 8 bits, and each sub-data is divided into the following formula (6) As shown in FIG. 5, nonlinear conversion is performed using the replacement table S-box. Here, it is assumed that the converted sub data is s ′ 0 , s ′ 1 ,..., S ′ 15 .

Figure 2010044251
Figure 2010044251

なお、置換テーブルSboxは、例えば、下記の(7)で示される。   The replacement table Sbox is represented by, for example, (7) below.

Figure 2010044251
Figure 2010044251

次に、行列変換θでは、上記の非線形変換γでの変換後のサブデータ(s’,s’,・・・,s’15)を8行2列の行列にして、下記の(10)式に示すように、変換行列Aとの乗算を行うことで、変換を行う。ここで、変換後のサブデータをs”,s”,・・・,s”15とする。乗算は、有限体GF(2)上での乗算である。有限体GF(2^8)は、下記の(8)式及び(9)式を満たす。 Next, in the matrix transformation θ K , the sub-data (s ′ 0 , s ′ 1 ,..., S ′ 15 ) after the transformation by the nonlinear transformation γ K is converted into an 8 × 2 matrix, and the following As shown in equation (10), conversion is performed by multiplication with the conversion matrix A. Here, the converted sub-data is s ″ 0 , s ″ 1 ,..., S ″ 15. Multiplication is multiplication on the finite field GF (2 8 ) .The finite field GF (2 ^ 8) satisfies the following equations (8) and (9).

Figure 2010044251
Figure 2010044251

Figure 2010044251
Figure 2010044251

Figure 2010044251
Figure 2010044251

ここで、変換行列Aは、ある列を入力列とし、当該入力列に対して変換行列Aによる変換を行った後の値の列を出力列とした場合に、入力列及び出力列に含まれる項の内、値が「0」ではない項が、9個以上になるような変換であれば、どのような変換行列を用いてもよい。   Here, the transformation matrix A is included in an input column and an output column when a column is an input column and a column of values after the transformation by the transformation matrix A is performed on the input column is an output column. Any transformation matrix may be used as long as the number of terms whose value is not “0” is nine or more.

次に、バイト置換πでは、下記の(11)式に示すように、行列変換θで変換されたサブデータ(s”,s”,・・・,s”15)のうちの半分のデータの入れ替えを行う。なお、変換後のサブデータをy,y,・・・,y15とする。 Next, in the byte substitution π K , as shown in the following equation (11), the sub-data (s ″ 0 , s ″ 1 ,..., S ″ 15 ) converted by the matrix transformation θ K performing replacement of half of the data. in addition, the sub-converted data y 0, y 1, · · ·, and y 15.

Figure 2010044251
Figure 2010044251

そして、以上のようにして算出されたサブデータ(y,y,・・・,y15)を(12)式のように連結することで、関数Fの出力Yとする。 Then, the sub-data (y 0 , y 1 ,..., Y 15 ) calculated as described above are connected as shown in the equation (12) to obtain the output Y of the function F K.

Figure 2010044251
Figure 2010044251

以上の関数Fでは、後述する関数Fと比較して、一つの入力に対して一回の処理で出力を行うため、計算量が少なくてすみ、軽実装が可能となる。 In more functions F K, as compared to the function F R described later, for performing an output in one of the processing for one input, requires less amount of calculation, it is possible to light implementation.

図1に戻り、第二ラウンド鍵生成部125は、各ラウンドにおける鍵ラウンド値及びラウンド鍵を算出する処理を行う。   Returning to FIG. 1, the second round key generation unit 125 performs a process of calculating a key round value and a round key in each round.

例えば、第二ラウンド鍵生成部125による鍵ラウンド値の算出は、図4(第二鍵ラウンド値変換関数f’の概略図)に示す第二鍵ラウンド値変換関数f’を用いて行われる。 For example, the calculation of the key round value by the second round key generation unit 125 is performed using the second key round value conversion function f ′ K shown in FIG. 4 (schematic diagram of the second key round value conversion function f ′ K ). Is called.

図示するように、第二鍵ラウンド値変換関数f’は、第r−1ラウンドの鍵ラウンド値k(r−1)(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値、または、初期値記憶領域111に記憶されている算出値の初期値)を8分割(ここでは、各々64ビット)した分割データであるk (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)を、それぞれ、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)に変換し、変換したこれらの値を連結することで、第rラウンドの鍵ラウンド値k(r)を生成する関数である。 As shown in the figure, the second key round value conversion function f ′ K is stored in the calculated value storage area 115 when the key round value k (r−1) of the ( r−1) -th round (r = 0 ). Calculated values or the initial values of the calculated values stored in the initial value storage area 111) are divided into eight divided data (here, 64 bits each ) , k 0 (r−1) , k 1 ( r-1), k 2 ( r-1), k 3 (r-1), k 4 (r-1), k 5 (r-1), k 6 (r-1), k 7 (r- 1) , k 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 (r) , k 6 (r) , k 7, respectively. It is a function that generates a key round value k (r) for the r-th round by converting these values into (r) and concatenating these converted values.

具体的には、第二鍵ラウンド値変換関数f’Kでは、まず、第二ラウンド鍵生成部125が、鍵ラウンド値記憶領域113に記憶されている第r−1ラウンドの鍵ラウンド値(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値)を、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)に8等分する。 Specifically, in the second key round value conversion function f ′ K , first, the second round key generation unit 125 first sets the (r−1) th key round value stored in the key round value storage area 113 (however, , R = 0, the calculated values stored in the calculated value storage area 115 are changed to k 0 (r−1) , k 1 (r−1) , k 2 (r−1) , k 3 ( r-1), k 4 ( r-1), k 5 (r-1), k 6 (r-1), 8 aliquoted into k 7 (r-1).

次に、第二ラウンド鍵生成部125は、第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)、k (r−1)、k (r−1)、k (r−1)、をそれぞれ第rラウンドの鍵ラウンド値の内のk (r)、k (r)、k (r)、k (r)、とする。 Next, the second round key generation unit 125 includes k 0 (r−1) and k 1 (r−1) out of the key round values of the (r−1) -th round (calculated values when r = 0 ). , K 2 (r−1) and k 3 (r−1) are respectively represented by k 2 (r) , k 3 (r) , k 4 (r) , k 5 ( r)

次に、第二ラウンド鍵生成部125は、ラウンド定数生成部123で生成されたラウンド定数C(r)及び第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)の排他的論理和である値a’と、第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)の値a’と、を連結した値a’をF関数である関数Fに入力した出力値の内の上位ビット(ここでは、上位64ビット)の値b’(b’=F(k (r−1) XOR C(r),k (r−1))と、下位ビット(ここでは、下位64ビット)の値b’(b=F(k (r−1) XOR C(r),k (r−1))と、を算出する。 Next, the second round key generation unit 125 includes the round constant C (r) generated by the round constant generation unit 123 and the key round value of the (r−1 ) -th round (calculated value when r = 0). of k 4 (r-1) and a value a 'H is exclusive of, k 5 of the key round value of the r-1 round (calculated value in the case of r = 0) (r-1 ) value a at a is the function F upper bits of the output value inputted to the R (where F function 'and L, value a linked a', the value b 'H (b' of the upper 64 bits) H = F R (k 4 (r−1) XOR C (r) , k 5 (r−1) ) H ) and the value b ′ L (b L = F R ( k 4 (r-1) XOR C (r), k 5 and (r-1)) L) , is calculated.

そして、第二ラウンド鍵生成部125は、値b’と、第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの鍵ラウンド値のk (r)とする。 Then, the second round key generation unit 125 calculates the value b ′ H and k 6 (r−1) of the key round values of the (r−1) -th round (calculated values when r = 0 ) . An exclusive OR is calculated, and the calculated value is set as the key round value k 0 (r) of the r-th round.

また、第二ラウンド鍵生成部125は、値b’と、第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの鍵ラウンド値のk (r)とする。 In addition, the second round key generation unit 125 calculates the value b ′ L and k 7 (r−1) of the key round values of the (r−1) -th round (calculated values when r = 0 ) . An exclusive OR is calculated, and the calculated value is set as the key round value k 1 (r) of the r-th round.

次に、第二ラウンド鍵生成部125は、第r−1ラウンドの鍵ラウンド値(r=0の場合には算出値)の内のk (r−1)、k (r−1)を、それぞれ第rラウンドの鍵ラウンド値k (r)、k (r)とする。 Next, the second round key generation unit 125 includes k 4 (r−1) and k 5 (r−1) out of the key round values of the (r−1) -th round (calculated values when r = 0 ). Are the r-th key round values k 6 (r) and k 7 (r) , respectively.

そして、第二ラウンド鍵生成部125は、以上のようにして算出したk (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)を連結して第rラウンドの鍵ラウンド値として、第r−1ラウンドの鍵ラウンド値と入れ替えて鍵ラウンド値記憶領域113に記憶する。 Then, the second round key generation unit 125 calculates k 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 calculated as described above. (R) , k 6 (r) , and k 7 (r) are concatenated and stored in the key round value storage area 113 as the key round value of the r-th round, replaced with the key round value of the (r-1) -th round.

また、第二ラウンド鍵生成部125は、第rラウンドの鍵ラウンド値の内のk (r)を、第rラウンドのラウンド鍵K(r)として、撹拌部126に出力する。 Further, the second round key generation unit 125 outputs k 3 (r) in the r-th round key round value to the agitation unit 126 as the r-th round key K (r) .

次に、第二ラウンド鍵生成部125で使用するF関数である関数Fについて説明する。 Next, functions described F R is F function used in the second round-key generation unit 125.

関数Fは、下記の(13)式に示すように、非線形変換γと、バイト置換πと、行列変換θと、の合成変換を4回(4段)行う関数である。 The function F R is a function that performs the synthesis transformation of the nonlinear transformation γ R , the byte replacement π R, and the matrix transformation θ R four times (four stages), as shown in the following equation (13).

Figure 2010044251
Figure 2010044251

ここで、関数Fへの入力をX、関数Fからの出力をYとして説明する。本実施形態においては、X及びYは、128ビットのデータである。 Here, describing the input to the function F R X, the output from the function F R as Y. In the present embodiment, X and Y are 128-bit data.

まず、非線形変換γでは、値Xを8ビット毎のサブデータ(s,s,・・・,s15)に分割して、分割した各々のサブデータを、下記の(14)式に示すように、置換テーブルS−boxを用いて非線形変換を行う。ここで、変換後のサブデータをs’,s’,・・・,s’15とする。 First, the nonlinear transformation gamma R, the sub-data for each 8-bit value X by dividing (s 0, s 1, ··· , s 15) in the sub-data of the divided each of the following formula (14) As shown in FIG. 5, nonlinear conversion is performed using the replacement table S-box. Here, it is assumed that the converted sub data is s ′ 0 , s ′ 1 ,..., S ′ 15 .

Figure 2010044251
Figure 2010044251

なお、置換テーブルSboxは、例えば、上記の(7)で示されるものを使用すればよい。   For example, the replacement table Sbox may be the one shown in (7) above.

次に、バイト置換πでは、(15)式に示すように、非線形変換γで変換されたサブデータ(s’,s’,・・・,s’15)を4行4列の行列として、各々の列に含まれる各々の行のデータが各々異なる列に配置されるように、データの入れ替えを行う。なお、(15)式は一例であって、各々の列に含まれる各々の行のデータが各々異なる列に配置されるものであれば、他の入れ替え方式を採用することも可能である。 Next, in the byte replacement π R , as shown in the equation (15), the sub-data (s ′ 0 , s ′ 1 ,..., S ′ 15 ) converted by the nonlinear conversion γ R is stored in 4 rows and 4 columns. As a matrix, the data is exchanged so that the data of each row included in each column is arranged in a different column. Note that equation (15) is an example, and other replacement methods can be adopted as long as the data in each row included in each column is arranged in a different column.

また、変換後のサブデータをs”,s”,・・・,s”15とする。 Further, the sub-data of the converted s "0, s" 1, ···, and s "15.

Figure 2010044251
Figure 2010044251

次に、行列変換θでは、下記の(16)式に示すように、上記のバイト置換πでの変換後のサブデータ(s”,s”,・・・,s”15)を要素とする4行4列の行列と、変換行列Bと、の有限体GF(2)上での乗算を行うことで、変換を行う。ここで、変換後のサブデータをy,y,・・・,y15とする。 Next, in the matrix transformation θ R , as shown in the following equation (16), the sub-data (s ″ 0 , s ″ 1 ,..., S ″ 15 ) after the transformation with the byte replacement π R described above. Is performed by performing multiplication on a finite field GF (2 8 ) of a matrix of 4 rows and 4 columns and a transformation matrix B. Here, the transformed sub-data is represented by y 0 , Let y 1 ,..., y 15 .

Figure 2010044251
Figure 2010044251

ここで、変換行列Bは、ある列を入力列とし、当該入力列に対して変換行列Bによる変換を行った後の値の列を出力列とした場合に、入力列及び出力列に含まれる項の内、値が「0」ではない項が、5個以上になるような変換であれば、どのような変換行列を用いてもよい。   Here, the transformation matrix B is included in an input column and an output column when a column is an input column and a column of values after the transformation by the transformation matrix B is performed on the input column is an output column. Any transformation matrix may be used as long as the number of terms whose values are not “0” is five or more.

そして、このようにして算出されたサブデータ(y,y,・・・,y15)を、(17)式に示すように、サブデータ(s,s,・・・,s15)として、非線形変換γ、バイト置換π及び行列変換θによる変換を3回(合計4回)行うことで、算出されるサブデータ(y,y,・・・,y15)を(17)式のように連結することで、関数Fの出力Yとする。 Then, the sub data (y 0 , y 1 ,..., Y 15 ) calculated in this way is converted into sub data (s 0 , s 1 ,..., S, as shown in the equation (17). 15 ), the sub-data (y 0 , y 1 ,..., Y 15 calculated by performing the transformation by the nonlinear transformation γ R , byte substitution π R and matrix transformation θ R three times (four times in total). ) (17) by concatenating as type, the output Y of the function F R.

Figure 2010044251
Figure 2010044251

以上の関数Fでは、前述の関数Fと比較して、一つの入力に対して4回の処理で出力を行うため、安全性を高めることができる。なお、この4回という回数については、適宜変更可能である。 In more functions F R, as compared with the function F K described above, for performing the output in four processing for one input, it is possible to enhance the safety. In addition, about the frequency | count of this 4 times, it can change suitably.

図1に戻り、撹拌部126は、各ラウンドにおける平文ラウンド値を算出する処理を行う。   Returning to FIG. 1, the stirring unit 126 performs a process of calculating a plaintext round value in each round.

例えば、撹拌部126による平文ラウンド値の算出は、図5(平文ラウンド値変換関数fの概略図)に示す平文ラウンド値変換関数fを用いて行われる。 For example, calculation of plaintext round value by stirring section 126 is performed using the plaintext round value transformation function f R shown in FIG. 5 (a schematic diagram of plaintext round value transformation function f R).

図示するように、平文ラウンド値変換関数fは、第r−1ラウンドの平文ラウンド値x(r−1)(但し、r=0の場合は、メッセージブロック化部122でブロック化されたメッセージブロックM’)を8分割(ここでは、各々64ビット)した分割データであるx (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)を、それぞれ、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)に変換し、変換したこれらの値を連結することで、第rラウンドの平文ラウンド値x(r)を生成する関数である。 As shown in the figure, the plaintext round value conversion function f R is the plaintext round value x (r−1) of the ( r−1) -th round (however, when r = 0, the message blocked by the message blocking unit 122) The block M ′ i ) is divided into 8 (here, 64 bits each), which is divided data x 0 (r−1) , x 1 (r−1) , x 2 (r−1) , x 3 (r− 1) , x 4 (r-1) , x 5 (r-1) , x 6 (r-1) , x 7 (r-1) , respectively, x 0 (r) , x 1 (r) , By converting x 2 (r) , x 3 (r) , x 4 (r) , x 5 (r) , x 6 (r) , x 7 (r) and concatenating these converted values, This is a function that generates a plaintext round value x (r) of the r-th round.

具体的には、平文ラウンド値変換関数fでは、まず、撹拌部126が、平文ラウンド値記憶領域114に記憶されている第r−1ラウンドの平文ラウンド値(但し、r=0の場合は、メッセージブロック化部122でブロック化されたメッセージブロックM’)を、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)に8等分する。 Specifically, in the plaintext round value conversion function f R , first, the agitation unit 126 performs the r−1 round plaintext round value stored in the plaintext round value storage area 114 (provided that r = 0). , The message block M ′ i ) blocked by the message blocking unit 122 is converted into x 0 (r−1) , x 1 (r−1) , x 2 (r−1) , x 3 (r−1). , X 4 (r-1) , x 5 (r-1) , x 6 (r-1) , and x 7 (r-1) .

次に、撹拌部126は、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)、x (r−1)、x (r−1)、x (r−1)、をそれぞれ第rラウンドの平文ラウンド値の内のx (r)、x (r)、x (r)、x (r)、とする。 Next, the agitation unit 126 includes x 0 (r−1) , x 1 (r−1) , of the plaintext round values of the r−1-th round (in the case of r = 0, the message block M ′ i ) , x 2 (r-1) and x 3 (r-1) are respectively expressed as x 2 (r) , x 3 (r) , x 4 (r) and x 5 (r ) in the plaintext round value of the r-th round. )

次に、撹拌部126は、第一ラウンド鍵生成部124又は第二ラウンド鍵生成部125で生成されたラウンド鍵K(r)及び第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の排他的論理和である値pと、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の値pと、を連結した値pをF関数である関数Fに入力した出力値の内の上位ビット(ここでは、上位64ビット)の値qと(q=F(x (r−1) XOR K(r),x (r−1))、下位ビット(ここでは、下位64ビット)の値qと(q=F(x (r−1) XOR K(r),x (r−1))、を算出する。 Next, the agitation unit 126 generates the round key K (r) generated by the first round key generation unit 124 or the second round key generation unit 125 and the plaintext round value of the (r−1 ) -th round (when r = 0). , The value p H which is the exclusive OR of x 4 (r−1) in the message block M ′ i ) and the plaintext round value of the r−1-th round (if r = 0, the message block M ′ x 5 of the i) (the value p L of r-1), the upper bits of the output value of the value p which is connected to the input to the function F R is F function (here, the upper 64 bits) the value q H (q H = F R (x 4 (r-1) XOR K (r), x 5 (r-1)) H), ( in this case, the lower 64 bits) lower bit value q L of (q L = F R (x 4 (r-1) XOR K (r), x 5 (r-1)) L), to calculate the The

そして、撹拌部126は、値qと、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの平文ラウンド鍵のx (r)とする。 Then, the agitation unit 126 exclusively uses the value q H and x 6 (r−1) in the plaintext round value of the (r−1) -th round (in the case of r = 0, the message block M ′ i ). The logical sum is calculated, and the calculated value is set to x 0 (r) of the r-th plaintext round key.

また、撹拌部126は、値qと、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの平文ラウンド値のx (r)とする。 Further, the stirring section 126, the value q L, (in the case of r = 0, the message block M 'i) the plaintext round value of r-1 rounds and x 7 (r-1) of the exclusive of The logical sum is calculated, and the calculated value is set to x 1 (r) of the plaintext round value of the r-th round.

次に、撹拌部126は、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)、x (r−1)を、それぞれ第rラウンドの平文ラウンド値x (r)、x (r)とする。 Next, the stirring unit 126 calculates x 4 (r−1) and x 5 (r−1) in the plaintext round value of the (r−1) -th round (in the case of r = 0, the message block M ′ i ). , Respectively, are the plaintext round values x 6 (r) and x 7 (r) of the r-th round.

そして、撹拌部126は、以上のようにして算出したx (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)を連結して第rラウンドの平文ラウンド値として、第r−1ラウンドの鍵ラウンド値と入れ替えて平文ラウンド値記憶領域114に記憶する。 Then, the stirring section 126 x 0 is calculated as described above (r), x 1 (r ), x 2 (r), x 3 (r), x 4 (r), x 5 (r), x 6 (r) and x 7 (r) are concatenated and stored in the plaintext round value storage area 114 as a plaintext round value of the r-th round, replacing the key round value of the (r-1) -th round.

撹拌部126で使用するF関数である関数Fについては、上述の(13)式で示されているものと同様であるため、説明を省略する。 Since elements are the F function used in the stirring section 126 function F R, which is similar to that shown in the above (13), the description thereof is omitted.

入力部130は、情報の入力を受け付ける。   The input unit 130 receives input of information.

出力部140は、情報を出力する。   The output unit 140 outputs information.

以上に記載したハッシュ値生成装置100は、例えば、図6(コンピュータ900の概略図)に示すような、CPU(Central Processing Unit)901と、メモリ902と、HDD(Hard Disk Drive)等の外部記憶装置903と、CD−ROM(Compact Disk Read Only Memory)やDVD−ROM(Digital Versatile Disk Read Only Memory)等の可搬性を有する記憶媒体904に対して情報を読み書きする読書装置905と、キーボードやマウスなどの入力装置906と、ディスプレイなどの出力装置907と、通信ネットワークに接続するためのNIC(Network Interface Card)等の通信装置908と、を備えた一般的なコンピュータ900で実現できる。   The hash value generation device 100 described above is, for example, an external storage such as a CPU (Central Processing Unit) 901, a memory 902, and an HDD (Hard Disk Drive) as shown in FIG. 6 (schematic diagram of the computer 900). A device 903, a reading device 905 for reading / writing information from / to a portable storage medium 904 such as a compact disk read only memory (CD-ROM) or a digital versatile disk read only memory (DVD-ROM), a keyboard and a mouse It can be realized by a general computer 900 including an input device 906 such as a display, an output device 907 such as a display, and a communication device 908 such as a NIC (Network Interface Card) for connecting to a communication network.

例えば、記憶部110は、CPU901がメモリ902又は外部記憶装置903を利用することにより実現可能であり、制御部120は、外部記憶装置903に記憶されている所定のプログラムをメモリ902にロードしてCPU901で実行することで実現可能であり、入力部130は、CPU901が入力装置906を利用することで実現可能であり、出力部140は、CPU901が出力装置907を利用することで実現可能である。   For example, the storage unit 110 can be realized by the CPU 901 using the memory 902 or the external storage device 903, and the control unit 120 loads a predetermined program stored in the external storage device 903 into the memory 902. The input unit 130 can be realized by the CPU 901 using the input device 906, and the output unit 140 can be realized by the CPU 901 using the output device 907. .

この所定のプログラムは、読書装置905を介して記憶媒体904から、あるいは、通信装置908を介してネットワークから、外部記憶装置903にダウンロードされ、それから、メモリ902上にロードされてCPU901により実行されるようにしてもよい。また、読書装置905を介して記憶媒体904から、あるいは、通信装置908を介してネットワークから、メモリ902上に直接ロードされ、CPU901により実行されるようにしてもよい。   The predetermined program is downloaded from the storage medium 904 via the reading device 905 or from the network via the communication device 908 to the external storage device 903, and then loaded onto the memory 902 and executed by the CPU 901. You may do it. Alternatively, the program may be directly loaded on the memory 902 from the storage medium 904 via the reading device 905 or from the network via the communication device 908 and executed by the CPU 901.

次に、図7(ハッシュ値の算出処理を示す概略図)を用いて、ハッシュ値生成装置100がハッシュ値を算出する処理の概略を示す。   Next, with reference to FIG. 7 (schematic diagram showing hash value calculation processing), an outline of processing in which the hash value generation device 100 calculates hash values will be described.

まず、ハッシュ値生成装置100では、入力部130を介して、ハッシュ値を生成するメッセージMの入力を受け付け、ハッシュ値生成装置100の全体制御部121が、メッセージブロック化部122にメッセージMを入力する。   First, the hash value generation device 100 receives an input of a message M for generating a hash value via the input unit 130, and the overall control unit 121 of the hash value generation device 100 inputs the message M to the message blocking unit 122. To do.

そして、メッセージブロック化部122では、メッセージMをパディングして、512ビット毎のメッセージブロック(M’,・・・,M’;kは1以上の整数)に分割する。 Then, the message blocking unit 122 pads the message M and divides it into 512-bit message blocks (M ′ 0 ,..., M ′ k ; k is an integer of 1 or more).

次に、全体制御部121は、初期値記憶領域111に記憶されている算出値の初期値H−1と、メッセージブロック化部122でブロック化されたメッセージブロックM’のうち、最初のメッセージブロックM’と、を第一ブロック暗号fに入力することで、平文ラウンド値hを算出する。 Next, the overall control unit 121 sets the first message among the initial value H −1 of the calculated value stored in the initial value storage area 111 and the message block M i ′ blocked by the message blocking unit 122. By inputting the block M ′ 0 to the first block cipher f E , the plaintext round value h 0 is calculated.

ここで、第一ブロック暗号fを用いた処理は、後述するように、ラウンド定数生成部123、第一ラウンド鍵生成部124及び撹拌部126で行われる。 Here, processing using the first block cipher f E, as described later, the round-constant generation unit 123, is performed in the first round-key generation unit 124 and the stirring section 126.

そして、全体制御部121は、算出した平文ラウンド値hと、メッセージブロックM’と、の排他的論理和を算出することで、算出値を求め、求めた算出値と、次のメッセージブロックM’と、を第一ブロック暗号fに入力することで、平文ラウンド値hを算出する。なお、算出された算出値については、算出値記憶領域115に記憶される。 Then, the overall control unit 121 obtains a calculated value by calculating an exclusive OR of the calculated plaintext round value h 0 and the message block M ′ 0, and calculates the calculated value and the next message block By inputting M ′ 1 into the first block cipher f E , the plaintext round value h 1 is calculated. Note that the calculated value is stored in the calculated value storage area 115.

このような処理を、最後のメッセージブロックM’の直前のメッセージブロックM’k−1まで繰り返すことで、平文ラウンド値hk−1を算出する。 By repeating such processing up to the message block M ′ k−1 immediately before the last message block M ′ k , the plaintext round value h k−1 is calculated.

そして、全体制御部121は、平文ラウンド値hk−1と、メッセージブロックM’k−1と、の排他的論理和で算出される算出値と、最後のメッセージブロックM’と、を第二ブロック暗号f’に入力することにより、平文ラウンド値hを算出する。 Then, the overall control unit 121 determines the calculated value calculated by exclusive OR of the plaintext round value h k−1 and the message block M ′ k−1 and the last message block M ′ k . By inputting to the two-block cipher f ′ E , the plaintext round value h k is calculated.

ここで、第二ブロック暗号f’を用いた処理は、後述するように、ラウンド定数生成部123、第二ラウンド鍵生成部125及び撹拌部126で行われる。 Here, the process using the second block cipher f ′ E is performed by the round constant generation unit 123, the second round key generation unit 125, and the agitation unit 126, as described later.

そして、全体制御部121は、平文ラウンド値hと、最後のメッセージブロックM’と、の排他的論理和でハッシュ値Hを算出する。 Then, the overall control unit 121 calculates a hash value H k by exclusive OR of the plaintext round value h k and the last message block M ′ k .

このようなハッシュ値Hは、ハッシュ値記憶領域116に記憶される。 Such a hash value H k is stored in the hash value storage area 116.

なお、本発明におけるハッシュ値の算出処理(方法)は、図7に示した処理(方法)に限定されるわけではなく、第一ブロック暗号f又は、第二ブロック暗号f’の少なくとも何れか一方を利用すれば、どのようなものであってもよく。 Note that the hash value calculation processing (method) in the present invention is not limited to the processing (method) shown in FIG. 7, and at least one of the first block cipher f E and the second block cipher f ′ E. Anything can be used as long as one of them is used.

図8は、第一ブロック暗号fでの処理を示す概略図である。 Figure 8 is a schematic diagram showing the process in the first block cipher f E.

まず、ラウンド定数生成部123は、初期値記憶領域111に記憶されている定数ラウンド値の初期値を取得して、図2に示すような線形変換関数fを用いた処理を行うことにより、ラウンドr=0における定数ラウンド値c(0)を算出し、定数ラウンド値c(0)の下位64ビットを、ラウンドr=0におけるラウンド定数C(0)として算出する。 First, the round-constant generation unit 123 acquires the initial value of the constant round value stored in the initial value storage area 111, by performing the processing using the linear transformation function f c as shown in FIG. 2, calculating a constant round value c (0) in the round r = 0, to calculate the lower 64 bits of the constant round value c (0), as C (0) round constant in the round r = 0.

そして、ラウンド定数生成部123は、算出した定数ラウンド値c(0)を定数ラウンド値記憶領域112に記憶し、ラウンド定数C(0)を第一ラウンド鍵生成部124に出力する。 Then, the round constant generation unit 123 stores the calculated constant round value c (0) in the constant round value storage area 112, and outputs the round constant C (0) to the first round key generation unit 124.

次に、第一ラウンド鍵生成部124は、第一ブロック暗号fに入力されたメッセージブロックM’がメッセージブロックM’の場合には、初期値記憶領域111に記憶されている算出値の初期値を取得して、一方、第一ブロック暗号fに入力されたメッセージブロックM’がメッセージブロックM’ではない場合には、算出値記憶領域115に記憶されている前メッセージブロックM’における算出値を取得して、図3に示すような第一鍵ラウンド値変換関数fKを用いた処理を行うことにより、r=0における鍵ラウンド値k(0)を算出し、また、鍵ラウンド値k(0)の内のk (0)を、ラウンドr=0のラウンド鍵K(0)として算出する。 Next, when the message block M ′ i input to the first block cipher f E is the message block M ′ 0 , the first round key generation unit 124 calculates the calculated value stored in the initial value storage area 111. On the other hand, if the message block M ′ i input to the first block cipher f E is not the message block M ′ 0 , the previous message block stored in the calculated value storage area 115 is acquired. The key round value k (0) at r = 0 is calculated by obtaining the calculated value at M ′ i and performing the process using the first key round value conversion function f K as shown in FIG. Moreover, to calculate the k 3 (0) of the key round value k (0), as a round key K rounds r = 0 (0).

そして、第一ラウンド鍵生成部124は、鍵ラウンド値k(0)を鍵ラウンド値記憶領域113に記憶し、ラウンド鍵K(0)を撹拌部126に出力する。 Then, the first round key generation unit 124 stores the key round value k (0) in the key round value storage area 113 and outputs the round key K (0) to the stirring unit 126.

次に、撹拌部126は、第一ブロック暗号fに入力されたメッセージブロックM’を取得して、図5に示すような平文ラウンド値変換関数fを用いた処理を行うことにより、r=0における平文ラウンド値x(0)を算出し、平文ラウンド値記憶領域114に記憶する。 Next, the agitation unit 126 obtains the message block M ′ i input to the first block cipher f E and performs a process using the plaintext round value conversion function f R as shown in FIG. The plaintext round value x (0) at r = 0 is calculated and stored in the plaintext round value storage area 114.

以上で、第0ラウンドの処理を終了する。   This is the end of the zeroth round process.

次に、ラウンド定数生成部123は、定数ラウンド値記憶領域112に記憶されている定数ラウンド値c(0)を取得して、図2に示すような線形変換関数fを用いた処理を行うことにより、ラウンドr=1における定数ラウンド値c(1)を算出し、定数ラウンド値c(1)の下位64ビットを、ラウンドr=1におけるラウンド定数C(1)として算出する。 Then, the round-constant generation unit 123 obtains a constant round value stored in the constant round value storage area 112 c (0), performs a process using the linear transformation function f c as shown in FIG. 2 it allows to calculate the constant round value c (1) in the round r = 1, calculates the lower 64 bits of the constant round value c (1), as the round constant C (1) in the round r = 1.

そして、ラウンド定数生成部123は、算出した定数ラウンド値c(1)を、定数ラウンド値c(0)に置き換えて(いわゆる上書きして)、定数ラウンド値記憶領域112に記憶し、ラウンド定数C(1)を第一ラウンド鍵生成部124に出力する。 Then, the round constant generation unit 123 replaces the calculated constant round value c (1) with the constant round value c (0) (so-called overwriting), and stores the round constant C in the constant round value storage area 112. (1) is output to the first round key generation unit 124.

次に、第一ラウンド鍵生成部124は、鍵ラウンド値記憶領域113に記憶されている鍵ラウンド値k(0)を取得して、図3に示すような第一鍵ラウンド値変換関数fKを用いた処理を行うことにより、ラウンドr=1における鍵ラウンド値k(1)を算出し、また、鍵ラウンド値k(1)の内のk (1)を、ラウンドr=1のラウンド鍵K(1)として算出する。 Next, the first round key generation unit 124 acquires the key round value k (0) stored in the key round value storage area 113, and the first key round value conversion function f K as shown in FIG. Is used to calculate a key round value k (1) in round r = 1, and k 3 (1) in key round value k (1) is calculated as a round of round r = 1. Calculated as key K (1) .

そして、第一ラウンド鍵生成部124は、算出した鍵ラウンド値k(1)を、鍵ラウンド値k(0)に置き換えて(いわゆる上書きして)、鍵ラウンド値記憶領域113に記憶し、ラウンド鍵K(1)を撹拌部126に出力する。 Then, the first round key generation unit 124 replaces the calculated key round value k (1) with the key round value k (0) (so-called overwriting), stores it in the key round value storage area 113, and stores the round The key K (1) is output to the stirring unit 126.

次に、撹拌部126は、平文ラウンド値記憶領域114に記憶されている平文ラウンド値x(0)を取得して、図5に示すような平文ラウンド値変換関数fを用いた処理を行うことにより、ラウンドr=1における平文ラウンド値x(1)を算出し、算出した平文ラウンド値x(1)を、平文ラウンド値x(0)に置き換えて(いわゆる上書きして)、平文ラウンド値記憶領域114に記憶する。 Then, the stirring section 126 is performed by obtaining the plain text round value x stored in the plaintext round value storage area 114 (0), the process using the plaintext round value transformation function f R as shown in FIG. 5 Thus, the plaintext round value x (1) in round r = 1 is calculated, and the calculated plaintext round value x (1) is replaced with the plaintext round value x (0) (so-called overwriting) to obtain the plaintext round value. Store in the storage area 114.

以上で、第1ラウンドの処理を終了する。   This completes the first round of processing.

そして、以上に記載した第1ラウンドでの処理と同様の処理を、所定のラウンド(ここでは、第31ラウンド)まで繰り返すことで、第一ブロック暗号fでの処理を終了する。 Then, the same processing as in the first round described above, the predetermined rounds (here, the 31 round) By repeating until the process ends in the first block cipher f E.

図9は、第二ブロック暗号f’での処理を示す概略図である。 FIG. 9 is a schematic diagram showing processing in the second block cipher f ′ E.

まず、ラウンド定数生成部123は、初期値記憶領域111に記憶されている定数ラウンド値の初期値を取得して、図2に示すような線形変換関数fを用いた処理を行うことにより、ラウンドr=0における定数ラウンド値c(0)を算出し、定数ラウンド値c(0)の下位64ビットを、ラウンドr=0におけるラウンド定数C(0)として算出する。 First, the round-constant generation unit 123 acquires the initial value of the constant round value stored in the initial value storage area 111, by performing the processing using the linear transformation function f c as shown in FIG. 2, calculating a constant round value c (0) in the round r = 0, to calculate the lower 64 bits of the constant round value c (0), as C (0) round constant in the round r = 0.

そして、ラウンド定数生成部123は、算出した定数ラウンド値c(0)を定数ラウンド値記憶領域112に記憶し、ラウンド定数C(0)を第二ラウンド鍵生成部125に出力する。 Then, the round constant generation unit 123 stores the calculated constant round value c (0) in the constant round value storage area 112, and outputs the round constant C (0) to the second round key generation unit 125.

次に、第二ラウンド鍵生成部125は、算出値記憶領域115に記憶されている前メッセージブロックM’k−1における算出値を取得して、図4に示すような第二鍵ラウンド値変換関数f’を用いた処理を行うことにより、r=0における鍵ラウンド値k(0)を算出し、また、鍵ラウンド値k(0)の内のk (0)を、ラウンドr=0のラウンド鍵K(0)として算出する。 Next, the second round key generation unit 125 acquires the calculated value in the previous message block M ′ k−1 stored in the calculated value storage area 115, and converts the second key round value as shown in FIG. by performing the processing using the function f 'K, and calculates the key round value k (0) in the r = 0, also, k 3 of the key round value k (0) to (0), the round r = Calculated as 0 round key K (0) .

そして、第二ラウンド鍵生成部125は、鍵ラウンド値k(0)を鍵ラウンド値記憶領域113に記憶し、ラウンド鍵K(0)を撹拌部126に出力する。 Then, the second round key generation unit 125 stores the key round value k (0) in the key round value storage area 113 and outputs the round key K (0) to the stirring unit 126.

次に、撹拌部126は、第二ブロック暗号f’に入力されたメッセージブロックM’を取得して、図5に示すような平文ラウンド値変換関数fを用いた処理を行うことにより、r=0における平文ラウンド値x(0)を算出し、平文ラウンド値記憶領域114に記憶する。 Next, the agitation unit 126 obtains the message block M ′ k input to the second block cipher f ′ E and performs processing using the plaintext round value conversion function f R as shown in FIG. , R = 0 plaintext round value x (0) is calculated and stored in the plaintext round value storage area 114.

以上で、第0ラウンドの処理を終了する。   This is the end of the zeroth round process.

次に、ラウンド定数生成部123は、定数ラウンド値記憶領域112に記憶されている定数ラウンド値c(0)を取得して、図2に示すような線形変換関数fを用いた処理を行うことにより、ラウンドr=1における定数ラウンド値c(1)を算出し、定数ラウンド値c(1)の下位64ビットを、ラウンドr=1におけるラウンド定数C(1)として算出する。 Then, the round-constant generation unit 123 obtains a constant round value stored in the constant round value storage area 112 c (0), performs a process using the linear transformation function f c as shown in FIG. 2 it allows to calculate the constant round value c (1) in the round r = 1, calculates the lower 64 bits of the constant round value c (1), as the round constant C (1) in the round r = 1.

そして、ラウンド定数生成部123は、算出した定数ラウンド値c(1)を、定数ラウンド値c(0)に置き換えて(いわゆる上書きして)、定数ラウンド値記憶領域112に記憶し、ラウンド定数C(1)を第二ラウンド鍵生成部125に出力する。 Then, the round constant generation unit 123 replaces the calculated constant round value c (1) with the constant round value c (0) (so-called overwriting), and stores the round constant C in the constant round value storage area 112. (1) is output to the second round key generation unit 125.

次に、第二ラウンド鍵生成部125は、鍵ラウンド値記憶領域113に記憶されている鍵ラウンド値k(0)を取得して、図4に示すような第二鍵ラウンド値変換関数f’を用いた処理を行うことにより、ラウンドr=1における鍵ラウンド値k(1)を算出し、また、鍵ラウンド値k(1)の内のk (1)を、ラウンドr=1のラウンド鍵K(1)として算出する。 Next, the second round key generation unit 125 acquires the key round value k (0) stored in the key round value storage area 113, and the second key round value conversion function f ′ as shown in FIG. by performing the processing using the K, and calculates the key round value k (1) in the round r = 1, also the k 3 (1) of the key round value k (1), round r = 1 Calculated as round key K (1) .

そして、第二ラウンド鍵生成部125は、算出した鍵ラウンド値k(1)を、鍵ラウンド値k(0)に置き換えて(いわゆる上書きして)、鍵ラウンド値記憶領域113に記憶し、ラウンド鍵K(1)を撹拌部126に出力する。 Then, the second round key generation unit 125 replaces the calculated key round value k (1) with the key round value k (0) (so-called overwriting) and stores it in the key round value storage area 113, The key K (1) is output to the stirring unit 126.

次に、撹拌部126は、平文ラウンド値記憶領域114に記憶されている平文ラウンド値x(0)を取得して、図5に示すような平文ラウンド値変換関数fを用いた処理を行うことにより、ラウンドr=1における平文ラウンド値x(1)を算出し、算出した平文ラウンド値x(1)を、平文ラウンド値x(0)に置き換えて(いわゆる上書きして)、平文ラウンド値記憶領域114に記憶する。 Then, the stirring section 126 is performed by obtaining the plain text round value x stored in the plaintext round value storage area 114 (0), the process using the plaintext round value transformation function f R as shown in FIG. 5 Thus, the plaintext round value x (1) in round r = 1 is calculated, and the calculated plaintext round value x (1) is replaced with the plaintext round value x (0) (so-called overwriting) to obtain the plaintext round value. Store in the storage area 114.

以上で、第1ラウンドの処理を終了する。   This completes the first round of processing.

以上に記載した第1ラウンドでの処理と同様の処理を、所定のラウンド(ここでは、第31ラウンド)まで繰り返すことで、第二ブロック暗号f’での処理を終了する。 By repeating the same process as the process in the first round described above until a predetermined round (here, the 31st round), the process in the second block cipher f ′ E is completed.

図10は、ハッシュ値生成装置100におけるハッシュ値の生成処理を示すフローチャートである。   FIG. 10 is a flowchart showing hash value generation processing in the hash value generation device 100.

まず、ハッシュ値生成装置100は、入力部130を介してハッシュ値を生成する元となるメッセージMを取得する(S10)。   First, the hash value generation device 100 acquires a message M that is a source for generating a hash value via the input unit 130 (S10).

次に、メッセージブロック化部122は、入出部130を介して取得したメッセージを予め定められたデータ長に分割することによりk+1個のメッセージブロックM’を生成する(S11)。ここで、本実施形態においては、メッセージを512ビットのデータ長に分割するようにしている。 Next, the message blocking unit 122 generates k + 1 message blocks M ′ i by dividing the message acquired via the input / output unit 130 into a predetermined data length (S11). In this embodiment, the message is divided into 512-bit data lengths.

次に、全体制御部121は、定数ラウンド値記憶領域112、鍵ラウンド値記憶領域113、平文ラウンド値記憶領域114、算出値記憶領域115及びハッシュ値記憶領域116に記憶されている情報のリセットを行う(S12)。具体的には、全てのビット値を「0」にする。   Next, the overall control unit 121 resets the information stored in the constant round value storage area 112, the key round value storage area 113, the plaintext round value storage area 114, the calculated value storage area 115, and the hash value storage area 116. Perform (S12). Specifically, all bit values are set to “0”.

次に、全体制御部121は、メッセージブロックのカウンタであるメッセージカウンタiの値を初期化する(S13)。ここでは、メッセージカウンタiの値に「0」を代入する。   Next, the overall control unit 121 initializes the value of the message counter i, which is a message block counter (S13). Here, “0” is substituted for the value of the message counter i.

次に、全体制御部121は、メッセージカウンタiの値が、i=kとなっているか否かを判断する(S14)。   Next, the overall control unit 121 determines whether or not the value of the message counter i is i = k (S14).

ステップS14で、i=kとなっていない場合には(ステップS14でNo)、ステップS15に進み、i=kとなっている場合には(ステップS14でYes)、ステップS21に進む。   If i = k is not satisfied in step S14 (No in step S14), the process proceeds to step S15. If i = k is satisfied (Yes in step S14), the process proceeds to step S21.

ステップS15では、全体制御部121は、ラウンドのカウンタであるラウンドカウンタrに初期値「0」を代入する。   In step S15, the overall control unit 121 assigns an initial value “0” to the round counter r, which is a round counter.

次に、全体制御部121は、ラウンドカウンタrの値が、予め定められた第一ラウンド数(ここでは、ROUND NUM=31)に対して、r=(ROUND NUM)+1の関係にあるか否かを判断する(S16)。ステップS16において、r=(ROUND NUM)+1の関係にある場合には、ステップS19に進み、r=(ROUND NUM)+1の関係にない場合には、ステップS17に進む。   Next, the overall control unit 121 determines whether the value of the round counter r has a relationship of r = (ROUND NUM) +1 with respect to a predetermined first round number (here, ROUND NUM = 31). Is determined (S16). If it is determined in step S16 that r = (ROUND NUM) +1, the process proceeds to step S19. If r = (ROUND NUM) +1 is not satisfied, the process proceeds to step S17.

ステップS17では、ラウンド定数生成部123、第一ラウンド鍵生成部124及び撹拌部126において、第一ブロック暗号fを用いて、定数ラウンド値、鍵ラウンド値及び平文ラウンド値を算出し、定数ラウンド値記憶領域112、鍵ラウンド値記憶領域113及び平文ラウンド値記憶領域114に記憶されている情報を更新する。 In step S17, the round constant generation unit 123, the first round-key generation unit 124 and the stirring section 126, using the first block cipher f E, calculated constant round value, the key round value and the plaintext round value, constant round Information stored in the value storage area 112, the key round value storage area 113, and the plaintext round value storage area 114 is updated.

次に、全体制御部121は、ラウンドカウンタrの値に「1」をインクリメントして、ステップS16に戻って処理を繰り返す。   Next, the overall control unit 121 increments the value of the round counter r by “1”, returns to step S16, and repeats the process.

また、ステップS19では、全体制御部121は、平文ラウンド値記憶領域114に記憶されている平文ラウンド値と、メッセージブロックM’と、の排他的論理和を算出することで算出値を算出し、算出した算出値で算出値記憶領域115に記憶されている情報を更新する。 In step S19, the overall control unit 121 calculates a calculated value by calculating an exclusive OR of the plaintext round value stored in the plaintext round value storage area 114 and the message block M ′ i. The information stored in the calculated value storage area 115 is updated with the calculated value.

そして、全体制御部121は、メッセージカウンタiの値に「1」をインクリメントして(S20)、ステップS14に戻って処理を繰り返す。   The overall control unit 121 increments the value of the message counter i by “1” (S20), returns to step S14, and repeats the process.

一方、ステップS14において、i=kとなっている場合には(ステップS14でYes)、ステップS21において、全体制御部121は、ラウンドのカウンタであるラウンドカウンタrに初期値「0」を代入する。   On the other hand, if i = k in step S14 (Yes in step S14), in step S21, the overall control unit 121 assigns an initial value “0” to the round counter r, which is a round counter. .

次に、全体制御部121は、ラウンドカウンタrの値が、予め定められた第二ラウンド数(ここでは、ROUND NUM=31)に対して、r=(ROUND NUM)+1の関係にあるか否かを判断する(S22)。   Next, the overall control unit 121 determines whether or not the value of the round counter r has a relationship of r = (ROUND NUM) +1 with respect to a predetermined second round number (here, ROUND NUM = 31). Is determined (S22).

そして、ステップS22において、r=(ROUND NUM)+1の関係にある場合には(ステップS22でYes)、ステップS25に進み、r=(ROUND NUM)+1の関係にない場合には(ステップS22でNo)、ステップS23に進む。   In step S22, if r = (ROUND NUM) +1 (Yes in step S22), the process proceeds to step S25. If r = (ROUND NUM) +1 is not satisfied (in step S22). No), it proceeds to step S23.

ステップS23では、ラウンド定数生成部123、第二ラウンド鍵生成部125及び撹拌部126において、第二ブロック暗号f’を用いて、定数ラウンド値、鍵ラウンド値及び平文ラウンド値を算出し、定数ラウンド値記憶領域112、鍵ラウンド値記憶領域113及び平文ラウンド値記憶領域114に記憶されている情報を更新する。 In step S23, the round constant generation unit 123, the second round key generation unit 125, and the stirring unit 126 calculate the constant round value, the key round value, and the plaintext round value using the second block cipher f ′ E , Information stored in the round value storage area 112, the key round value storage area 113, and the plaintext round value storage area 114 is updated.

次に、全体制御部121は、ラウンドカウンタrの値に「1」をインクリメントして(S24)、ステップS22に戻って処理を繰り返す。   Next, the overall control unit 121 increments the value of the round counter r by “1” (S24), returns to step S22, and repeats the process.

また、ステップS25では、全体制御部121は、平文ラウンド値記憶領域114に記憶されている平文ラウンド値と、メッセージブロックM’と、の排他的論理和を算出することでハッシュ値を算出し、ハッシュ値記憶領域116に記憶されている情報を更新する。 Further, in step S25, the overall control unit 121 calculates a plaintext round value stored in the plaintext round value storage area 114, a hash value by calculating the message block M 'k, the exclusive OR of The information stored in the hash value storage area 116 is updated.

以上のように、本実施形態においては、512ビットにおけるブロック暗号を用いているため、理論的安全性と実装安全性が保証されたハッシュ関数を提供することができる。   As described above, in the present embodiment, since a 512-bit block cipher is used, it is possible to provide a hash function that guarantees theoretical security and mounting security.

図11は、本発明の第二の実施形態であるハッシュ値生成装置200の概略図である。   FIG. 11 is a schematic diagram of a hash value generation device 200 according to the second embodiment of the present invention.

ここで、本実施形態においては、256ビットのハッシュ値を生成するようにしている。   Here, in this embodiment, a 256-bit hash value is generated.

図示するように、ハッシュ値生成装置200は、記憶部210と、制御部220と、入力部130と、出力部140と、を備え、第一の実施形態と比較して、記憶部210及び制御部220が異なっているため、以下これらの異なっている点に関連する事項について説明する。   As illustrated, the hash value generation device 200 includes a storage unit 210, a control unit 220, an input unit 130, and an output unit 140. Compared to the first embodiment, the storage unit 210 and the control unit Since the portion 220 is different, matters related to these different points will be described below.

記憶部210は、初期値記憶領域211と、定数ラウンド値記憶領域112と、鍵ラウンド値記憶領域113と、平文ラウンド値記憶領域114と、算出値記憶領域115と、ハッシュ値記憶領域116と、を備え、第一の実施形態と比較して、初期値記憶領域211に記憶されている情報が異なっているため、以下この異なっている点に関連する事項について説明する。   The storage unit 210 includes an initial value storage area 211, a constant round value storage area 112, a key round value storage area 113, a plaintext round value storage area 114, a calculated value storage area 115, a hash value storage area 116, Since the information stored in the initial value storage area 211 is different from that of the first embodiment, items related to the different points will be described below.

初期値記憶領域211には、ハッシュ値を生成する際の初期値を特定する情報が格納される。   The initial value storage area 211 stores information for specifying an initial value when generating a hash value.

本実施形態においては、ハッシュ値を生成する際の初期値として、定数ラウンド値の初期値と、算出値の初期値と、が記憶される。   In the present embodiment, an initial value of a constant round value and an initial value of a calculated value are stored as initial values when generating a hash value.

ここで、定数ラウンド値の初期値は、例えば、c(−1)=0xffffffffffffffffといった定数が記憶される。 Here, as the initial value of the constant round value, for example, a constant such as c (−1) = 0xffffffffffffffff is stored.

また、算出値の初期値は、H−1=(H−1.0,H−1.1,・・・,H−1.7)であり、H−1.0=0x00000000、H−1.1=0x00000000、H−1.2=0x00000000、H−1.3=0x00000000、H−1.4=0x00000000、H−1.5=0x00000000、H−1.6=0x00000000、H−1.7=0x00000000、といった定数が記憶される。 The initial value of the calculated value is H −1 = (H −1.0 , H −1.1 ,..., H −1.7 ), and H −1.0 = 0x00000000, H −1. .1 = 0x00000000, H- 1.2 = 0x00000000, H- 1.3 = 0x00000000, H- 1.4 = 0x00000000, H- 1.5 = 0x00000000, H- 1.6 = 0x00000000, H- 1.7 = 0x00000000 is stored.

なお、定数ラウンド値及び算出値の初期値に使用される定数はこれらに限定されるわけではなく、例えば、疑似乱数生成器等で生成された乱数を使用することも可能である。   The constants used for the constant round value and the initial value of the calculated value are not limited to these. For example, a random number generated by a pseudo-random number generator or the like can be used.

制御部220は、全体制御部221と、メッセージブロック化部222と、ラウンド定数生成部223と、第一ラウンド鍵生成部224と、第二ラウンド鍵生成部225と、撹拌部226と、を備える。   The control unit 220 includes an overall control unit 221, a message blocking unit 222, a round constant generation unit 223, a first round key generation unit 224, a second round key generation unit 225, and a stirring unit 226. .

全体制御部221は、ハッシュ値生成装置200における処理の全体を制御する。   The overall control unit 221 controls the overall processing in the hash value generation device 200.

特に、本実施形態においては、ハッシュ値を算出するメッセージをブロック化したメッセージブロックを管理する処理や、ラウンド定数生成部223、第一ラウンド鍵生成部224、第二ラウンド鍵生成部225及び撹拌部226でのラウンドを管理する処理を行う。   In particular, in the present embodiment, a process for managing a message block obtained by blocking a message for calculating a hash value, a round constant generation unit 223, a first round key generation unit 224, a second round key generation unit 225, and a stirring unit A process for managing the round at 226 is performed.

また、全体制御部221は、全てのラウンドを経て撹拌部226において算出された平文ラウンド値と、当該ラウンドでの処理の対象となったメッセージブロックと、の排他的論理和を算出することで、算出値を算出する。   Further, the overall control unit 221 calculates the exclusive OR of the plaintext round value calculated in the stirring unit 226 through all rounds and the message block that is the target of processing in the round, Calculate the calculated value.

さらに、全体制御部221は、全てのメッセージブロック及び全てのラウンドを経て撹拌部226において算出された平文ラウンド値と、最後のメッセージブロックと、の排他的論理和を算出することで、ハッシュ値を算出する。   Furthermore, the overall control unit 221 calculates the exclusive OR of the plaintext round value calculated by the agitation unit 226 through all message blocks and all rounds, and the last message block, thereby calculating the hash value. calculate.

メッセージブロック化部222は、ハッシュ値を算出する対象となるメッセージを予め定められたビット長のブロックに分割し、パディングを行う。   The message blocking unit 222 divides a message for which a hash value is to be calculated into blocks having a predetermined bit length and performs padding.

ここで、本実施形態では、ハッシュ値を算出する対象となるメッセージを256ビット毎のブロックに分割するようにしているが、このような態様に限定されるわけではない。   Here, in the present embodiment, a message for which a hash value is calculated is divided into blocks each having 256 bits, but the present invention is not limited to such a mode.

また、例えば、本実施形態におけるパディングは、以下のようにして行う。   For example, padding in the present embodiment is performed as follows.

まず、メッセージブロック化部222は、ハッシュ値を算出する対象となるメッセージのビット数が、256ビットで割り切れる場合には、当該メッセージを256ビット毎に分割することで各々のメッセージブロックを生成するとともに、メッセージブロックを追加して最後のメッセージブロックとする。   First, when the number of bits of a message whose hash value is to be calculated is divisible by 256 bits, the message blocking unit 222 generates each message block by dividing the message into 256 bits. The message block is added as the last message block.

そして、メッセージブロック化部222は、この最後のメッセージブロックにおいて、先頭ビットに「1」、先頭ビットの次のビットから数えて191ビットまでに「0」、最後の64ビットにメッセージのビット長、を特定する情報を格納する。   Then, in this last message block, the message blocking unit 222 sets “1” as the first bit, “0” up to 191 bits from the next bit after the first bit, bit length of the message as the last 64 bits, Stores information that identifies

次に、メッセージブロック化部222は、ハッシュ値を算出する対象となるメッセージのビット数が、256ビットで割り切れない場合には、当該メッセージを256ビット毎に分割することで各々のメッセージブロックを生成するとともに、分割した最後尾のメッセージブロックには最後のビットまで「0」を特定する情報を格納することで、256ビットにし、さらに、メッセージブロックを追加して最後のメッセージブロックとする。   Next, when the number of bits of the message whose hash value is to be calculated is not divisible by 256 bits, the message blocking unit 222 generates each message block by dividing the message into 256 bits. At the same time, information specifying “0” up to the last bit is stored in the last message block thus divided to 256 bits, and a message block is further added to form the last message block.

そして、メッセージブロック化部122は、この最後のメッセージブロックにおいて、先頭ビットから数えて192ビットまでに「0」、最後の64ビットにメッセージのビット長、を特定する情報を格納する。   Then, the message blocking unit 122 stores information specifying “0” up to 192 bits counted from the first bit and the bit length of the message in the last 64 bits in the last message block.

なお、本実施形態においては、ハッシュ値を算出するメッセージをMとし、パディングにより、256ビットで割り切れるようなビット長にされたメッセージをM’とし、メッセージブロックの数をk+1(kは1以上の整数)とし、各々のメッセージブロックをM’(iは、0≦i≦kなる整数)とする。 In the present embodiment, a message for calculating a hash value is M, a message having a bit length divisible by 256 bits by padding is M ′, and the number of message blocks is k + 1 (k is 1 or more). Integer), and each message block is M ′ i (i is an integer satisfying 0 ≦ i ≦ k).

ラウンド定数生成部223は、各ラウンドにおける定数ラウンド値及びラウンド定数を算出する。   The round constant generation unit 223 calculates a constant round value and a round constant in each round.

本実施形態においても、ラウンド定数生成部223は、最初のラウンドの場合には、初期値記憶領域211に記憶されている定数ラウンド値の初期値から、または、最初のラウンドではない場合には、定数ラウンド値記憶領域212に記憶されている前ラウンドにおける定数ラウンド値から、線形変換関数fを用いて、各ラウンドにおける定数ラウンド値を算出する。 Also in the present embodiment, the round constant generation unit 223, in the case of the first round, from the initial value of the constant round value stored in the initial value storage area 211, or if it is not the first round, from the constant round value in the previous round, which is stored in the constant round value storage area 212, using a linear transformation function f c, calculates a constant round value in each round.

例えば、図2に示すように、ラウンド定数生成部223は、前ラウンド(r−1)の定数ラウンド値c(r−1)(r=0のときは、定数ラウンド値の初期値)を関数fに入力して算出された値の上位ビット(本実施形態では、上位32ビット)と下位ビット(本実施形態では、下位32ビット)を入れ替えることにより、今ラウンド(r)の定数ラウンド値c(r)を算出する。 For example, as shown in FIG. 2, the round constant generation unit 223 uses the constant round value c (r−1) of the previous round (r−1) ( the initial value of the constant round value when r = 0) as a function. The constant round value of the current round (r) is obtained by switching the upper bits (upper 32 bits in the present embodiment) and lower bits (lower 32 bits in the present embodiment) of the value calculated by inputting to f L c (r) is calculated.

即ち、上述の(1)式及び(2)式に示されるようにして、前ラウンドの定数ラウンド値c(r−1)(r=0のときは、定数ラウンド値の初期値)から今ラウンドの定数ラウンド値c(r)を算出する。 That is, as shown in the above equations (1) and (2), the current round is calculated from the constant round value c (r−1) of the previous round ( the initial value of the constant round value when r = 0). A constant round value c (r) of is calculated.

また、関数fは、線形フィードバックシフトレジスタ(LFSR)を用いる。 The function f L uses a linear feedback shift register (LFSR).

一般に、LFSRは多項式で決定されるが、ここではLFSRを決定する多項式g(x)を、下記の(18)式のように定義する。   Generally, the LFSR is determined by a polynomial. Here, a polynomial g (x) for determining the LFSR is defined as the following equation (18).

Figure 2010044251
Figure 2010044251

但し、g(x)は有限体GF(2)において定義される多項式である。   However, g (x) is a polynomial defined in the finite field GF (2).

なお、関数fの擬似コードは、下記の(19)のように示される。 Incidentally, the pseudo-code for the function f L is expressed by the following (19).

Figure 2010044251
Figure 2010044251

ここで、「<<X」は、Xビットの左シフトを示し、「>>Y」は、Yビットの右シフトを示し、「^」は、排他的論理和を示し、「&」は、論理積を示し、「|」は、論理和を示す。また、hは、定数ラウンド値c(r−1)における上位ビット(上位32ビット)、lは、定数ラウンド値c(r−1)における下位ビット(下位32ビット)である。 Here, “<< X” indicates a left shift of X bits, “>> Y” indicates a right shift of Y bits, “^” indicates an exclusive OR, and “&” “|” Indicates a logical product, and “|” indicates a logical sum. Further, h is upper bits of the constant round value c (r-1) (upper 32 bits), l is the lower-order bits of the constant round value c (r-1) (low-order 32 bits).

そして、ラウンド定数生成部223は、算出したラウンド(r)での定数ラウンド値c(r)の下位32ビットを、第rラウンドにおけるラウンド定数C(r)として、第一ラウンド鍵生成部224又は第二ラウンド鍵生成部225に出力する。 Then, the round constant generation unit 223 sets the lower 32 bits of the constant round value c (r) in the calculated round (r) as the round constant C (r) in the r-th round, or the first round key generation unit 224 or The data is output to the second round key generation unit 225.

以下に、R=96の場合におけるC(r)の一例を掲げる。 An example of C (r) in the case of R = 96 is given below.

(0)=0x3b29b693、C(1)=0x90a58f8a、C(2)=0x472ae357、C(3)=0x42963e28、C(4)=0xd87dc430、C(5)=0x650288d7、C(6)=0x0ead60b6、C(7)=0xfb50532a、C(8)=0x9139bbc3、C(9)=0x299705c5、C(10)=0xef6ad616、C(11)=0xa65c1715、C(12)=0x797d1135、C(13)=0x32fc654e、C(14)=0x21220db8、C(15)=0x607dac22、C(16)=0x848836e0、C(17)=0x4520f9e5、C(18)=0xb9ace29a、C(19)=0xd055aef9、C(20)=0x4d3fb373、C(21)=0x8580f288、C(22)=0x5ba4bdbb、C(23)=0xbd8ff33a、C(24)=0xaa44bf81、C(25)=0x5db3f5f3、C(26)=0xa912fe04、C(27)=0xb2199ea1、C(28)=0x0fc7c10b、C(29)=0xc8667a84、C(30)=0x3f1f042d、C(31)=0xe54fa37c、C(32)=0x57f029af、C(33)=0x51e8c49c、C(34)=0x309ad6ca、C(35)=0x28f96206、C(36)=0x69e76232、C(37)=0xa3e58818、C(38)=0x634bc1a5、C(39)=0x241a197a、C(40)=0x49f94ff8、C(41)=0x3be45cf2、C(42)=0xe333768c、C(43)=0x441d4ad3、C(44)=0x481b935c、C(45)=0x7f2f5b3a、C(46)=0x4f343d06、C(47)=0x93e71c9e、C(48)=0x538a846f、C(49)=0xe4104b62、C(50)=0x8afc58d1、C(51)=0xff1b5dff、C(52)=0x807d5a5f、C(53)=0x38bb3e91、C(54)=0xaa795066、C(55)=0xe2ecfa45、C(56)=0xa9e54199、C(57)=0x4f65a079、C(58)=0x0c193f7e、C(59)=0xf940c888、C(60)=0x9be8c4e3、C(61)=0x21d56b4d、C(62)=0xc42f2a96、C(63)=0x8755ad35、C(64)=0xd46ae335、C(65)=0xb6da8dcf、C(66)=0x957dc5b9、C(67)=0x70e60e27、C(68)=0x55f716e4、C(69)=0x074e71f0、C(70)=0x38862be6、C(71)=0xb6b5feda、C(72)=0xe218af99、C(73)=0xdad7fb69、C(74)=0x4cb4f709、C(75)=0x04059dd2、C(76)=0x5d89ac52、C(77)=0xbb9a4e52、C(78)=0xb2f0f825、C(79)=0x45e50053、C(80)=0xcbc3e094、C(81)=0xd3424821、C(82)=0x4055f227、C(83)=0x225350f2、C(84)=0x6e0db8ea、C(85)=0x22c17ad2、C(86)=0x7ce0aac4、C(87)=0x2089d252、C(88)=0x3754e27c、C(89)=0x29ab7052、C(90)=0xdd5389f0、C(91)=0xa6adc149、C(92)=0xb1986ead、C(93)=0x313b3c3f、C(94)=0xc661bab4、C(95)=0xc4ecf0fd。 C (0) = 0x3b29b693, C (1) = 0x90a58f8a, C (2) = 0x472ae357, C (3) = 0x42963e28, C (4) = 0xd87dc430, C (5) = 0x650288d7, C (6) = 0x0ead60b6, C (7) = 0xfb50532a, C ( 8) = 0x9139bbc3, C (9) = 0x299705c5, C (10) = 0xef6ad616, C (11) = 0xa65c1715, C (12) = 0x797d1135, C (13) = 0x32fc654e, C ( 14) = 0x21220db8, C (15 ) = 0x607dac22, C (16) = 0x848836e0, C (17) = 0x4520f9e5, C (18) = 0xb9ace29a, C (19) = 0xd055aef9, C (20) = 0x4d3fb373, C (21 ) = 0x8580f288, C (22) = 0x5ba4bdbb, C (23) = 0xbd8ff33a, C (24) = 0xaa44bf81, C (25) = 0x5db3f5f3, C (26) = 0xa912fe04, C (27) = 0xb2199ea1, C (28) = 0x0fc7c10b, C (29) = 0xc8667a84, C (30) = 0x3f1f042d, C ( 31) = 0xe54fa37c, C (32 ) = 0x57f029af, C (33) = 0x51e8c49c, C (34) = 0x309ad6ca, C (35) = 0x28f96206, C (36) = 0x69e76232, C (37) = 0xa3e58818, C (38 ) = 0x634bc1a5, C (39) = 0x241a197a, C (40) = 0x49f94ff8, C (41) = 0x3be45cf2, C (42) = 0xe333768c, C (43) = 0x441d4ad3, C (44) = 0x481b935c, C (45) = 0x7f2f5b3a, C (46) = 0x4f343d06, C (47) = 0x93e71c9e, C (48) = 0x538a846f, C (49) = 0xe4104b62, C (50) = 0x8afc58d1, C (51) = 0xff1b5dff, C (52) = 0x807d5a5f, C (53) = 0x38bb3e91, C (54) = 0xaa795066, C (55) = 0xe2ecfa45, C (56) = 0xa9e54199, C (57) = 0x4f65a079, C (58) = 0x0c193f7e, 0 (59) , C (60) = 0x9be8c4e3, C (61) = 0x21d56b4d, C (62) = 0xc42f2a96, C (63) = 0x8755ad35, C (64) = 0xd46ae335, C (65) = 0xb6da8dcf, C (66) = 0x957dc5b9, C (67) = 0x70e60e27, C (68) 0x55f716e4, C (69) = 0x074e71f0, C (70) = 0x38862be6, C (71) = 0xb6b5feda, C (72) = 0xe218af99, C (73) = 0xdad7fb69, C (74) = 0x4cb4f709, x ( 040 ) 0 (75) C (76) = 0x5d89ac52, C (77) = 0xbb9a4e52, C (78) = 0xb2f0f825, C (79) = 0x45e50053, C (80) = 0xcbc3e094, C (81) = 0xd3424821, C (82) = 0x4055 C (83) = 0x225350f2, C (84) = 0x6e0db8ea, C (85) = 0x22c17ad2, C (86) = 0x7ce0aac4, C (87) = 0x2089d252, C (88) = 0x3754e27c, C (89) = 0x29ab7052, C (90) = 0xdd5389f0, C (91) = 0xa6adc 149, C (92) = 0xb1986ead, C (93) = 0x313b3c3f, C (94) = 0xc661bab4, C (95) = 0xc4ecf0fd.

第一ラウンド鍵生成部224は、各ラウンドにおける鍵ラウンド値及びラウンド鍵を算出する処理を行う。   The first round key generation unit 224 performs processing for calculating a key round value and a round key in each round.

例えば、第一ラウンド鍵生成部224による鍵ラウンド値の算出は、上述の図3に示す第一鍵ラウンド値変換関数fKを用いて行われる。 For example, the calculation of the key round value by the first round key generation unit 224 is performed using the first key round value conversion function f K shown in FIG.

図3に示すように、第一鍵ラウンド値変換関数fKは、第r−1ラウンドの鍵ラウンド値k(r−1)(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値、または、初期値記憶領域211に記憶されている算出値の初期値)を8分割(本実施形態においては、各々32ビット)した分割データであるk (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)を、それぞれ、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)に変換し、変換したこれらの値を連結することで、第rラウンドの鍵ラウンド値k(r)を生成する関数である。 As shown in FIG. 3, the first key round value conversion function f K is the key round value k (r−1) of the ( r−1) -th round (however, when r = 0, it is stored in the calculated value storage area 115). Calculated value or the initial value of the calculated value stored in the initial value storage area 211) is divided into eight pieces (in this embodiment, 32 bits each), k 0 (r−1). , K 1 (r-1) , k 2 (r-1) , k 3 (r-1) , k 4 (r-1) , k 5 (r-1) , k 6 (r-1) , k 7 (r-1) is replaced with k 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 (r) , k 6 (r, respectively. ) , K 7 (r), and these converted values are concatenated to generate the r-th round key round value k (r) .

なお、第一鍵ラウンド値変換関数fKを用いた処理に関しては、ビット数が異なるだけで、第一の実施形態と同様であるため、詳細な説明は省略する。 Note that the processing using the first key round value conversion function f K is the same as that of the first embodiment except that the number of bits is different, and thus detailed description thereof is omitted.

次に、第一ラウンド鍵生成部224で使用するF関数である関数Fについて説明する。 Next, the function F K that is the F function used in the first round key generation unit 224 will be described.

本実施形態における関数Fも、上述の(5)式に示すように、非線形変換γと、線形変換λと、の合成変換を行う関数であり、線形変換λは、バイト置換πと、行列変換θと、からなる。 The function F K in the present embodiment is also a function that performs a combined transformation of the nonlinear transformation γ K and the linear transformation λ k as shown in the above equation (5), and the linear transformation λ k is a byte substitution π. K and matrix transformation θ K.

ここで、関数Fへの入力をX、関数Fからの出力をYとして説明する。 Here, describing the input to the function F K X, the output from the function F K as Y.

本実施形態においては、X及びYは、64ビットのデータである。   In the present embodiment, X and Y are 64-bit data.

まず、非線形変換γでは、値Xを8ビット毎のサブデータ(s,s,・・・,s)に分割して、分割した各々のサブデータを、下記の(20)式に示すように、置換テーブルSboxを用いて非線形変換を行う。ここで、変換後のサブデータをs’,s’,・・・,s’とする。 First, in the non-linear transformation γ K , the value X is divided into sub-data (s 0 , s 1 ,..., S 7 ) every 8 bits, and each sub-data is divided into the following equation (20) As shown in FIG. 5, nonlinear conversion is performed using the replacement table Sbox. Here, it is assumed that the converted sub data is s ′ 0 , s ′ 1 ,..., S ′ 7 .

Figure 2010044251
Figure 2010044251

なお、置換テーブルSboxは、例えば、上記の(7)で示される。   The replacement table Sbox is represented by (7) above, for example.

次に、行列変換θでは、上記の非線形変換γでの変換後のサブデータ(s’,s’,・・・,s’)を4行2列の行列にして、下記の(21)式に示すように、変換行列Aとの有限体GF(2)上での乗算を行うことで、変換を行う。ここで、変換後のサブデータをs”,s”,・・・,s”とする。 Next, in the matrix transformation θ K , the sub-data (s ′ 0 , s ′ 1 ,..., S ′ 7 ) after the transformation by the nonlinear transformation γ K is converted into a 4 × 2 matrix and the following As shown in equation (21), the transformation is performed by multiplying the transformation matrix A on the finite field GF (2 8 ). Here, the sub-data of the converted s "0, s" 1, ···, and s "7.

Figure 2010044251
Figure 2010044251

ここで、変換行列Aは、ある列を入力列とし、当該入力列に対して変換行列Aによる変換を行った後の値の列を出力列とした場合に、入力列及び出力列に含まれる項の内、値が「0」ではない項が、5個以上になるような変換であれば、どのような変換行列を用いてもよい。   Here, the transformation matrix A is included in an input column and an output column when a column is an input column and a column of values after the transformation by the transformation matrix A is performed on the input column is an output column. Any transformation matrix may be used as long as the number of terms whose values are not “0” is five or more.

次に、バイト置換πでは、下記の(22)式に示すように、行列変換θで変換されたサブデータ(s”,s”,・・・,s”)のうちの半分のデータの入れ替えを行う。なお、変換後のサブデータをy,y,・・・,yとする。 Next, in the byte replacement π K , as shown in the following equation (22), among the sub data (s ″ 0 , s ″ 1 ,..., S ″ 7 ) converted by the matrix conversion θ K performing replacement of half of the data. in addition, the sub-converted data y 0, y 1, · · ·, and y 7.

Figure 2010044251
Figure 2010044251

そして、以上のようにして算出されたサブデータ(y,y,・・・,y)を(23)式のように連結することで、関数Fの出力Yとする。 Then, the sub-data (y 0 , y 1 ,..., Y 7 ) calculated as described above are connected as shown in the equation (23) to obtain the output Y of the function F K.

Figure 2010044251
Figure 2010044251

以上の関数Fでは、後述する関数Fと比較して、一つの入力に対して一回の処理で出力を行うため、計算量が少なくてすみ、軽実装が可能となる。 In more functions F K, as compared to the function F R described later, for performing an output in one of the processing for one input, requires less amount of calculation, it is possible to light implementation.

図11に戻り、第二ラウンド鍵生成部225は、各ラウンドにおける鍵ラウンド値及びラウンド鍵を算出する処理を行う。   Returning to FIG. 11, the second round key generation unit 225 performs a process of calculating a key round value and a round key in each round.

例えば、第二ラウンド鍵生成部225による鍵ラウンド値の算出は、図4に示すような第二鍵ラウンド値変換関数f’を用いて行われる。 For example, the calculation of the key round value by the second round key generation unit 225 is performed using a second key round value conversion function f ′ K as shown in FIG.

図4に示すように、第二鍵ラウンド値変換関数f’は、第r−1ラウンドの鍵ラウンド値k(r−1)(但し、r=0の場合は、算出値記憶領域115に記憶されている算出値、または、初期値記憶領域111に記憶されている算出値の初期値)を8分割(本実施形態では、各々32ビット)した分割データであるk (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)、k (r−1)を、それぞれ、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)、k (r)に変換し、変換したこれらの値を連結することで、第rラウンドの鍵ラウンド値k(r)を生成する関数である。 As shown in FIG. 4, the second key round value conversion function f ′ K is the key round value k (r−1) of the ( r−1) -th round (however, if r = 0, the calculated value storage area 115 stores K 0 (r−1), which is divided data obtained by dividing the stored calculated value or the initial value of the calculated value stored in the initial value storage area 111 into eight (in this embodiment, 32 bits each ). , K 1 (r-1) , k 2 (r-1) , k 3 (r-1) , k 4 (r-1) , k 5 (r-1) , k 6 (r-1) , k 7 (r-1) is replaced with k 0 (r) , k 1 (r) , k 2 (r) , k 3 (r) , k 4 (r) , k 5 (r) , k 6 (r, respectively. ) , K 7 (r), and these converted values are concatenated to generate the r-th round key round value k (r) .

なお、第二鍵ラウンド値変換関数f’Kを用いた処理に関しては、ビット数が異なるだけで、第一の実施形態と同様であるため、詳細な説明は省略する。 Note that the processing using the second key round value conversion function f ′ K is the same as in the first embodiment except that the number of bits is different, and thus detailed description thereof is omitted.

次に、第二ラウンド鍵生成部225で使用するF関数である関数Fについて説明する。 Next, functions described F R is F function used in the second round-key generation unit 225.

関数Fは、上述の(13)式に示すように、非線形変換γと、バイト置換πと、行列変換θと、の合成変換を4回(4段分)行う関数である。 The function F R is a function that performs the composite transformation of the nonlinear transformation γ R , the byte replacement π R, and the matrix transformation θ R four times (for four stages) as shown in the above equation (13).

ここで、関数Fへの入力をX、関数Fからの出力をYとして説明する。 Here, describing the input to the function F R X, the output from the function F R as Y.

本実施形態においては、X及びYは、64ビットのデータである。   In the present embodiment, X and Y are 64-bit data.

まず、非線形変換γでは、値Xを8ビット毎のサブデータ(s,s,・・・,s)に分割して、分割した各々のサブデータを、下記の(24)式に示すように、置換テーブルS−boxを用いて非線形変換を行う。ここで、変換後のサブデータをs’,s’,・・・,s’15とする。 First, in the non-linear transformation γ R , the value X is divided into 8-bit sub data (s 0 , s 1 ,..., S 7 ), and each sub data divided is expressed by the following equation (24): As shown in FIG. 5, nonlinear conversion is performed using the replacement table S-box. Here, it is assumed that the converted sub data is s ′ 0 , s ′ 1 ,..., S ′ 15 .

Figure 2010044251
Figure 2010044251

なお、置換テーブルS−boxは、例えば、上記の(7)で示されるものを使用すればよい。   In addition, what is necessary is just to use what is shown by said (7), for example as replacement table S-box.

次に、バイト置換πでは、下記の(25)式に示すように、非線形変換γで変換されたサブデータ(s’,s’,・・・,s’)を2行4列の行列として、各々の列に含まれる各々の行のデータが各々異なる列に配置されるように、データの入れ替えを行う。なお、(25)式は一例であって、各々の列に含まれる各々の行のデータが各々異なる列に配置されるものであれば、他の入れ替え方式を採用することも可能である。 Next, in byte replacement π R , as shown in the following equation (25), two rows of sub-data (s ′ 0 , s ′ 1 ,..., S ′ 7 ) converted by nonlinear conversion γ R are stored in two rows. As a four-column matrix, the data is exchanged so that the data in each row included in each column is arranged in a different column. Equation (25) is an example, and other replacement methods can be adopted as long as the data of each row included in each column is arranged in a different column.

また、変換後のサブデータをs”,s”,・・・,s”とする。 Further, the sub-data of the converted s "0, s" 1, ···, and s "7.

Figure 2010044251
Figure 2010044251

次に、行列変換θでは、下記の(26)式に示すように、上記のバイト置換πでの変換後のサブデータ(s”,s”,・・・,s”)を要素とする2行4列の行列と、変換行列Bと、の有限体GF(2)上での乗算を行うことで、変換を行う。ここで、変換後のサブデータをy,y,・・・,yとする。 Next, in the matrix transformation θ R , as shown in the following equation (26), the sub-data (s ″ 0 , s ″ 1 ,..., S ″ 7 ) after the transformation with the byte replacement π R described above. Is converted by performing multiplication on a finite field GF (2 8 ) of a matrix of 2 rows and 4 columns and a conversion matrix B. Here, the converted sub-data is expressed as y 0 , Let y 1 ,..., y 7 .

Figure 2010044251
Figure 2010044251

ここで、変換行列Bは、ある列を入力列とし、当該入力列に対して変換行列Bによる変換を行った後の値の列を出力列とした場合に、入力列及び出力列に含まれる項の内、値が「0」ではない項が、3個以上になるような変換であれば、どのような変換行列を用いてもよい。   Here, the transformation matrix B is included in an input column and an output column when a column is an input column and a column of values after the transformation by the transformation matrix B is performed on the input column is an output column. Any conversion matrix may be used as long as the number of terms whose values are not “0” is three or more.

そして、このようにして算出されたサブデータ(y,y,・・・,y)を、(27)式に示すように、サブデータ(s,s,・・・,s)として、非線形変換γ、バイト置換π及び行列変換θによる変換を3回(合計4回)行うことで、算出されるサブデータ(y,y,・・・,y)を(27)式のように連結することで、関数Fの出力Yとする。 Then, the sub data (y 0 , y 1 ,..., Y 7 ) calculated in this way is converted into sub data (s 0 , s 1 ,. 7 ), the sub-data (y 0 , y 1 ,..., Y 7 calculated by performing the transformation by the nonlinear transformation γ R , the byte substitution π R and the matrix transformation θ R three times (total four times). ) (27) by concatenating as type, the output Y of the function F R.

Figure 2010044251
Figure 2010044251

以上の関数Fでは、前述の関数Fと比較して、一つの入力に対して4回の処理で出力を行うため、安全性を高めることができる。なお、この4回の回数に関しては、適宜変更可能である。 In more functions F R, as compared with the function F K described above, for performing the output in four processing for one input, it is possible to enhance the safety. Note that the number of these four times can be changed as appropriate.

図11に戻り、撹拌部226は、各ラウンドにおける平文ラウンド値を算出する処理を行う。   Returning to FIG. 11, the stirring unit 226 performs a process of calculating a plaintext round value in each round.

例えば、撹拌部226による平文ラウンド値の算出は、図5に示すような平文ラウンド値変換関数fを用いて行われる。 For example, calculation of plaintext round value by stirring section 226 is performed using the plaintext round value transformation function f R as shown in FIG.

図5に示すように、平文ラウンド値変換関数fは、第r−1ラウンドの平文ラウンド値x(r−1)(但し、r=0の場合は、メッセージブロック化部222でブロック化されたメッセージブロックM’)を8分割(本実施形態では、各々32ビット)した分割データであるx (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)、x (r−1)を、それぞれ、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)、x (r)に変換し、変換したこれらの値を連結することで、第rラウンドの平文ラウンド値x(r)を生成する関数である。 As shown in FIG. 5, the plaintext round value conversion function f R is converted into a plaintext round value x (r−1) of the ( r−1) -th round (however, when r = 0, it is blocked by the message blocking unit 222). The message block M ′ i ) is divided into eight (in this embodiment, 32 bits each), which is divided data x 0 (r−1) , x 1 (r−1) , x 2 (r−1) , x 3 (r-1), x 4 (r-1), x 5 (r-1), x 6 (r-1), x 7 a (r-1), respectively, x 0 (r), x 1 (R) , x 2 (r) , x 3 (r) , x 4 (r) , x 5 (r) , x 6 (r) , x 7 (r), and these converted values are concatenated By doing so, it is a function that generates the plaintext round value x (r) of the r-th round.

なお、平文ラウンド値変換関数fを用いた処理に関しては、ビット数が異なるだけで、第一の実施形態と同様であるため、詳細な説明は省略する。 Regarding process using plaintext round value transformation function f R is the number of bits are different only because it is similar to the first embodiment, the detailed description thereof is omitted.

また、撹拌部226で使用するF関数である関数Fについては、上述の第二ラウンド鍵生成部225で使用するF関数である関数Fと同様であるため、説明を省略する。 Further, since the function F R is F function used in the stirring section 226 is similar to the function F R is F function used in the second round-key generation unit 225, a description thereof will not be given.

本実施形態におけるハッシュ値の算出処理についても、図7と同様に行うことが可能である。   The hash value calculation process in this embodiment can also be performed in the same manner as in FIG.

まず、ハッシュ値生成装置200では、入力部130を介して、ハッシュ値を生成するメッセージMの入力を受け付け、ハッシュ値生成装置200の全体制御部221が、メッセージブロック化部222にメッセージMを入力する。   First, the hash value generation device 200 receives an input of a message M for generating a hash value via the input unit 130, and the overall control unit 221 of the hash value generation device 200 inputs the message M to the message blocking unit 222. To do.

そして、メッセージブロック化部222では、メッセージMをパディングして、256ビット毎のメッセージブロック(M’,・・・,M’;kは1以上の整数)に分割する。 Then, the message blocking unit 222 pads the message M and divides it into 256-bit message blocks (M ′ 0 ,..., M ′ k ; k is an integer of 1 or more).

次に、全体制御部221は、初期値記憶領域211に記憶されている算出値の初期値H−1と、メッセージブロック化部222でブロック化されたメッセージブロックM’のうち、最初のメッセージブロックM’と、を第一ブロック暗号fに入力することで、平文ラウンド値hを算出する。 Next, the overall control unit 221 determines the first message among the initial value H −1 of the calculated value stored in the initial value storage area 211 and the message block M i ′ blocked by the message blocking unit 222. By inputting the block M ′ 0 to the first block cipher f E , the plaintext round value h 0 is calculated.

ここで、第一ブロック暗号fを用いた処理は、ラウンド定数生成部223、第一ラウンド鍵生成部224及び撹拌部226で行われる。 Here, the processing using the first block cipher f E is performed by the round constant generation unit 223, the first round key generation unit 224, and the stirring unit 226.

そして、全体制御部221は、算出した平文ラウンド値hと、メッセージブロックM’と、の排他的論理和を算出することで、算出値を求め、求めた算出値と、次のメッセージブロックM’と、をブロック暗号fに入力することで、平文ラウンド値hを算出する。なお、算出された算出値については、算出値記憶領域115に記憶される。 Then, the overall control unit 221 calculates an exclusive OR of the calculated plaintext round value h 0 and the message block M ′ 0 to obtain a calculated value, and calculates the calculated value and the next message block By inputting M ′ 1 into the block cipher f E , the plaintext round value h 1 is calculated. Note that the calculated value is stored in the calculated value storage area 115.

このような処理を、最後のメッセージブロックM’の直前のメッセージブロックM’k−1まで繰り返すことで、平文ラウンド値hk−1を算出する。 By repeating such processing up to the message block M ′ k−1 immediately before the last message block M ′ k , the plaintext round value h k−1 is calculated.

そして、全体制御部221は、平文ラウンド値hk−1と、メッセージブロックM’k−1と、の排他的論理和で算出される算出値と、最後のメッセージブロックM’と、を第二ブロック暗号f’に入力することにより、平文ラウンド値hを算出する。 Then, the overall control unit 221 determines the calculated value calculated by exclusive OR of the plaintext round value h k−1 and the message block M ′ k−1 and the last message block M ′ k . By inputting to the two-block cipher f ′ E , the plaintext round value h k is calculated.

ここで、第二ブロック暗号f’を用いた処理は、ラウンド定数生成部223、第二ラウンド鍵生成部225及び撹拌部226で行われる。 Here, processing using the second block cipher f ′ E is performed by the round constant generation unit 223, the second round key generation unit 225, and the stirring unit 226.

そして、全体制御部221は、平文ラウンド値hと、最後のメッセージブロックM’と、の排他的論理和でハッシュ値Hを算出する。 Then, the overall control unit 221 calculates a hash value H k by exclusive OR of the plaintext round value h k and the last message block M ′ k .

このようなハッシュ値Hは、ハッシュ値記憶領域216に記憶される。 Such a hash value H k is stored in the hash value storage area 216.

ここで、第一ブロック暗号fでの処理及び第二ブロック暗号f’での処理については、ビット数は異なるが、図8及び図9での処理と同様であるため、説明を省略する。 Here, the processing in the first block cipher f E and the processing in the second block cipher f ′ E are the same as the processing in FIG. 8 and FIG. .

以上のように、本実施形態によれば、256ビットのハッシュ値を算出することができる。   As described above, according to the present embodiment, a 256-bit hash value can be calculated.

ここで、差分攻撃線形攻撃に対する耐性の指標として、最小のアクティブS−box数を用いた下記の(28)式が用いられる。   Here, the following equation (28) using the minimum number of active S-boxes is used as an index of resistance to the differential attack linear attack.

Figure 2010044251
Figure 2010044251

この点、AES(Advanced Encryption Standard)型のF関数においては、2段分のアクティブS−box数をBとすると、4段分のアクティブS−box数は、Bとなる。このように、S−boxを4段重ねることで安全性を高めるこのような手法をWTS(Wide Trail Strategy)という。 In this regard, in the F function of AES (Advanced Encryption Standard) type, when the two stages of active S-box number is B, the active S-box number of four stages becomes B 2. In this way, such a technique for improving safety by stacking four S-boxes is called WTS (Wide Trail Strategy).

これに対して、例えば、図5に示されているようなFeistel構造では、F関数の出力をX (r−1)、X (r−1)に加算する処理があるため、単にF関数の段数を増やすWTSを採用することができない。 On the other hand, for example, in the Feistel structure as shown in FIG. 5, there is a process of adding the output of the F function to X 6 (r−1) and X 7 (r−1). WTS that increases the number of function stages cannot be adopted.

この点、本発明では、平文ラウンド値変換関数fで使用するF関数である関数Fにおいて、第二非線形変換γと、バイト置換πと、行列変換θと、の合成変換を4回(4段)行うことで安全性を確保している。 In this regard, in the present invention, in the function F R that is an F function used in the plaintext round value conversion function f R , the composite conversion of the second nonlinear conversion γ R , the byte replacement π R, and the matrix conversion θ R is performed. Safety is ensured by performing it four times (four steps).

例えば、本発明の第一の実施形態における512ビットのハッシュ値を生成するハッシュ値生成装置100では、2段分の最低アクティブS−box数「B=5」であるため、F関数一つ当たりの最低アクティブS−box数「B=25」となる。 For example, in the hash value generation device 100 that generates a 512-bit hash value in the first embodiment of the present invention, since the minimum number of active S-boxes for two stages is “B = 5”, there is one F function. The minimum number of active S-boxes per hit is “B 2 = 25”.

そして、12段でアクティブなF関数は、最低5つであるため、アクティブS−box数の最小値は、「5×25=125」となる。   Since there are at least five F functions active in 12 stages, the minimum value of the number of active S-boxes is “5 × 25 = 125”.

従って、最大の差分伝搬の確率は、「125×6(=750)>512」となるため、(28)式を満たし、差分攻撃に対して耐性を有することがわかる。   Accordingly, since the maximum differential propagation probability is “125 × 6 (= 750)> 512”, it can be seen that the formula (28) is satisfied and the system is resistant to differential attacks.

また、本発明の第二の実施形態における256ビットのハッシュ値を生成するハッシュ値生成装置200では、2段分の最低アクティブS−box数「B=3」であるため、F関数一つ当たりの最低アクティブS−box数「B=9」となる。 Further, in the hash value generation device 200 that generates a 256-bit hash value in the second embodiment of the present invention, since the minimum number of active S-boxes for two stages is “B = 3”, there is one F function. The minimum number of active S-boxes per hit is “B 2 = 9”.

そして、12段でアクティブなF関数は、最低5つであるため、アクティブS−box数の最小値は、「5×9=45」となる。   Since there are at least five F functions active in 12 stages, the minimum value of the number of active S-boxes is “5 × 9 = 45”.

従って、最大の差分伝搬の確率は、「45×6(=270)>256」となるため、(28)式を満たし、差分攻撃に対して耐性を有することがわかる。   Therefore, since the maximum differential propagation probability is “45 × 6 (= 270)> 256”, it is understood that the formula (28) is satisfied and the system is resistant to differential attacks.

なお、WTSについては、下記の文献2に詳細に記載されている。   The WTS is described in detail in the following document 2.

文献2:J.Daemen and V. Rijmen, Springer, 2002, February, “The Design of Rijndael”, pp. 123-147
また、以上に記載した第一の実施形態及び第二の実施形態では、それぞれ、512ビット、256ビットのハッシュ値を算出するようにしているが、このような態様に限定されるわけではなく、ビット長を適宜変化させることで、224ビット、384ビット等の他のビット長のハッシュ値を算出することも可能である。
Reference 2: J. Daemen and V. Rijmen, Springer, 2002, February, “The Design of Rijndael”, pp. 123-147
In the first embodiment and the second embodiment described above, 512-bit and 256-bit hash values are calculated, respectively, but the present invention is not limited to this mode. It is also possible to calculate a hash value having another bit length such as 224 bits or 384 bits by appropriately changing the bit length.

さらに、以上に記載した実施形態においては、ハッシュ値生成装置100、200を図6に示すようなコンピュータ900で実現可能としたが、このような態様に限定されず、例えば、CPUと、発揮性又は不発揮性メモリと、を備える携帯電話端末、非接触型ICカード、商品タグ等の実装規模の小さなデバイスにおいても実現可能である。   Furthermore, in the embodiment described above, the hash value generation devices 100 and 200 can be realized by the computer 900 as shown in FIG. 6, but the present invention is not limited to such an aspect. Alternatively, it can be realized in a small-scale device such as a mobile phone terminal, a non-contact type IC card, and a product tag provided with a non-working memory.

また、上述したハッシュ値生成装置100、200は、コンピュータがプログラムを実行することにより実現されるものでなくてもよい。例えば、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等の集積ロジックICによりハード的に実行されるものであってもよいし、あるいは、DSP(Digital Signal Processor)等の計算機によりソフトウェア的に実行されるものであってもよい。   Further, the hash value generation apparatuses 100 and 200 described above may not be realized by a computer executing a program. For example, it may be executed in hardware by an integrated logic IC such as ASIC (Application Specific Integrated Circuit) or FPGA (Field Programmable Gate Array), or may be software by a computer such as DSP (Digital Signal Processor). May be executed automatically.

以上に記載した実施形態においては、図5に示すような平文ラウンド値変換関数fを使用しているが、このような態様に限定されず、関数FをF関数として使用するものであれば、どのようなものであってもよい。例えば、図12(平文ラウンド値変換関数f変形例を示す概略図)に示すような平文ラウンド値変換関数fを使用することも可能である。 In the embodiment described above, the use of the plain round value transformation function f R as shown in FIG. 5, is not limited to such a mode, as long as the function is used F R as F function Anything may be used. For example, it is also possible to use plain round value transformation function f R as shown in FIG. 12 (a schematic diagram showing a plain round value transformation function f R variant).

図12に示す平文ラウンド値変換関数fでは、ラウンド鍵K(r)及び第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の排他的論理和である値pと、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の値pと、を連結した値pをF関数である関数Fに入力した出力値の内の上位ビット(ここでは、上位64ビット)の値q(q=F(x (r−1) XOR K(r),x (r−1))と、下位ビット(ここでは、下位64ビット)の値q(q=F(x (r−1) XOR K(r),x (r−1))と、を算出する。 In the plaintext round value conversion function f R shown in FIG. 12, x 4 (r ) of the round key K (r) and the plaintext round value of the (r−1 ) -th round (message block M ′ i in the case of r = 0). an exclusive OR is a value p H -1), the case of the plaintext round value of r-1 rounds (r = 0, x 5 value of (r-1) of the message block M 'i) The value q H (q H = F R (x 4 (r 4 )) of the higher-order bits (here, the higher-order 64 bits) of the output value input to the function F R which is the F function is the value p obtained by concatenating p L -1) XOR K (r), x 5 and (r-1)) H) , the lower bits (here, the value q L of the lower 64 bits) (q L = F R ( x 4 (r-1) XOR K (r), x 5 and (r-1)) L) , is calculated.

そして、値p及び値qの排他的論理和と、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの平文ラウンド鍵のx (r)とする。 Then, an exclusive OR of the values p H and a value q H, (in the case of r = 0, the message block M 'i) the plaintext round value of r-1 rounds x 6 of the (r-1) , And the calculated value is x 0 (r) of the r-th plaintext round key.

また、値p及び値qの排他的論理和と、第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)と、の排他的論理和を算出し、算出した値を第rラウンドの平文ラウンド値のx (r)とする。 Further, the exclusive OR of the values p L and the value q L, (in the case of r = 0, the message block M 'i) the plaintext round value of r-1 rounds x 7 of the (r-1) , And the calculated value is defined as x 1 (r) of the plaintext round value of the r-th round.

図12に示すような平文ラウンド値変換関数fを用いることで、F関数への入力を出力にフィードフォワードすることで、F関数部分の置換性をくずすことができる。 By using the plaintext round value transformation function f R as shown in FIG. 12, by feed forward the input to the output of the F function, it is possible to break the substitution of F function parts.

さらに、図5に示すような平文ラウンド値変換関数fの替わりに、例えば、図13(平文ラウンド値変換関数f変形例を示す概略図)に示すような平文ラウンド値変換関数fを使用することも可能である。 Further, instead of the plain round value transformation function f R as shown in FIG. 5, for example, plaintext round value transformation function f R as shown in FIG. 13 (a schematic diagram showing a plain round value transformation function f R variant) It is also possible to use it.

図13に示す平文ラウンド値変換関数fでは、ラウンド鍵K (r)及び第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の排他的論理和である値pと、ラウンド鍵K (r)及び第r−1ラウンドの平文ラウンド値(r=0の場合は、メッセージブロックM’)の内のx (r−1)の排他的論理和である値pと、を連結した値pをF関数である関数Fに入力した出力値の内の上位ビット(ここでは、上位64ビット)の値q(q=F(x (r−1) XOR K (r),x (r−1) XOR K (r))と、下位ビット(ここでは、下位64ビット)の値q(q=F(x (r−1) XOR K(r),x (r−1) XOR K (r))と、を算出する。 In the plaintext round value conversion function f R shown in FIG. 13, x 4 (the message block M ′ i in the case of r = 0 ) and the round key K 0 (r) and the plaintext round value of the (r−1 ) -th round. a value p H which is an exclusive OR of r−1) , a round key K 1 (r) and a plaintext round value of the (r−1 ) -th round (if r = 0, message block M ′ i ) x 5 and a value p L is exclusive of (r-1), the upper bits of the output value of the value p which is connected to the input to the function F R is F function (in this case, the upper 64 bits) Q H (q H = F R (x 4 (r−1) XOR K 0 (r) , x 5 (r−1) XOR K 1 (r) ) H ) and lower bits (here, lower the value q L of 64 bits) (q L = F R ( x 4 (r-1) XOR K (r), x 5 (r- ) XOR K 1 and (r)) L), is calculated.

ここで、ラウンド鍵K (r)は、第rラウンドの鍵ラウンド値の内のk (r)を用い、ラウンド鍵K (r)は、第rラウンドの鍵ラウンド値の内のk (r)を用いる。 Here, the round key K 0 (r) uses k 2 (r) in the key round value of the r-th round, and the round key K 1 (r) is k in the key round value of the r-th round. 3 (r) is used.

図13に示すような平文ラウンド値変換関数fを用いることで、ラウンド鍵を2倍以上の大きさにすることが可能である。 By using the plaintext round value transformation function f R as shown in FIG. 13, it is possible to round keys to a size more than twice.

第一の実施形態であるハッシュ値生成装置の概略図。1 is a schematic diagram of a hash value generation device according to a first embodiment. 線形変換関数fを示す概略図。Schematic diagram of a linear transformation function f c. 第一鍵ラウンド値変換関数fの概略図。Schematic view of a first key round value conversion function f K. 第二鍵ラウンド値変換関数f’の概略図。Schematic view of a second key round value transformation function f 'K. 平文ラウンド値変換関数fの概略図。Schematic diagram of plaintext round value transformation function f R. コンピュータの概略図。Schematic diagram of a computer. ハッシュ値の算出処理を示す概略図。Schematic which shows the calculation process of a hash value. 第一ブロック暗号fでの処理を示す概略図。Schematic diagram showing the process in the first block cipher f E. 第二ブロック暗号f’での処理を示す概略図。Schematic diagram showing the process of the second block cipher f 'E. ハッシュ値生成装置におけるハッシュ値の生成処理を示すフローチャート。The flowchart which shows the production | generation process of the hash value in a hash value production | generation apparatus. 第二の実施形態であるハッシュ値生成装置の概略図。The schematic diagram of the hash value generation device which is a second embodiment. 平文ラウンド値変換関数f変形例を示す概略図。Schematic diagram showing a plain round value transformation function f R modification. 平文ラウンド値変換関数f変形例を示す概略図。Schematic diagram showing a plain round value transformation function f R modification.

符号の説明Explanation of symbols

100、200 ハッシュ値生成装置
110、210 記憶部
111、211 初期値記憶領域
112 定数ラウンド値記憶領域
113 鍵ラウンド値記憶領域
114 平文ラウンド値記憶領域
115 算出値記憶領域
116 ハッシュ値記憶領域
120、220 制御部
121、221 全体制御部
122、222 メッセージブロック化部
123、223 ラウンド定数生成部
124、224 第一ラウンド鍵生成部
125、225 第二ラウンド鍵生成部
126、226 撹拌部
100, 200 Hash value generator 110, 210 Storage unit 111, 211 Initial value storage area 112 Constant round value storage area 113 Key round value storage area 114 Plain text round value storage area 115 Calculated value storage area 116 Hash value storage area 120, 220 Control units 121, 221 Overall control unit 122, 222 Message blocking unit 123, 223 Round constant generation unit 124, 224 First round key generation unit 125, 225 Second round key generation unit 126, 226 Agitation unit

Claims (17)

メッセージを予め定められたデータ長のブロックにして、当該ブロックを分割した複数の分割データのうちの特定の分割データをF関数により変換を行い、他の特定の分割データとの排他的論理和を算出する撹拌処理を含むブロック暗号を用いて、前記メッセージのハッシュ値を生成するハッシュ値生成装置であって、
前記F関数において、少なくとも非線形変換を含む変換を複数回行う制御部を備えること、
を特徴とするハッシュ値生成装置。
The message is changed to a block having a predetermined data length, specific divided data among a plurality of divided data obtained by dividing the block is converted by the F function, and exclusive OR with other specific divided data is performed. A hash value generation device that generates a hash value of the message using a block cipher including a stirring process to calculate,
In the F function, including a control unit that performs conversion including at least nonlinear conversion a plurality of times,
A hash value generator characterized by the above.
請求項1に記載のハッシュ値生成装置であって、
前記F関数は、非線形変換と、バイト置換と、行列変換と、の合成変換を複数回行うものであること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 1,
The F function is a combination of non-linear transformation, byte replacement, and matrix transformation that is performed multiple times;
A hash value generator characterized by the above.
請求項2に記載のハッシュ値生成装置であって、
前記複数回は、4回であること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 2,
The plurality of times is four times;
A hash value generator characterized by the above.
請求項2に記載のハッシュ値生成装置であって、
前記非線形変換は、変換前のデータに対応する変換後のデータを、予め定められた置換テーブルより抽出することで、変換を行うものであること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 2,
The nonlinear conversion is to perform conversion by extracting data after conversion corresponding to the data before conversion from a predetermined replacement table;
A hash value generator characterized by the above.
請求項2に記載のハッシュ値生成装置であって、
前記バイト置換は、変換前のデータを項目とする行列において、任意の列に含まれるそれぞれの項目を、それぞれ異なる列に配置する変換を行うものであること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 2,
The byte replacement is to perform conversion in which each item included in an arbitrary column is arranged in a different column in a matrix having data before conversion as items,
A hash value generator characterized by the above.
請求項4に記載のハッシュ値生成装置であって、
前記行列変換は、変換前のデータを項目とする行列に変換行列を乗算することで、当該行列の任意の列に含まれるそれぞれの項目と、乗算後の行列における当該任意の列に対応する列に含まれるそれぞれの項目と、において0ではない項目が、予め定められた数以上となるものであること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 4,
The matrix conversion is performed by multiplying a matrix having data before conversion as an item by multiplying the conversion matrix by each item included in an arbitrary column of the matrix and a column corresponding to the arbitrary column in the matrix after multiplication. The number of items included in the item and the number of items that are not zero in the item is greater than or equal to a predetermined number,
A hash value generator characterized by the above.
請求項6に記載のハッシュ値生成装置であって、
512ビットのハッシュ値を生成する場合には、前記数は5であること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 6,
In the case of generating a 512-bit hash value, the number is 5.
A hash value generator characterized by the above.
請求項6に記載のハッシュ値生成装置であって、
256ビットのハッシュ値を生成する場合には、前記数は3であること、
を特徴とするハッシュ値生成装置。
The hash value generation device according to claim 6,
In the case of generating a 256-bit hash value, the number is 3.
A hash value generator characterized by the above.
コンピュータを、メッセージを予め定められたデータ長のブロックにして、当該ブロックを分割した複数の分割データのうちの特定の分割データをF関数により変換を行い、他の特定の分割データとの排他的論理和を算出する撹拌処理を含むブロック暗号を用いて、前記メッセージのハッシュ値を生成するハッシュ値生成装置として機能させるプログラムであって、
前記コンピュータを、前記F関数において、少なくとも非線形変換を含む変換を複数回行う制御手段として機能させること、
を特徴とするプログラム。
The computer sets the message to a block having a predetermined data length, converts the specific divided data among a plurality of divided data obtained by dividing the block by the F function, and is exclusive with other specific divided data. A program that functions as a hash value generation device that generates a hash value of the message using a block cipher including agitation processing for calculating a logical sum,
Causing the computer to function as a control unit that performs conversion including at least nonlinear conversion a plurality of times in the F function;
A program characterized by
請求項9に記載のプログラムであって、
前記F関数は、非線形変換と、バイト置換と、行列変換と、の合成変換を複数回行うものであること、
を特徴とするプログラム。
The program according to claim 9, wherein
The F function is a combination of non-linear transformation, byte replacement, and matrix transformation that is performed multiple times;
A program characterized by
請求項10に記載のプログラムであって、
前記複数回は、4回であること、
を特徴とするプログラム。
The program according to claim 10,
The plurality of times is four times;
A program characterized by
請求項10に記載のプログラムであって、
前記非線形変換は、変換前のデータに対応する変換後のデータを、予め定められた置換テーブルより抽出することで、変換を行うものであること、
を特徴とするプログラム。
The program according to claim 10,
The nonlinear conversion is to perform conversion by extracting data after conversion corresponding to the data before conversion from a predetermined replacement table;
A program characterized by
請求項10に記載のプログラムであって、
前記バイト置換は、変換前のデータを項目とする行列において、任意の列に含まれるそれぞれの項目を、それぞれ異なる列に配置する変換を行うものであること、
を特徴とするプログラム。
The program according to claim 10,
The byte replacement is to perform conversion in which each item included in an arbitrary column is arranged in a different column in a matrix having data before conversion as items,
A program characterized by
請求項12に記載のプログラムであって、
前記行列変換は、変換前のデータを項目とする行列に変換行列を乗算することで、当該行列の任意の列に含まれるそれぞれの項目と、乗算後の行列における当該任意の列に対応する列に含まれるそれぞれの項目と、において0ではない項目が、予め定められた数以上となるものであること、
を特徴とするプログラム。
A program according to claim 12,
The matrix conversion is performed by multiplying a matrix having data before conversion as an item by multiplying the conversion matrix by each item included in an arbitrary column of the matrix and a column corresponding to the arbitrary column in the matrix after multiplication. The number of items included in the item and the number of items that are not zero in the item is greater than or equal to a predetermined number,
A program characterized by
請求項14に記載のプログラムであって、
512ビットのハッシュ値を生成する場合には、前記数は5であること、
を特徴とするプログラム。
The program according to claim 14, wherein
In the case of generating a 512-bit hash value, the number is 5.
A program characterized by
請求項14に記載のプログラムであって、
256ビットのハッシュ値を生成する場合には、前記数は3であること、
を特徴とするプログラム。
The program according to claim 14, wherein
In the case of generating a 256-bit hash value, the number is 3.
A program characterized by
メッセージを予め定められたデータ長のブロックにして、当該ブロックを分割した複数の分割データのうちの特定の分割データをF関数により変換を行い、他の特定の分割データとの排他的論理和を算出する撹拌処理を含むブロック暗号を用いて、前記メッセージのハッシュ値を生成するハッシュ値生成装置が行うハッシュ値生成方法であって、
前記ハッシュ値生成装置の制御部が、前記F関数において、少なくとも非線形変換を含む変換を複数回行う過程を備えること、
を特徴とするハッシュ値生成方法。
The message is converted into a block having a predetermined data length, specific divided data among a plurality of divided data obtained by dividing the block is converted by the F function, and exclusive OR with other specific divided data is performed. A hash value generation method performed by a hash value generation device that generates a hash value of the message using a block cipher including a stirring process to calculate,
The control unit of the hash value generation device includes a process of performing a transformation including at least a nonlinear transformation a plurality of times in the F function;
A hash value generation method characterized by
JP2008208635A 2008-08-13 2008-08-13 Hash value generator, program and hash value generation method Pending JP2010044251A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2008208635A JP2010044251A (en) 2008-08-13 2008-08-13 Hash value generator, program and hash value generation method
US12/393,227 US20100040226A1 (en) 2008-08-13 2009-02-26 Device, program and method for generating hash values

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008208635A JP2010044251A (en) 2008-08-13 2008-08-13 Hash value generator, program and hash value generation method

Publications (1)

Publication Number Publication Date
JP2010044251A true JP2010044251A (en) 2010-02-25

Family

ID=41681285

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008208635A Pending JP2010044251A (en) 2008-08-13 2008-08-13 Hash value generator, program and hash value generation method

Country Status (2)

Country Link
US (1) US20100040226A1 (en)
JP (1) JP2010044251A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010049037A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Device for generating hash value
JP2012002831A (en) * 2010-06-14 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> Apparatus and method for evaluating security of hash function, and program

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10164772B2 (en) 2014-05-30 2018-12-25 Apple Inc. Permutation composition based hash function
US10491377B2 (en) * 2017-02-28 2019-11-26 Google Llc Hashing using data parallel instructions
US10833847B2 (en) * 2017-02-28 2020-11-10 Google Llc Cryptographic hash generated using data parallel instructions

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006072054A (en) * 2004-09-03 2006-03-16 Sony Corp Cryptographic processing apparatus, cryptographic processing method, and computer program
JP2007316614A (en) * 2006-04-27 2007-12-06 Hitachi Ltd Hash value generation device, program, and hash value generation method
JP2008058830A (en) * 2006-09-01 2008-03-13 Sony Corp Data conversion apparatus, data conversion method, and computer program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2164768C (en) * 1995-12-08 2001-01-23 Carlisle Michael Adams Constructing symmetric ciphers using the cast design procedure
US5949884A (en) * 1996-11-07 1999-09-07 Entrust Technologies, Ltd. Design principles of the shade cipher
US6182216B1 (en) * 1997-09-17 2001-01-30 Frank C. Luyster Block cipher method
US7003107B2 (en) * 2000-05-23 2006-02-21 Mainstream Encryption Hybrid stream cipher
US7283628B2 (en) * 2001-11-30 2007-10-16 Analog Devices, Inc. Programmable data encryption engine
US8275125B2 (en) * 2008-04-21 2012-09-25 Tata Consultancy Services Ltd Method for designing a secure hash function and a system thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006072054A (en) * 2004-09-03 2006-03-16 Sony Corp Cryptographic processing apparatus, cryptographic processing method, and computer program
JP2007316614A (en) * 2006-04-27 2007-12-06 Hitachi Ltd Hash value generation device, program, and hash value generation method
JP2008058830A (en) * 2006-09-01 2008-03-13 Sony Corp Data conversion apparatus, data conversion method, and computer program

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JPN6013011662; Satoh, A., et al.: 'A Compact Rijndael Hardware Architecture with S-Box Optimization' In Proceedings of the 7th International Conference on the Theory and Application of Cryptology and I , 200112, pp. 239-254, [online] *
JPN6013011666; 大和田 徹ほか: 'Lesamntaのハードウェア実装及び評価' 2009年 暗号と情報セキュリティシンポジウム (SCIS2009) 予稿集CD-ROM , 200901, 2C2-3 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010049037A (en) * 2008-08-22 2010-03-04 Hitachi Ltd Device for generating hash value
JP2012002831A (en) * 2010-06-14 2012-01-05 Nippon Telegr & Teleph Corp <Ntt> Apparatus and method for evaluating security of hash function, and program

Also Published As

Publication number Publication date
US20100040226A1 (en) 2010-02-18

Similar Documents

Publication Publication Date Title
JP5000365B2 (en) Hash value generation device, program, and hash value generation method
Baldwin et al. FPGA implementations of the round two SHA-3 candidates
US6829355B2 (en) Device for and method of one-way cryptographic hashing
JP5229315B2 (en) Encryption device and built-in device equipped with a common key encryption function
JP4735644B2 (en) Message authentication apparatus, message authentication method, message authentication program and recording medium thereof
CN102138170B (en) Data conversion device and data conversion method
US20230261853A1 (en) Method and apparatus for improving the speed of advanced encryption standard (aes) decryption algorithm
JP4561252B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
JP2007041620A5 (en)
WO2001067425A1 (en) Block encryption device using auxiliary conversion
JPWO2015146431A1 (en) Cryptographic processing apparatus, cryptographic processing method, and program
CN112287333B (en) A lightweight adjustable block cipher implementation method, system, electronic device and readable storage medium
JP2015191106A (en) Cryptographic processing apparatus, cryptographic processing method, and program
CN110197076A (en) A kind of software optimization implementation method of SM4 Encryption Algorithm
JP2010044251A (en) Hash value generator, program and hash value generation method
JP5504592B2 (en) Data conversion apparatus, data conversion method, and program
JP2015191107A (en) Cryptographic processing apparatus, cryptographic processing method, and program
Liu et al. Improved meet-in-the-middle attacks on reduced-round Deoxys-BC-256
JP5528281B2 (en) Hash value arithmetic unit
JP6089668B2 (en) ENCRYPTION PROCESSING CIRCUIT, DECRYPTION PROCESSING CIRCUIT, METHOD THEREOF, AND PROGRAM THEREOF
JP4857230B2 (en) Pseudorandom number generator and encryption processing device using the same
JP5488608B2 (en) Block encryption apparatus, block encryption method and program
JP2010256749A (en) Hash value generation device, hash value generation method, and program
JP5500277B2 (en) Encryption device and built-in device equipped with a common key encryption function
JPWO2015059845A1 (en) ENCRYPTION PROCESSING CIRCUIT, ITS METHOD, PROGRAM, AND DECRYPTION PROCESSING CIRCUIT

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130301

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130312

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130508

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130604