JP5398353B2 - Hash value calculation device, hash value calculation method, and hash value calculation program - Google Patents

Hash value calculation device, hash value calculation method, and hash value calculation program Download PDF

Info

Publication number
JP5398353B2
JP5398353B2 JP2009125976A JP2009125976A JP5398353B2 JP 5398353 B2 JP5398353 B2 JP 5398353B2 JP 2009125976 A JP2009125976 A JP 2009125976A JP 2009125976 A JP2009125976 A JP 2009125976A JP 5398353 B2 JP5398353 B2 JP 5398353B2
Authority
JP
Japan
Prior art keywords
value
hash
input
bit length
function
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.)
Expired - Fee Related
Application number
JP2009125976A
Other languages
Japanese (ja)
Other versions
JP2010276629A (en
Inventor
祐介 内藤
和夫 太田
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.)
THE UNIVERSITY OF ELECTRO-COMUNICATINS
Mitsubishi Electric Corp
Original Assignee
THE UNIVERSITY OF ELECTRO-COMUNICATINS
Mitsubishi Electric Corp
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 THE UNIVERSITY OF ELECTRO-COMUNICATINS, Mitsubishi Electric Corp filed Critical THE UNIVERSITY OF ELECTRO-COMUNICATINS
Priority to JP2009125976A priority Critical patent/JP5398353B2/en
Publication of JP2010276629A publication Critical patent/JP2010276629A/en
Application granted granted Critical
Publication of JP5398353B2 publication Critical patent/JP5398353B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

この発明は、例えば、効率的にハッシュ値を計算する技術に関する。   The present invention relates to a technique for efficiently calculating a hash value, for example.

非特許文献1には、一方向性が破られた理想的な圧縮関数(WFILRO(Weakened Fixed Input Length Random Oracle))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能なハッシュ関数であるジッパーハッシュ関数(zipperハッシュ関数)についての記載がある。   Non-Patent Document 1 describes that a random oracle cannot be strongly discriminated even if it is configured using an ideal compression function (WFILRO (Weaked Fixed Input Length Random Oracle)) whose unidirectionality is broken. There is a description of a zipper hash function that is a hash function.

非特許文献2には、一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能なハッシュ関数であるダブルパイプハッシュ関数(double pipeハッシュ関数)についての記載がある。   Non-Patent Document 2 discloses a double pipe hash function (double pipe pipe) that is a hash function that cannot be strongly discriminated from a random oracle even if it is configured using an ideal compression function with broken unidirectionality. (Hash function) is described.

Moses Liskov: Constructing an Ideal Hash Function from Weak Ideal Compression Functions. Selected Areas in Cryptography 2006: 358−375Moses Liskov: Constructing an Ideal Hash Function from Week Ideal Compression Functions. Selected Areas in Cryptography 2006: 358-375 Stefan Lucks: A Failure−Friendly Design Principle for Hash Functions. ASIACRYPT 2005: 474−494Stefan Lucks: A Failure-Friendly Design Principle for Hash Functions. ASIACRYPT 2005: 474-494 Mihir Bellare, Thomas Ristenpart: Multi−Property−Preserving Hash Domain Extension and the EMD Transform. ASIACRYPT 2006: 299−314Mihir Bellare, Thomas Ristenpart: Multi-Property-Preserving Hash Domain Extension and the EMD Trans. ASIACRYPT 2006: 299-314 Shoichi Hirose, Je Hong Park, Aaram Yun: A Simple Variant of the Merkle−Damgard Scheme with a Permutation. ASIACRYPT 2007: 113−129Shoichi Hirose, Je Hong Park, Aram Yun: A Simple Variant of the Merkle-Damgard Scheme with a Permutation. ASIACRYPT 2007: 113-129 Ueli Maurer, Renato Renner, and Clemens Holensteinindifferentiability impossibility results on reductions and applicationsto the random oracle methodologyTCC 2004, pp 21−39, LNCS 2951 Springer 2004, ISBN 3−540−21000−8Ueli Maurer, Renato Renner, and Clemens Hollenstainindifference impossibility impossibility, isl, and Nr4, N4, p4 Ralph C. Merkle/One Way Hash Functions and DES/,Crypto 1989, pp 428−446, LNCS 435 Springer 1990, ISBN 3−540−97317−6Ralph C.I. Merkle / One Way Hash Functions and DES /, Crypto 1989, pp 428-446, LNCS 435 Springer 1990, ISBN 3-540-97317-6

非特許文献1,2に記載されたジッパーハッシュ関数とダブルパイプハッシュ関数とは、一方向性が破られた理想的な圧縮関数を用い、ランダムオラクルと強識別不可能なハッシュ関数であるものの、計算効率が悪い。
この発明は、例えば、一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルと強識別不可能であるハッシュ関数であって、ジッパーハッシュ関数やダブルパイプハッシュ関数よりも計算効率がよいハッシュ関数を構成することを目的とする。
Although the zipper hash function and the double pipe hash function described in Non-Patent Documents 1 and 2 are ideal compression functions with broken unidirectionality, they are hash functions that cannot be strongly distinguished from random oracles. The calculation efficiency is poor.
The present invention is, for example, a hash function that cannot be strongly distinguished from a random oracle even if it is configured using an ideal compression function with broken unidirectionality. The object is to construct a hash function that is more computationally efficient than the hash function.

この発明に係るハッシュ値演算装置は、例えば、
i個の値p[1],...,値p[i]を入力する既定長値入力部と、
前記既定長値入力部が入力した値p[1],...,値p[i]のうち、i−1個の値p[1],...,値p[i−1]それぞれに対して、固定値const[1],...,固定値const[i−1]を付加して、値x[1],...,値x[i−1]を生成して記憶装置に記憶する固定値付加部と、
j=1からi−1まで順に、値c[j−1](値c[0]は固定値IV1とする)と、前記固定値付加部が生成した値x[j]とを入力として、圧縮関数hを計算した結果である値c[j]を得ることにより、値c[i−1]を得て記憶装置に記憶し、
固定値IV2と、値p[i]に値c[i−1]を付加した値x[i]とを入力として、圧縮関数hを計算した結果である値c[i]を得て記憶装置に記憶する圧縮関数計算部と、
前記圧縮関数計算部が得た値c[i]を出力する出力部と
を備えることを特徴とする。
The hash value calculation device according to the present invention is, for example,
i values p [1],. . . , A predetermined length input unit for inputting the value p [i],
The values p [1],. . . , Value p [i], i−1 values p [1],. . . , Value p [i−1] for each fixed value const [1],. . . , A fixed value const [i−1], and the values x [1],. . . , A fixed value adding unit that generates a value x [i−1] and stores it in the storage device;
In order from j = 1 to i−1, a value c [j−1] (value c [0] is a fixed value IV1) and a value x [j] generated by the fixed value adding unit are input. By obtaining a value c [j] that is a result of calculating the compression function h, a value c [i−1] is obtained and stored in the storage device;
A storage device that obtains a value c [i] that is a result of calculating a compression function h by using a fixed value IV2 and a value x [i] obtained by adding a value c [i-1] to a value p [i]. A compression function calculation unit stored in
And an output unit that outputs the value c [i] obtained by the compression function calculation unit.

この発明に係るハッシュ値演算装置では、圧縮関数への入力値に固定値を付加しする。これにより、一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルと強識別不可能であるハッシュ関数を構成することができる。そして、このハッシュ関数は、ジッパーハッシュ関数やダブルパイプハッシュ関数よりも効率がよい。   In the hash value calculation device according to the present invention, a fixed value is added to the input value to the compression function. This makes it possible to configure a hash function that cannot be strongly discriminated from a random oracle even when configured using an ideal compression function with broken unidirectionality. This hash function is more efficient than the zipper hash function or the double pipe hash function.

実施の形態1に係るハッシュ値演算装置10の機能を示す機能ブロック図。FIG. 3 is a functional block diagram illustrating functions of the hash value calculation device 10 according to the first embodiment. 図1に示すハッシュ値演算装置10の動作を示すフローチャート。3 is a flowchart showing the operation of the hash value calculation apparatus 10 shown in FIG. 図1に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 3 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 1. 値p[1],...,値p[i]を生成する機能を追加した実施の形態1に係るハッシュ値演算装置10の機能を示す機能ブロック図。The values p [1],. . . , A functional block diagram showing functions of the hash value computing device 10 according to the first embodiment to which a function of generating a value p [i] is added. 図4に示すハッシュ値演算装置10の動作を示すフローチャート。5 is a flowchart showing the operation of the hash value calculation device 10 shown in FIG. 図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 5 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 4. 所定のパディング処理を行う場合の図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 5 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 4 when performing a predetermined padding process. 圧縮関数としてSHA−256を用いる場合の図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 5 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 4 when SHA-256 is used as a compression function. 実施の形態2に係るハッシュ値演算装置10の機能を示す機能ブロック図。FIG. 4 is a functional block diagram showing functions of a hash value calculation device 10 according to the second embodiment. 図9に示すハッシュ値演算装置10の動作を示すフローチャート。10 is a flowchart showing the operation of the hash value calculation apparatus 10 shown in FIG. 図9に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 10 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 9. 値p[1],...,値p[i]を生成する機能を追加した実施の形態2に係るハッシュ値演算装置10の機能を示す機能ブロック図。The values p [1],. . . , A functional block diagram showing functions of the hash value computing device 10 according to the second embodiment to which a function of generating a value p [i] is added. 図12に示すハッシュ値演算装置10の動作を示すフローチャート。13 is a flowchart showing the operation of the hash value calculation device 10 shown in FIG. 図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 13 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 12. 所定のパディング処理を行う場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 13 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 12 when a predetermined padding process is performed. 所定のパディング処理を行う場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 13 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 12 when a predetermined padding process is performed. 圧縮関数としてSHA−256を用いる場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 13 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 12 when SHA-256 is used as a compression function. 実施の形態3に係るハッシュ値演算装置10の機能を示す機能ブロック図。FIG. 9 is a functional block diagram illustrating functions of a hash value computing device 10 according to a third embodiment. 図18に示すハッシュ値演算装置10の動作を示すフローチャート。The flowchart which shows operation | movement of the hash value calculating apparatus 10 shown in FIG. 図18に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 19 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 18. 値p[1],...,値p[i+1]を生成する機能を追加した実施の形態3に係るハッシュ値演算装置10の機能を示す機能ブロック図。The values p [1],. . . , A functional block diagram showing functions of the hash value computing device 10 according to the third embodiment to which a function of generating a value p [i + 1] is added. 図21に示すハッシュ値演算装置10の動作を示すフローチャート。The flowchart which shows operation | movement of the hash value calculating apparatus 10 shown in FIG. 図21に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 22 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 21. 所定のパディング処理を行う場合の図21に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 22 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 21 when a predetermined padding process is performed. 圧縮関数としてSHA−256を用いる場合の図21に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 22 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 21 when SHA-256 is used as a compression function. 実施の形態4に係るハッシュ値演算装置10の機能を示す機能ブロック図。FIG. 6 is a functional block diagram showing functions of a hash value computing device 10 according to a fourth embodiment. 図26に示すハッシュ値演算装置10の動作を示すフローチャート。27 is a flowchart showing the operation of the hash value calculation device 10 shown in FIG. 図26に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 27 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 26. 値p[1],...,値p[i]を生成する機能を追加した実施の形態2に係るハッシュ値演算装置10の機能を示す機能ブロック図。The values p [1],. . . , A functional block diagram showing functions of the hash value computing device 10 according to the second embodiment to which a function of generating a value p [i] is added. 図29に示すハッシュ値演算装置10の動作を示すフローチャート。The flowchart which shows operation | movement of the hash value calculating apparatus 10 shown in FIG. 図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 30 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 29. 所定のパディング処理を行う場合の図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 30 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 29 when a predetermined padding process is performed. 圧縮関数としてSHA−256を用いる場合の図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 30 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 29 when SHA-256 is used as a compression function. 実施の形態5に係るハッシュ値演算装置10の機能を示す機能ブロック図。FIG. 6 is a functional block diagram showing functions of a hash value computing device 10 according to a fifth embodiment. 図34に示すハッシュ値演算装置10の動作を示すフローチャート。35 is a flowchart showing the operation of the hash value computing device 10 shown in FIG. 図34に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 35 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 34. 値p[1],...,値p[i]を生成する機能を追加した実施の形態5に係るハッシュ値演算装置10の機能を示す機能ブロック図。The values p [1],. . . , A functional block diagram showing functions of the hash value computing device 10 according to the fifth embodiment to which a function of generating a value p [i] is added. 図37に示すハッシュ値演算装置10の動作を示すフローチャート。38 is a flowchart showing the operation of the hash value calculation device 10 shown in FIG. 図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 38 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37. 所定のパディング処理を行う場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 38 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37 when a predetermined padding process is performed. 所定のパディング処理を行う場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 38 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37 when a predetermined padding process is performed. 圧縮関数としてSHA−256を用いる場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図。FIG. 38 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37 when SHA-256 is used as a compression function. ハッシュ値演算装置10のハードウェア構成の一例を示す図。The figure which shows an example of the hardware constitutions of the hash value calculating apparatus.

まず、ハッシュ関数の安全性の概念について説明する。   First, the concept of security of the hash function will be described.

ハッシュ関数は、任意長の値を入力として、固定長の値を出力する関数である。
ハッシュ関数の満たすべき性質として、以下の3つの性質がある。以下、ハッシュ関数をHとする。
1.衝突困難性(collision resistance):H(M)=H(M’)となる2つの値M,M’を見つけることが困難であること。
2.第2現像計算困難性(second preimage resistance):ランダムな値Mに対して、H(M)=H(M’)となる値Mとは異なる値M’を見つけることが困難であること。
3.現像計算困難性(preimage resistance):ランダムな値zに対して、z=H(M)となる値Mを見つけることが困難であること。
The hash function is a function that takes an arbitrary length value as input and outputs a fixed length value.
There are the following three properties as properties to be satisfied by the hash function. Hereinafter, the hash function is H.
1. Collision resistance: It is difficult to find two values M and M ′ such that H (M) = H (M ′).
2. Second development difficulty: Second value calculation difficulty: it is difficult to find a value M ′ different from the value M for H (M) = H (M ′) for a random value M.
3. Development calculation difficulty: For a random value z, it is difficult to find a value M such that z = H (M).

ハッシュ関数は、入力長、出力長が固定された圧縮関数と呼ばれる関数から構成される。ハッシュ関数の代表的な構成として、MD(Merkle−Damgard)構造がある。
MD構造は、以下のような構成である。
(Step1)入力Mにstrengthen MDパディングを適用し、長さがmの倍数となる値M’を作る。
(Step2)M’をmビットの値p[1],...,p[i]に分割する。
(Step3)値p[1],...,p[i]のそれぞれに対し、c[j]=h(c[j−1],p[j])を計算する。ここで、c[0]はnビットの固定値である。また、hは圧縮関数である。圧縮関数hは、入力として、nビットの値とmビットの値との2つの値を入力として、nビットの値を出力する関数である。
(Step4)C[i]を出力する。
The hash function is composed of a function called a compression function with a fixed input length and output length. A typical configuration of the hash function is an MD (Mercle-Damgard) structure.
The MD structure has the following configuration.
(Step 1) Apply the strength MD padding to the input M to create a value M ′ whose length is a multiple of m.
(Step 2) M ′ is changed to an m-bit value p [1],. . . , P [i].
(Step 3) Values p [1],. . . , P [i], c [j] = h (c [j−1], p [j]) is calculated. Here, c [0] is an n-bit fixed value. H is a compression function. The compression function h is a function that receives an n-bit value and an m-bit value as inputs and outputs an n-bit value.
(Step 4) Output C [i].

ハッシュ関数を用いるOAEP(Optimal Asymmetric Encryption Padding)やPSS(Probabilistic Signature Scheme)等の暗号アルゴリズムは、ハッシュ関数ではなく、理想関数であるランダムオラクルを用いた場合に安全であることが証明されている。
ランダムオラクルとは、予め全ての入力値と、各入力値に対してランダムに選択された出力値とのペアをリスト(メモリ)に記録しておき、入力値に対する出力値は、予め記録したリストを引いて決定する関数である。
Encryption algorithms such as OAEP (Optical Asymmetry Encryption Padding) and PSS (Probabilistic Signature Scheme) using a hash function have been proved to be safe when using a random oracle that is an ideal function, not a hash function.
A random oracle is a list (memory) in which pairs of all input values and output values randomly selected for each input value are recorded in advance. This function is determined by subtracting.

ランダムオラクルモデルを用いた場合に安全な暗号アルゴリズムは、ランダムオラクルに代えて安全なハッシュ関数を用いても、安全であると考えられている。ここで、安全なハッシュ関数とは、上述した3つの性質を満たすハッシュ関数である。   A cryptographic algorithm that is secure when the random oracle model is used is considered to be safe even if a secure hash function is used instead of the random oracle. Here, the secure hash function is a hash function that satisfies the above three properties.

しかし、実際には、ランダムオラクルを用いた場合に安全である暗号アルゴリズムが、ランダムオラクルに代えて安全なハッシュ関数を用いた場合にも安全であるとは限らない。つまり、ランダムオラクルを用いた暗号アルゴリズムが安全であっても、安全なハッシュ関数を用いた暗号アルゴリズムが安全であるとは限らない。
実際には、ランダムオラクルを用いた場合に安全である暗号アルゴリズムに対して、ランダムオラクルに代えてハッシュ関数を用いた場合に、その暗号アルゴリズムが安全であるというためには、用いたハッシュ関数がランダムオラクルといわゆる強識別不可能(非特許文献5参照)である必要がある。
つまり、ランダムオラクルを用いた場合に安全であることが証明されている暗号アルゴリズムが、ランダムオラクルと強識別不可能であるハッシュ関数を用いた場合には安全である。すなわち、ランダムオラクルを用いた暗号アルゴリズムが安全であれば、ランダムオラクルと強識別不可能であるハッシュ関数を用いた暗号アルゴリズムは安全である。
However, in practice, a cryptographic algorithm that is secure when using a random oracle is not always secure when a secure hash function is used instead of the random oracle. That is, even if a cryptographic algorithm using a random oracle is safe, a cryptographic algorithm using a secure hash function is not always safe.
Actually, when a hash function is used instead of a random oracle for a cryptographic algorithm that is safe when using a random oracle, the hash function used is: The random oracle needs to be incapable of being strongly discriminated (see Non-Patent Document 5).
In other words, a cryptographic algorithm that has been proved to be safe when using a random oracle uses a hash function that cannot be strongly distinguished from a random oracle. That is, if a cryptographic algorithm using a random oracle is secure, a cryptographic algorithm using a hash function that cannot be strongly distinguished from a random oracle is safe.

ランダムオラクルと強識別不可能であるハッシュ関数とは、例えば、EMD(Employed Merkle−Damgard),MDP(Merkle−Damgard with Permutation)等である。   The hash function that cannot be strongly discriminated from the random oracle is, for example, EMD (Exploited Markle-Damgard), MDP (Mercle-Damard with Permutation), or the like.

一般に、EMDやMDPのように、ランダムオラクルといわゆる強識別不可能であるハッシュ関数は、圧縮関数として理想化された圧縮関数(FILRO(Fixed Input Length Random Oracle))を用いて構成される。つまり、EMDやMDPに代表されるハッシュ関数は、圧縮関数として理想化された圧縮関数(FILRO)を用いた場合に、ランダムオラクルといわゆる強識別不可能である。
理想化された圧縮関数(FILRO)とは、以下の1,2が与えられた圧縮関数である。
1.(リスト):全ての入力値と、各入力値に対してランダムに選択した出力値とのペアを記録したリストを持つ。
2.(順方向の値を出力するオラクル):入力値(x,y)に対し、リストから入力に対する出力値zを検索して、値zを出力する。つまり、f1(x,y)=zとなる値zを出力する。
Generally, a hash function that cannot be strongly discriminated from a random oracle like EMD or MDP is configured using a compression function (FILRO (Fixed Input Length Random Oracle)) idealized as a compression function. That is, a hash function typified by EMD or MDP cannot be so strongly discriminated from a random oracle when an idealized compression function (FILRO) is used as a compression function.
The idealized compression function (FILRO) is a compression function to which the following 1 and 2 are given.
1. (List): It has a list in which pairs of all input values and output values randomly selected for each input value are recorded.
2. (Oracle that outputs a value in the forward direction): For the input value (x, y), the output value z for the input is searched from the list, and the value z is output. That is, a value z satisfying f1 (x, y) = z is output.

また、背景技術として記載したように、理想化された圧縮関数(FILRO)ではなく、一方向性が破られた理想的な圧縮関数(WFILRO)を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能であるハッシュ関数がある(非特許文献1,2参照)。
一方向性が破られた理想的な圧縮関数(WFILRO)とは、1−5が与えられた圧縮関数である。
1.(リスト):全ての入力値と、各入力値に対してランダムに選択した出力値とのペアを記録したリストを持つ。
2.(順方向の値を出力するオラクル):入力値(x,y)に対し、リストから入力に対する出力値zを検索して、値zを出力する。つまり、f1(x,y)=zとなる値zを出力する。
3.(一方向性を破るオラクル1):入力値zに対して、f1(x,y)=zを満たす全ての値(x,y)のペアからランダムに1つのペア選択して、選択したペアを出力する。
4.(一方向性を破るオラクル2):入力値x,zに対して、f1(x,y)=zを満たす全ての値yからランダムに1つの値を選択して、選択した値を出力する。入力値x,zに対して、f1(x,y)=zを満たす値yが存在しない場合は、識別情報⊥を出力する。
5.(一方向性を破るオラクル3):入力値y,zに対して、f1(x,y)=zを満たす全ての値xからランダムに1つの値を選択して、選択した値を出力する。入力値y,zに対して、f1(x,y)=zを満たす値xが存在しない場合は、識別情報⊥を出力する。
In addition, as described in the background art, even if the configuration is made using an ideal compression function (WFILRO) whose unidirectionality is broken instead of an ideal compression function (FILRO), a random oracle And a so-called hash function that cannot be strongly discriminated (see Non-Patent Documents 1 and 2).
The ideal compression function (WFILRO) whose unidirectionality is broken is a compression function given 1-5.
1. (List): It has a list in which pairs of all input values and output values randomly selected for each input value are recorded.
2. (Oracle that outputs a value in the forward direction): For the input value (x, y), the output value z for the input is searched from the list, and the value z is output. That is, a value z satisfying f1 (x, y) = z is output.
3. (Oracle 1 that breaks unidirectionality): For the input value z, one pair is selected at random from all pairs of values (x, y) that satisfy f1 (x, y) = z, and the selected pair Is output.
4). (Oracle 2 that breaks unidirectionality): For input values x and z, one value is randomly selected from all values y satisfying f1 (x, y) = z, and the selected value is output. . If there is no value y satisfying f1 (x, y) = z for the input values x and z, the identification information ⊥ is output.
5. (Oracle 3 that breaks unidirectionality): For input values y and z, one value is randomly selected from all values x satisfying f1 (x, y) = z, and the selected value is output. . When there is no value x satisfying f1 (x, y) = z for the input values y and z, the identification information ⊥ is output.

一方向性が破られた理想的な圧縮関数(WFILRO)とは、理想化された圧縮関数(FILRO)に加え、さらに上記3−5が与えられた圧縮関数である。理想化された圧縮関数(FILRO)に比べ、一方向性が破られた理想的な圧縮関数(WFILRO)の方が、上記3−5が与えられた分、安全性が低い圧縮関数であると言える。
例えば、攻撃者Aがいた場合、理想化された圧縮関数(FILRO)であれば、攻撃者Aが上記1,2のみを用いることができる状態であり、一方向性が破られた理想的な圧縮関数(WFILRO)であれば、攻撃者Aが上記1−5を用いることができる状態である。すなわち、理想化された圧縮関数(FILRO)に比べ、一方向性が破られた理想的な圧縮関数(WFILRO)の方が、攻撃者Aに与えられる機能が多い分、攻撃者Aはより容易に攻撃することができる。そのため、理想化された圧縮関数(FILRO)に比べ、一方向性が破られた理想的な圧縮関数(WFILRO)の方が、上記3−5が与えられた分、安全性が低い圧縮関数であると言える。
The ideal compression function (WFILRO) whose unidirectionality is broken is a compression function to which the above 3-5 is given in addition to the idealized compression function (FILRO). Compared to the idealized compression function (FILRO), the ideal compression function (WFILRO) whose unidirectionality is broken is a compression function that is less secure because of the above 3-5. I can say that.
For example, when there is an attacker A, an ideal compression function (FILRO) is a state in which the attacker A can use only the above 1 and 2, and an ideal in which unidirectionality is broken. If it is a compression function (WFILRO), the attacker A can use 1-5 above. That is, compared with the idealized compression function (FILRO), the ideal compression function (WFILRO) whose unidirectionality has been broken has more functions given to the attacker A, so that the attacker A is easier. Can attack. Therefore, compared with the idealized compression function (FILRO), the ideal compression function (WFILRO) whose unidirectionality has been broken is a compression function that is less secure because the above 3-5 is given. It can be said that there is.

安全性の低い圧縮関数を用いて構成した場合であっても、ランダムオラクルと強識別不可能であるハッシュ関数は、安全性の高い圧縮関数を用いて構成した場合にのみ、ランダムオラクルと強識別不可能であるハッシュ関数よりも、ハッシュ関数の構成として、安全性の観点から優れていると言える。
つまり、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能であるハッシュ関数の方が、理想化された圧縮関数(FILRO)を用いて構成した場合にのみ、ランダムオラクルといわゆる強識別不可能であるハッシュ関数よりも、ハッシュ関数の構成として、安全性の観点から優れていると言える。
A hash function that cannot be strongly discriminated from a random oracle even when configured using a low-security compression function is strongly discriminated from a random oracle only when configured using a high-security compression function. It can be said that the configuration of the hash function is superior to the impossible hash function from the viewpoint of security.
In other words, even when the configuration is made using an ideal compression function (WFILRO) whose unidirectionality is broken, a random oracle and a so-called hash function that cannot be strongly discriminated are more ideally compressed. Only when it is configured using a function (FILRO), it can be said that the configuration of the hash function is superior to the hash function that cannot be strongly discriminated from the random oracle from the viewpoint of security.

以下の実施の形態において、非特許文献1,2に記載されたジッパーハッシュ関数とダブルパイプハッシュ関数と同様に、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。特に、非特許文献1,2に記載されたジッパーハッシュ関数とダブルパイプハッシュ関数よりも、効率的に計算可能なハッシュ関数を構成するハッシュ値演算装置10について説明する。   In the following embodiments, similar to the zipper hash function and the double pipe hash function described in Non-Patent Documents 1 and 2, an ideal compression function (WFILRO) whose unidirectionality is broken is used. Even in this case, the hash value computing device 10 that constitutes a new hash function that cannot be strongly discriminated from a random oracle will be described. In particular, the hash value calculation device 10 that constitutes a hash function that can be calculated more efficiently than the zipper hash function and the double pipe hash function described in Non-Patent Documents 1 and 2 will be described.

また、以下の実施の形態において、一方向性が破られた理想的な圧縮関数(WFILRO)のうち、5.(一方向性を破るオラクル3)が与えられていない圧縮関数(以下、準一方向性が破られた理想的な圧縮関数と呼ぶ)を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
準一方向性が破られた理想的な圧縮関数は、一方向性が破られた理想的な圧縮関数(WFILRO)よりも安全性が高い圧縮関数である。そのため、準一方向性が破られた理想的な圧縮関数を用いて構成した場合に、ランダムオラクルといわゆる強識別不可能であるハッシュ関数よりも、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合に、ランダムオラクルといわゆる強識別不可能であるハッシュ関数の方が、ハッシュ関数の構成として、安全性の観点から優れていると言える。しかし、準一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能であるハッシュ関数は、理想的な圧縮関数(FILRO))を用いて構成した場合にのみ、ランダムオラクルといわゆる強識別不可能であるハッシュ関数よりも、ハッシュ関数の構成として、安全性の観点から優れていると言える。そこで、以下の実施の形態では、準一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10についても説明する。
In the following embodiment, among the ideal compression functions (WFILRO) whose unidirectionality is broken, 5. Even if it is configured using a compression function to which (Oracle 3 that breaks unidirectionality) is not given (hereinafter referred to as an ideal compression function whose quasi-unidirectionality is broken), it is called a random oracle. The hash value computing device 10 that constitutes a new hash function that cannot be strongly identified will be described.
The ideal compression function whose quasi-unidirectionality is broken is a compression function that is safer than the ideal compression function (WFILRO) whose unidirectionality is broken. Therefore, when configured using an ideal compression function that breaks quasi-unidirectionality, it is an ideal compression function that breaks unidirectionality rather than a random oracle and a hash function that cannot be strongly discriminated. When configured using (WFILRO)), it can be said that a hash function that cannot be strongly discriminated from a random oracle is superior as a hash function configuration from the viewpoint of security. However, even if it is configured using an ideal compression function whose quasi-unidirectionality is broken, a random oracle and a hash function that is so-called strongly discriminating is an ideal compression function (FILRO)). It can be said that it is superior from the viewpoint of security as a structure of a hash function rather than a hash function that cannot be strongly discriminated from a random oracle only when configured using it. Therefore, in the following embodiment, a new hash function that cannot be strongly discriminated from a random oracle is configured even if it is configured using an ideal compression function whose quasi-unidirectionality is broken. The hash value calculation device 10 will also be described.

まず、実施の形態1−3で、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である3つの新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
次に、実施の形態4,5で、準一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である2つの新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
First, even in the case of using the ideal compression function (WFILRO) whose unidirectionality is broken in Embodiment 1-3, three new ones that cannot be discriminated strongly from a random oracle. A hash value computing device 10 that constitutes a simple hash function will be described.
Next, in the fourth and fifth embodiments, two new hashes that are indistinguishable from a random oracle even if they are configured using an ideal compression function whose quasi-unidirectionality is broken. The hash value calculation device 10 constituting the function will be described.

なお、以下の実施の形態において、圧縮関数hは、nビットの値とmビットの値との2つの値が入力された場合にnビットの値を出力する圧縮関数である。ここで、mは所定の自然数であり、nはmよりも小さい自然数である。   In the following embodiments, the compression function h is a compression function that outputs an n-bit value when two values, an n-bit value and an m-bit value, are input. Here, m is a predetermined natural number, and n is a natural number smaller than m.

また、以下の説明において、処理装置は後述するCPU911、演算回路等である。記憶装置は後述するROM913、RAM914(メモリ,キャッシュメモリ)、磁気ディスク920等である。入力装置は後述するキーボード902、通信ボード915等である。出力装置は後述するRAM914、磁気ディスク920、通信ボード915、LCD901等である。つまり、処理装置、記憶装置、入力装置、出力装置はハードウェアである。また、記憶装置とは、上記の通り、RAM914(メモリ,キャッシュメモリ)等を含むものであるから、以下の説明において記憶装置に記憶するとは、RAM914(メモリ,キャッシュメモリ)に一時記憶することを意味する場合もある。   In the following description, the processing device includes a CPU 911, an arithmetic circuit, and the like which will be described later. The storage device is a ROM 913, a RAM 914 (memory, cache memory), a magnetic disk 920, etc., which will be described later. The input device is a keyboard 902, a communication board 915, and the like which will be described later. The output device is a RAM 914, a magnetic disk 920, a communication board 915, an LCD 901, etc., which will be described later. That is, the processing device, the storage device, the input device, and the output device are hardware. Further, as described above, the storage device includes the RAM 914 (memory, cache memory) and the like. Therefore, in the following description, storing in the storage device means temporarily storing in the RAM 914 (memory, cache memory). In some cases.

実施の形態1.
実施の形態1では、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
Embodiment 1 FIG.
In the first embodiment, a new hash function that cannot be strongly discriminated from a random oracle is configured even if it is configured using an ideal compression function (WFILRO) whose unidirectionality is broken. The hash value calculation device 10 will be described.

図1は、実施の形態1に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図2は、図1に示すハッシュ値演算装置10の動作を示すフローチャートである。
図3は、図1に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 1 is a functional block diagram illustrating functions of the hash value calculation device 10 according to the first embodiment.
FIG. 2 is a flowchart showing the operation of the hash value calculation apparatus 10 shown in FIG.
FIG. 3 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG.

図1に示すハッシュ値演算装置10の機能と動作について説明する。
図1に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 1 will be described.
The hash value calculation device 10 shown in FIG. 1 includes a predetermined length value input unit 11, a fixed value addition unit 12, a compression function calculation unit 13, and an output unit 14.

(S101:既定長値入力ステップ)
既定長値入力部11は、m−nビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S101: Default length input step)
The predetermined length value input unit 11 includes i values p [1],. . . , Value p [i] is input by the input device and stored in the storage device.

(S102:固定値付加ステップ)
固定値付加部12は、(S101)で入力されたm−nビット長のi個の値p[1],...,値p[i]のうち、i−1個の値p[1],...,値p[i−1]のそれぞれに対して、予め記憶装置に記憶したnビット長の固定値const[1],...,固定値const[i−1]を付加して、mビット長の値x[1],...,値x[i−1]を処理装置により生成して記憶装置に記憶する。
つまり、固定値付加部12は、値p[1]に固定値const[1]を付加して、値x[1]を生成する。固定値付加部12は、値p[2]に固定値const[2]を付加して、値x[2]を生成する。以下同様に、j=3,...,i−1に対して、固定値付加部12は、値p[j]に固定値const[j]を付加して、値x[j]を生成する。
なお、j=1,...,i−1について、値p[j]に固定値const[j]を付加する位置は、どこであってもよい。つまり、固定値const[j]は、値p[j]の前や後に追加してもよいし、値p[j]の間に挿入してもよい。
また、固定値const[1]=固定値const[2]=...=固定値const[i−1]でもよいし、固定値const[1]≠固定値const[2]≠...≠固定値const[i−1]でもよい。
(S102: fixed value addition step)
The fixed value adding unit 12 receives the i values p [1],. . . , Value p [i], i−1 values p [1],. . . , Values p [i−1], n-bit fixed values const [1],. . . , A fixed value const [i−1], and an m-bit length value x [1],. . . , Value x [i−1] is generated by the processing device and stored in the storage device.
That is, the fixed value adding unit 12 adds the fixed value const [1] to the value p [1] to generate the value x [1]. The fixed value adding unit 12 adds the fixed value const [2] to the value p [2] to generate the value x [2]. Similarly, j = 3,. . . , I−1, the fixed value adding unit 12 adds the fixed value const [j] to the value p [j] to generate the value x [j].
Note that j = 1,. . . , I−1, the position where the fixed value const [j] is added to the value p [j] may be anywhere. That is, the fixed value const [j] may be added before or after the value p [j], or may be inserted between the values p [j].
Also, fixed value const [1] = fixed value const [2] =. . . = Fixed value const [i−1], or fixed value const [1] ≠ fixed value const [2] ≠. . . ≠ Fixed value const [i−1] may be used.

(S103:第1圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV1と、(S102)で生成されたmビット長の値x[1]とを圧縮関数hの入力として、c[1]=h(IV1,x[1])を処理装置により計算してnビット長の値c[1]を得て記憶装置に記憶する。
(S103: First compression function calculation step)
The compression function calculation unit 13 receives the fixed value IV1 having an n-bit length stored in the storage device in advance and the m-bit length value x [1] generated in (S102) as an input of the compression function h. ] = H (IV1, x [1]) is calculated by the processing device to obtain a value c [1] having an n-bit length and stored in the storage device.

(S104:第2圧縮関数計算ステップ)
圧縮関数計算部13は、j=2からi−1まで順に、nビット長の値c[j−1]とmビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を処理装置により計算してnビット長の値c[j]を得て記憶装置に記憶する。
つまり、まず、圧縮関数計算部13は、(S103)で計算したnビット長の値c[1]と、(S102)で生成されたmビット長の値x[2]とを入力として、c[2]=h(c[1],x[2])を処理装置により計算して値c[2]を得る。
次に、圧縮関数計算部13は、計算したnビット長の値c[2]と、(S102)で生成されたmビット長の値x[3]とを入力として、c[3]=h(c[2],x[3])を処理装置により計算してnビット長の値c[3]を得る。
これを繰り返して、最終的に、圧縮関数計算部13は、計算したnビット長の値c[i−2]と、(S102)で生成されたmビット長の値x[i−1]とを入力として、c[i−1]=h(c[i−2],x[i−1])を処理装置により計算してnビット長の値c[i−1]を得る。
(S104: Second compression function calculation step)
The compression function calculation unit 13 uses the value c [j−1] of n bits and the value x [j] of m bits in order from j = 2 to i−1 as inputs of the compression function h. ] = H (c [j−1], x [j]) is calculated by the processing device to obtain a value c [j] having an n-bit length and stored in the storage device.
That is, first, the compression function calculation unit 13 receives the value c [1] of the n-bit length calculated in (S103) and the value x [2] of the m-bit length generated in (S102) as c [2] = h (c [1], x [2]) is calculated by the processing device to obtain the value c [2].
Next, the compression function calculation unit 13 receives the calculated n-bit length value c [2] and the m-bit length value x [3] generated in (S102) as input, and c [3] = h (C [2], x [3]) is calculated by the processing device to obtain an n-bit length value c [3].
By repeating this, finally, the compression function calculation unit 13 calculates the calculated value c [i−2] of n bits and the value x [i−1] of m bits generated in (S102). As an input, c [i-1] = h (c [i-2], x [i-1]) is calculated by the processing device to obtain an n-bit long value c [i-1].

(S105:第3圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV2と、m−nビット長の値p[i]に(S104)で計算したnビット長の値c[i−1]を付加したmビット長の値x[i]とを圧縮関数hの入力として、c[i]=h(IV2,x[i])を処理装置により計算して値c[i]を得て記憶装置に記憶する。
なお、値p[i]に値c[i−1]を付加する位置は、どこであってもよい。つまり、値c[i−1]は、値p[i]の前や後に追加してもよいし、値p[i]の間に挿入してもよい。
(S105: third compression function calculation step)
The compression function calculation unit 13 converts the n-bit length value c [i−1] calculated in (S104) into the n-bit length fixed value IV2 stored in advance in the storage device and the mn bit-length value p [i]. ] Is added to the compression function h, and c [i] = h (IV2, x [i]) is calculated by the processor to obtain the value c [i]. And store it in the storage device.
The position where the value c [i-1] is added to the value p [i] may be anywhere. That is, the value c [i-1] may be added before or after the value p [i], or may be inserted between the values p [i].

(S106:出力ステップ)
出力部14は、(S105)で計算された値c[i]を出力装置により出力する。
(S106: output step)
The output unit 14 outputs the value c [i] calculated in (S105) by the output device.

なお、i=2の場合、つまり(S101)で2個の値p[1]と値p[2]とのみが入力された場合には、(S104)は実行されない。つまり、(S103)で値c[1]を得た後、(S105)で固定値IV2と、値p[2]に値c[1]を付加した値x[2]とを入力として、値c[2]を得る。そして、(S106)で値c[2]を出力する。   When i = 2, that is, when only two values p [1] and p [2] are input in (S101), (S104) is not executed. That is, after the value c [1] is obtained in (S103), the fixed value IV2 and the value x [2] obtained by adding the value c [1] to the value p [2] are input as values. c [2] is obtained. Then, the value c [2] is output in (S106).

また、i=1の場合、つまり(S101)で1個の値p[1]のみが入力された場合には、(S102)から(S104)までは実行されない。つまり、(S101)で値p[1]が入力された後、(S105)で固定値IV2と、値p[1]に固定値IV1を付加した値x[1]とを入力として、値c[1]を得る。そして、(S106)で値c[1]を出力する。   When i = 1, that is, when only one value p [1] is input in (S101), steps (S102) to (S104) are not executed. That is, after the value p [1] is input in (S101), the fixed value IV2 and the value x [1] obtained by adding the fixed value IV1 to the value p [1] are input as the value c in (S105). [1] is obtained. The value c [1] is output in (S106).

以上をまとめると、次のようになる。
まず、ハッシュ値演算装置10は、j=1からi−1まで順に、c[j]=h(c[j−1],p[j]||const[j])を計算する。ここで、c[0]は、IV1とする。
次に、ハッシュ値演算装置10は、c[i]=h(IV2,p[i]||c[i−1])を計算する。
そして、ハッシュ値演算装置10は、値c[i]を出力する。
The above is summarized as follows.
First, the hash value calculation device 10 calculates c [j] = h (c [j−1], p [j] || const [j]) in order from j = 1 to i−1. Here, c [0] is IV1.
Next, the hash value calculation apparatus 10 calculates c [i] = h (IV2, p [i] || c [i-1]).
Then, the hash value calculation device 10 outputs the value c [i].

上記説明では、(S101)で既定長値入力部11が、m−nビット長のi個の値p[1],...,値p[i]を入力するとした。しかし、通常、ハッシュ関数へ入力される値は、1個の任意ビット長の値である。つまり、上記説明では、1個の任意ビット長の値が入力された場合に、どのようにm−nビット長のi個の値p[1],...,値p[i]を生成するのかについては説明を省略した。
次に、任意ビット長の値が入力された場合に、m−nビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10について説明する。
In the above description, in (S101), the predetermined length input unit 11 determines that the i values p [1],. . . , The value p [i] is input. However, normally, the value input to the hash function is one arbitrary bit length value. In other words, in the above description, when one arbitrary bit length value is input, how the i values p [1],. . . , And the value p [i] is not described.
Next, when a value having an arbitrary bit length is input, i values p [1],. . . The hash value computing device 10 to which a function for generating the value p [i] is added will be described.

図4は、図1に示すハッシュ値演算装置10に、任意ビット長の値が入力された場合に、m−nビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10の機能を示す機能ブロック図である。
図5は、図4に示すハッシュ値演算装置10の動作を示すフローチャートである。
図6は、図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 4 shows the case where i values p [1],... With m−n bit length are input to the hash value arithmetic unit 10 shown in FIG. . . , Is a functional block diagram showing functions of the hash value computing device 10 to which a function for generating a value p [i] is added.
FIG. 5 is a flowchart showing the operation of the hash value calculation apparatus 10 shown in FIG.
FIG. 6 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図4に示すハッシュ値演算装置10の機能と動作について説明する。
図4に示すハッシュ値演算装置10は、図1に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 4 will be described.
The hash value calculation device 10 illustrated in FIG. 4 includes an arbitrary length value input unit 15, a padding unit 16, and a division unit 17 in addition to the functions included in the hash value calculation device 10 illustrated in FIG. 1.

(S111:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S111: arbitrary length value input step)
The arbitrary length value input unit 15 inputs an arbitrary bit length value M from the input device.

(S112:パディングステップ)
パディング部16は、(S111)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−nビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S112: Padding step)
The padding unit 16 adds a predetermined value to the value M input in (S111) by using the padding function pad, and processes a value M ′ having a bit length i times the mn bit length. Is generated and stored in the storage device. That is, the padding unit 16 calculates M ′ = pad (M) by the processing device to obtain the value M ′.

(S113:分割ステップ)
分割部17は、(S112)で生成された値M’を処理装置によりi個に分割して、m−nビット長の値p[1],...,値p[i]を生成して記憶装置に記憶する。つまり、分割部17は、M’=p[1]||...||p[i]を処理装置により計算して値p[1],...,値p[i]を得る。
(S113: Division step)
The dividing unit 17 divides the value M ′ generated in (S112) into i pieces by the processing device, and sets the values p [1],. . . , Value p [i] is generated and stored in the storage device. That is, the dividing unit 17 sets M ′ = p [1] ||. . . || p [i] is calculated by the processing unit and the values p [1],. . . , Value p [i] is obtained.

(S114:既定長値入力ステップ)
既定長値入力部11は、(S113)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S114: predetermined length input step)
The predetermined length value input unit 11 receives the values p [1],. . . , Value p [i] is input by an input device.

(S115)から(S119)までの処理は、(S102)から(S106)までの処理と同一である。   The processing from (S115) to (S119) is the same as the processing from (S102) to (S106).

(S112)におけるパディング方法の一例を説明する。
図7は、以下に説明するパディング処理を行う場合の図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S112)でパディング部16は、(S111)で入力された値Mに対して、“1||0・・・0||<M>を付加して、m−nビット長のi倍のビット長の値M’を処理装置により生成する。ここで、<M>は、Mのビット長|M|の64ビット表現である。
つまり、パディング部16は、先頭が“1”で、その後が複数の“0”で、最後に<M>となるビット列を生成して、値Mに付加して、値M’を生成する。
なお、上記説明では、m−nビット長のi倍のビット長になるようにパディングすると説明した。しかし、予めiの値を決めておくのではなく、iの値は、入力された任意ビット長の値Mに応じて決定されるとしてもよい。例えば、上記パディング方法であれば、最少の0の個数で、m−nビット長の倍数のビット長となるようにパディングし、パディングをした結果得られた値M’のビット長がm−nビット長の何倍かをiの値としてもよい。
An example of the padding method in (S112) will be described.
FIG. 7 is a structural diagram of a hash function realized by the hash value calculation apparatus 10 shown in FIG. 4 when performing the padding process described below.
In (S112), the padding unit 16 adds “1 || 0... 0 || M> to the value M input in (S111), i times the length of mn bits. A bit length value M ′ is generated by the processing unit, where <M> is a 64-bit representation of the bit length | M |
That is, the padding unit 16 generates a bit string that is “1” at the beginning, a plurality of “0” thereafter, and finally <M>, and is added to the value M to generate the value M ′.
In the above description, it has been described that padding is performed so that the bit length is i times the mn bit length. However, instead of predetermining the value of i, the value of i may be determined in accordance with the input arbitrary bit length value M. For example, in the case of the above padding method, padding is performed so that the bit length is a multiple of mn bit length with the minimum number of zeros, and the bit length of the value M ′ obtained as a result of padding is mn The value of i may be several times the bit length.

パディングの方法は、例えば、全て“0”を付加する方法や、全て“1”を付加する方法等、どのような方法であっても構わない。しかし、上記説明のように、パディングして値M’を生成することにより、衝突困難性を高くすることができる。   The padding method may be any method, for example, a method of adding all “0” s or a method of adding all “1” s. However, as described above, the difficulty of collision can be increased by generating the value M ′ by padding.

次に、図4に示すハッシュ値演算装置10の圧縮関数としてSHA−256(Secure Hash Algorithm−256)を用いた場合の例を説明する。なお、SHA−256の圧縮関数をSHA256と呼ぶ。SHA256は、256ビット長の値と512ビット長の値との2つの値が入力された場合に、256ビット長の値を出力する関数である。
図8は、圧縮関数としてSHA−256を用いる場合の図4に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
Next, an example in which SHA-256 (Secure Hash Algorithm-256) is used as the compression function of the hash value computing device 10 shown in FIG. 4 will be described. Note that the compression function of SHA-256 is called SHA256. SHA256 is a function that outputs a 256-bit value when two values, a 256-bit value and a 512-bit value, are input.
FIG. 8 is a structural diagram of a hash function realized by the hash value calculation device 10 shown in FIG. 4 when SHA-256 is used as the compression function.

(S111)では、任意長値入力部15は、任意ビット長の値Mを入力する。
(S112)では、パディング部16は、(S111)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して256(=512−256)ビット長のi倍のビット長の値M’を生成する。
(S113)では、分割部17は、(S112)で生成された値M’をi個に分割して、256ビット長の値p[1],...,値p[i]を生成する。
(S114)では、既定長値入力部11は、(S113)で生成された256ビット長のi個の値p[1],...,値p[i]を入力する。
(S115)では、固定値付加部12は、(S114)で入力された256ビット長のi個の値p[1],...,値p[i]のうち、i−1個の値p[1],...,値p[i−1]のそれぞれに対して、256ビット長の固定値const[1],...,固定値const[i−1]を付加して、512ビット長の値x[1],...,値x[i−1]を生成する。
(S116)では、圧縮関数計算部13は、256ビット長の固定値IV1と、(S115)で生成された512ビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を計算して256ビット長の値c[1]を得る。
(S117)では、圧縮関数計算部13は、j=2からi−1まで順に、256ビット長の値c[j−1]と512ビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を計算して256ビット長の値c[j]を得る。
(S118)では、圧縮関数計算部13は、256ビット長の固定値IV2と、256ビット長の値p[i]に256ビット長の値c[i−1]を付加した512ビット長の値x[i]とを圧縮関数hの入力として、c[i]=h(IV2,x[i])を計算して値c[i]を得る。
(S119)では、出力部14は、(S118)で計算された値c[i]を出力する。
In (S111), the arbitrary length value input unit 15 inputs a value M having an arbitrary bit length.
In (S112), the padding unit 16 adds a predetermined value to the value M input in (S111) by using the padding function pad, and is i times the 256 (= 512-256) bit length. A bit length value M ′ is generated.
In (S113), the dividing unit 17 divides the value M ′ generated in (S112) into i pieces and divides the values p [1],. . . , Value p [i].
In (S114), the predetermined length input unit 11 determines the i values p [1],. . . , Input the value p [i].
In (S115), the fixed value adding unit 12 receives the 256 values i values p [1],. . . , Value p [i], i−1 values p [1],. . . , Value p [i−1], a fixed value const [1],. . . , A fixed value const [i−1] is added, and a value x [1],. . . , Value x [i−1].
In (S116), the compression function calculation unit 13 uses the 256-bit fixed value IV1 and the 512-bit length value x [1] generated in (S115) as the input of the compression function h, and c [1] = h (IV1, x [1]) is calculated to obtain a 256-bit long value c [1].
In (S117), the compression function calculation unit 13 inputs the value c [j-1] of 256 bit length and the value x [j] of 512 bit length in order of the compression function h from j = 2 to i-1. C [j] = h (c [j−1], x [j]) is calculated to obtain a 256-bit long value c [j].
In (S118), the compression function calculation unit 13 adds a 256-bit fixed value IV2 and a 512-bit value obtained by adding a 256-bit length value c [i-1] to a 256-bit length value p [i]. With x [i] as the input of the compression function h, c [i] = h (IV2, x [i]) is calculated to obtain the value c [i].
In (S119), the output unit 14 outputs the value c [i] calculated in (S118).

実施の形態1に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。   The hash function configured by the hash value computing device 10 according to the first embodiment is indistinguishable from a random oracle even if the compression function h is an ideal compression function whose unidirectionality is broken. A hash function that satisfies

なお、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。なお、ストリーム処理とは、入力された先頭のビットから到着順に処理を行う方法であり、並列処理の一類型である。   Note that it is not always necessary to calculate according to the above-described processing order. If stream processing is possible, calculation may be performed by stream processing. Stream processing is a method of performing processing in the order of arrival from the input first bit, and is a type of parallel processing.

また、上記説明では、圧縮関数計算部13は所定の入力値に対して、処理装置により圧縮関数hを計算して、圧縮関数hを計算した結果を得るとした。しかし、圧縮関数計算部13は、ハッシュ値演算装置10の外部に備える圧縮関数計算装置に入力値を入力して、圧縮関数計算装置に圧縮関数hを計算させることにより、圧縮関数hを計算した結果を得てもよい。   In the above description, the compression function calculation unit 13 calculates the compression function h by a processing device for a predetermined input value, and obtains the result of calculating the compression function h. However, the compression function calculation unit 13 calculates the compression function h by inputting the input value to the compression function calculation device provided outside the hash value calculation device 10 and causing the compression function calculation device to calculate the compression function h. Results may be obtained.

また、圧縮関数計算部13が値c[1],...,値c[i]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。   In addition, the compression function calculation unit 13 receives the values c [1],. . . , C [i], the compression function h used for calculating the value c [i] may be the same compression function h or different compression functions h.

つまり、実施の形態1に係るハッシュ値演算装置10をまとめると次のようになる。
ハッシュ値演算装置10は、i個のm−nビットの入力値p[1],...,p[i]に対して、圧縮関数演算装置に、nビット固定値IV1、第1メッセージp[1]、nビット固定値const[1]を入力し、その出力c[1]を得る。次に、圧縮関数演算装置に、nビット値c[1]、第2メッセージp[2]、nビット固定値const[2]を入力し、その出力c[2]を得る。この処理を、第i−1メッセージまで同様に行い、その出力値c[i−1]を得る。圧縮関数演算装置に、初期値IV2、i番目のメッセージp[i]、nビット値c[i−1]を入力し、その出力c[i]を得る。そして、c[i]を出力することを特徴とする。
That is, the hash value calculation apparatus 10 according to the first embodiment is summarized as follows.
The hash value arithmetic unit 10 is configured to input i mn bit input values p [1],. . . , P [i], the n-bit fixed value IV1, the first message p [1], and the n-bit fixed value const [1] are input to the compression function arithmetic unit, and the output c [1] is obtained. Next, the n-bit value c [1], the second message p [2], and the n-bit fixed value const [2] are input to the compression function arithmetic unit, and the output c [2] is obtained. This process is similarly performed up to the (i-1) th message, and the output value c [i-1] is obtained. An initial value IV2, an i-th message p [i], and an n-bit value c [i-1] are input to the compression function arithmetic unit, and an output c [i] is obtained. Then, c [i] is output.

また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、長さがm−nの倍数の値を出力する任意のパディング処理装置を用いて、m−nビットの倍数となるメッセージM’を生成する。そして、分割処理装置を用いてM’をi個のm−nビットの値p[1],...,p[i]に分割することを特徴とする。   In addition, the hash value calculation device 10 uses an arbitrary padding processing device that receives an arbitrary length value from an arbitrary length value M and outputs a value that is a multiple of mn in length, using m-n bits. A message M ′ that is a multiple of is generated. Then, M ′ is converted into i mn bit values p [1],. . . , P [i].

さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。   Further, the hash value computing device 10 changes the padding processing device to M || 1 || 0. . . 0 || <M>. However, <M> represents the bit length of M in 64 bits.

また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。   Further, the hash value calculation device 10 is characterized in that a compression function calculation device of SHA-256 is used as the compression function calculation device.

実施の形態2.
実施の形態2では、実施の形態1とは異なるハッシュ関数であって、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
Embodiment 2. FIG.
In the second embodiment, even when the hash function is different from that of the first embodiment and is configured using an ideal compression function (WFILRO) whose unidirectionality is broken, it is called a random oracle. The hash value computing device 10 that constitutes a new hash function that cannot be strongly identified will be described.

図9は、実施の形態2に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図10は、図9に示すハッシュ値演算装置10の動作を示すフローチャートである。
図11は、図9に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 9 is a functional block diagram illustrating functions of the hash value computing device 10 according to the second embodiment.
FIG. 10 is a flowchart showing the operation of the hash value calculation apparatus 10 shown in FIG.
FIG. 11 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図9に示すハッシュ値演算装置10の機能と動作について説明する。
図9に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 9 will be described.
The hash value calculation device 10 illustrated in FIG. 9 includes a predetermined length value input unit 11, a fixed value addition unit 12, a compression function calculation unit 13, an output unit 14, and an exclusive OR calculation unit 18.

(S201:既定長値入力ステップ)
既定長値入力部11は、m−sビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S201: Default length input step)
The predetermined length value input unit 11 includes i values p [1],. . . , Value p [i] is input by the input device and stored in the storage device.

(S202:排他的論理和計算ステップ)
排他的論理和計算部18は、(S201)で入力されたm−sビット長の値p[1],...,p[i]と、予め記憶装置に記憶したm−sビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算してm−sビット長の値sumを得て記憶装置に記憶する。
(S202: Exclusive OR calculation step)
The exclusive OR calculation unit 18 calculates the values p [1],. . . , P [i] and an m-s bit length fixed value y stored in advance in the storage device as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing device to obtain a value sum of m-s bit length and stored in the storage device.

(S203:固定値付加ステップ)
固定値付加部12は、(S201)で入力されたm−sビット長のi個の値p[1],...,値p[i]のそれぞれに対して、予め記憶装置に記憶したsビット長の固定値const[1],...,固定値const[i]を付加して、mビット長の値x[1],...,値x[i]を処理装置により生成して記憶装置に記憶する。
つまり、固定値付加部12は、値p[1]に固定値const[1]を付加して、値x[1]を生成する。固定値付加部12は、値p[2]に固定値const[2]を付加して、値x[2]を生成する。以下同様に、j=3,...,iに対して、固定値付加部12は、値p[j]に固定値const[j]を付加して、値x[j]を生成する。
なお、j=1,...,i−1について、値p[j]に固定値const[j]を付加する位置は、どこであってもよい。つまり、固定値const[j]は、値p[j]の前や後に追加してもよいし、値p[j]の間に挿入してもよい。
また、固定値const[1]≠固定値const[2]≠...≠固定値const[i]である。例えば、j=1,...,iについて、固定値const[j]は、jをsビットで表現した値<j>である。
(S203: Fixed value addition step)
The fixed value adding unit 12 receives the i values p [1],. . . , Values p [i], s bit length fixed values const [1],. . . , A fixed value const [i], and an m-bit length value x [1],. . . , Value x [i] is generated by the processing device and stored in the storage device.
That is, the fixed value adding unit 12 adds the fixed value const [1] to the value p [1] to generate the value x [1]. The fixed value adding unit 12 adds the fixed value const [2] to the value p [2] to generate the value x [2]. Similarly, j = 3,. . . , I, the fixed value adding unit 12 adds the fixed value const [j] to the value p [j] to generate the value x [j].
Note that j = 1,. . . , I−1, the position where the fixed value const [j] is added to the value p [j] may be anywhere. That is, the fixed value const [j] may be added before or after the value p [j], or may be inserted between the values p [j].
Further, the fixed value const [1] ≠ fixed value const [2] ≠. . . ≠ Fixed value const [i]. For example, j = 1,. . . , I, the fixed value const [j] is a value <j> in which j is expressed by s bits.

(S204:第1圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV1と、(S203)で生成されたmビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を処理装置により計算してnビット長の値c[1]を得て記憶装置に記憶する。
(S204: First compression function calculation step)
The compression function calculation unit 13 receives the fixed value IV1 of n-bit length stored in the storage device in advance and the m-bit length value x [1] generated in (S203) as an input of the compression function h, c [1] = H (IV1, x [1]) is calculated by the processing device to obtain an n-bit length value c [1] and stored in the storage device.

(S205:第2圧縮関数計算ステップ)
圧縮関数計算部13は、j=2からiまで順に、nビット長の値c[j−1]とmビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を処理装置により計算してnビット長の値c[j]を得て記憶装置に記憶する。
つまり、まず、圧縮関数計算部13は、(S204)で計算したnビット長の値c[1]と、(S203)で生成されたmビット長の値x[2]とを入力として、c[2]=h(c[1],x[2])を処理装置により計算してnビット長の値c[2]を得る。
次に、圧縮関数計算部13は、計算したnビット長の値c[2]と、(S203)で生成されたmビット長の値x[3]とを入力として、c[3]=h(c[2],x[3])を処理装置により計算してnビット長の値c[3]を得る。
これを繰り返して、最終的に、圧縮関数計算部13は、計算したnビット長の値c[i−1]と、(S203)で生成されたmビット長の値x[i]とを入力として、c[i]=h(c[i−1],x[i])を処理装置により計算してnビット長の値c[i]を得る。
(S205: Second compression function calculation step)
The compression function calculation unit 13 sequentially inputs the value c [j−1] having an n-bit length and the value x [j] having an m-bit length from j = 2 to i, and inputs c [j] = h (c [j−1], x [j]) is calculated by the processing device to obtain a value c [j] having an n-bit length and stored in the storage device.
That is, first, the compression function calculation unit 13 receives the value c [1] having the n-bit length calculated in (S204) and the value x [2] having the m-bit length generated in (S203) as c [2] = h (c [1], x [2]) is calculated by the processing device to obtain an n-bit length value c [2].
Next, the compression function calculation unit 13 receives the calculated n-bit length value c [2] and the m-bit length value x [3] generated in (S203) as c [3] = h. (C [2], x [3]) is calculated by the processing device to obtain an n-bit length value c [3].
By repeating this, the compression function calculation unit 13 finally inputs the calculated n-bit length value c [i−1] and the m-bit length value x [i] generated in (S203). C [i] = h (c [i−1], x [i]) is calculated by the processing device to obtain an n-bit length value c [i].

(S206:第3圧縮関数計算ステップ)
圧縮関数計算部13は、(S205)で計算したnビット長の値c[i]と、(S202)で計算されたm−sビット長の値sumにsビット長の固定値const[i+1]を付加したmビット長の値x[i+1]とを圧縮関数hの入力として、c[i+1]=h(c[i],x[i+1])を処理装置により計算してnビット長の値c[i+1]を得て記憶装置に記憶する。
なお、固定値const[i+1]≠固定値const[1]≠...≠固定値const[i]である。例えば、固定値const[i+1]は、i+1をsビットで表現した値<i+1>である。
また、値sumに固定値const[i+1]を付加する位置は、どこであってもよい。つまり、固定値const[i+1]は、値sumの前や後に追加してもよいし、値sumの間に挿入してもよい。
(S206: third compression function calculation step)
The compression function calculation unit 13 adds the fixed value const [i + 1] having the s bit length to the value c [i] having the n bit length calculated in (S205) and the value sum having the m-s bit length calculated in (S202). C [i + 1] = h (c [i], x [i + 1]) is calculated by the processing device using the m-bit length value x [i + 1] to which is added as an input to the compression function h, and the n-bit length value is calculated. c [i + 1] is obtained and stored in the storage device.
Note that the fixed value const [i + 1] ≠ fixed value const [1] ≠. . . ≠ Fixed value const [i]. For example, the fixed value const [i + 1] is a value <i + 1> in which i + 1 is expressed by s bits.
Further, the position where the fixed value const [i + 1] is added to the value sum may be anywhere. That is, the fixed value const [i + 1] may be added before or after the value sum, or may be inserted between the values sum.

(S207:第4圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV2と、(S206)で計算したnビット長の値c[i+1]にm−nビット長の固定値const[i+2]を付加した値x[i+2]とを圧縮関数hの入力として、c[i+2]=h(IV2,x[i+2])を処理装置により計算してnビット長の値c[i+2]を得て記憶装置に記憶する。
なお、値c[i+1]に固定値const[i+2]を付加する位置は、どこであってもよい。つまり、固定値const[i+2]は、値c[i+1]の前や後に追加してもよいし、値c[i+1]の間に挿入してもよい。
また、例えば、固定値const[i+2]は、m−n−sビット長の固定値constと、i+2をsビットで表現した値<i+2>との2つの値であってもよい。固定値const[i+2]が固定値constと<i+2>とである場合には、どのように値c[i+1]に固定値constと<i+2>とを付加してもよい。例えば、x[i+2]=<i+2>||const||c[i+1]としてもよい。
(S207: Fourth compression function calculation step)
The compression function calculation unit 13 adds an n-bit length fixed value IV2 stored in the storage device in advance and the n-bit length value c [i + 1] calculated in (S206) to an mn bit length fixed value const [i + 2]. The value x [i + 2] to which is added is used as the input of the compression function h, and c [i + 2] = h (IV2, x [i + 2]) is calculated by the processing device to obtain the value c [i + 2] having an n-bit length. Store in the storage device.
The position where the fixed value const [i + 2] is added to the value c [i + 1] may be anywhere. That is, the fixed value const [i + 2] may be added before or after the value c [i + 1], or may be inserted between the values c [i + 1].
Further, for example, the fixed value const [i + 2] may be two values: a fixed value const having an m−ns−bit length and a value <i + 2> in which i + 2 is expressed by s bits. When the fixed value const [i + 2] is the fixed value const and <i + 2>, the fixed value const and <i + 2> may be added to the value c [i + 1] in any way. For example, x [i + 2] = <i + 2> || const || [c [i + 1] may be set.

(S208:出力ステップ)
出力部14は、(S207)で計算された値c[i+2]を出力装置により出力する。
(S208: Output step)
The output unit 14 outputs the value c [i + 2] calculated in (S207) from the output device.

なお、i=1の場合、つまり(S201)で1個の値p[1]のみが入力された場合には、(S205)は実行されない。つまり、(S204)で値c[1]を得た後、(S206)で値c[1]と、値sumに固定値const[2]を付加した値x[2]とを入力として、値c[2]を得る。そして、(S207)へ進む。   When i = 1, that is, when only one value p [1] is input in (S201), (S205) is not executed. That is, after obtaining the value c [1] in (S204), the value c [1] in (S206) and the value x [2] obtained by adding the fixed value const [2] to the value sum are input. c [2] is obtained. Then, the process proceeds to (S207).

以上をまとめると、次のようになる。
まず、ハッシュ値演算装置10は、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算する。
また、ハッシュ値演算装置10は、j=1からiまで順に、c[j]=h(c[j−1],p[j]||<j>)を計算する。ここで、c[0]は、IV1とする。
次に、ハッシュ値演算装置10は、c[i+1]=h(c[i],sum||<i+1>)を計算する。
次に、ハッシュ値演算装置10は、c[i+2]=h(IV,c[i+1]||const||<i+2>)を計算する。
そして、ハッシュ値演算装置10は、値c[i+2]を出力する。
The above is summarized as follows.
First, the hash value computing device 10 is sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing unit.
Further, the hash value calculation device 10 calculates c [j] = h (c [j−1], p [j] || <j>) in order from j = 1 to i. Here, c [0] is IV1.
Next, the hash value calculation device 10 calculates c [i + 1] = h (c [i], sum || <i + 1>).
Next, the hash value calculation device 10 calculates c [i + 2] = h (IV, c [i + 1] || const || i + 2>).
Then, the hash value calculation device 10 outputs the value c [i + 2].

上記説明では、(S201)で既定長値入力部11が、m−sビット長のi個の値p[1],...,値p[i]を入力するとした。しかし、通常、ハッシュ関数へ入力される値は、1個の任意ビット長の値である。つまり、上記説明では、1個の任意ビット長の値が入力された場合に、どのようにm−sビット長のi個の値p[1],...,値p[i]を生成するのかについては説明を省略した。
次に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10について説明する。
In the above description, in (S201), the predetermined length value input unit 11 determines that the i values p [1],. . . , The value p [i] is input. However, normally, the value input to the hash function is one arbitrary bit length value. In other words, in the above description, when one arbitrary bit length value is input, how the i values p [1],. . . , And the value p [i] is not described.
Next, when an arbitrary bit length value is input, i values p [1],. . . The hash value computing device 10 to which a function for generating the value p [i] is added will be described.

図12は、図9に示すハッシュ値演算装置10に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10の機能を示す機能ブロック図である。
図13は、図12に示すハッシュ値演算装置10の動作を示すフローチャートである。
図14は、図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 12 shows i values p [1],... Of m−s bit length when an arbitrary bit length value is input to the hash value calculation apparatus 10 shown in FIG. . . , Is a functional block diagram showing functions of the hash value computing device 10 to which a function for generating a value p [i] is added.
FIG. 13 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 14 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図12に示すハッシュ値演算装置10の機能と動作について説明する。
図12に示すハッシュ値演算装置10は、図9に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 12 will be described.
The hash value calculation device 10 illustrated in FIG. 12 includes an arbitrary length value input unit 15, a padding unit 16, and a division unit 17 in addition to the functions included in the hash value calculation device 10 illustrated in FIG. 9.

(S211:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S211: Arbitrary length value input step)
The arbitrary length value input unit 15 inputs an arbitrary bit length value M from the input device.

(S212:パディングステップ)
パディング部16は、(S211)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−sビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S212: Padding step)
The padding unit 16 adds a predetermined value to the value M input in (S211) using the padding function pad, and processes the value M ′ having a bit length i times the m-s bit length. Is generated and stored in the storage device. That is, the padding unit 16 calculates M ′ = pad (M) by the processing device to obtain the value M ′.

(S213:分割ステップ)
分割部17は、(S212)で生成された値M’を処理装置によりi個に分割して、m−sビット長の値p[1],...,値p[i]を生成して記憶装置に記憶する。つまり、分割部17は、M’=p[1]||...||p[i]を処理装置により計算して値p[1],...,値p[i]を得る。
(S213: Division step)
The dividing unit 17 divides the value M ′ generated in (S212) into i pieces by the processing device, and sets the values p [1],. . . , Value p [i] is generated and stored in the storage device. That is, the dividing unit 17 sets M ′ = p [1] ||. . . || p [i] is calculated by the processing unit and the values p [1],. . . , Value p [i] is obtained.

(S214:既定長値入力ステップ)
既定長値入力部11は、(S213)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S214: predetermined length value input step)
The predetermined length value input unit 11 receives the values p [1],. . . , Value p [i] is input by an input device.

(S215)から(S221)までの処理は、(S202)から(S208)までの処理と同一である。   The processing from (S215) to (S221) is the same as the processing from (S202) to (S208).

(S212)におけるパディング方法の一例を説明する。
図15は、以下に説明するパディング処理を行う場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S212)でパディング部16は、実施の形態1で説明した(S112)におけるパディング方法と同様に、(S211)で入力された値Mに対して、“1||0・・・0||<M>を付加して、m−sビット長のi倍のビット長の値M’を処理装置により生成する。ここで、<M>は、Mのビット長|M|の64ビット表現である。
このように、パディングして値M’を生成することにより、衝突困難性を高くすることができる。
An example of the padding method in (S212) will be described.
FIG. 15 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 12 when the padding process described below is performed.
In (S212), the padding unit 16 performs "1 || 0 ... 0 || for the value M input in (S211), similarly to the padding method in (S112) described in the first embodiment. A value M ′ having a bit length i times the m-s bit length is generated by the processing device by adding <M>, where <M> is a 64-bit representation of the bit length | M | is there.
Thus, the difficulty of collision can be increased by generating the value M ′ by padding.

図16は、以下に説明するパディング処理を行う場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S212)でパディング部16は、(S211)で入力された値Mに対して、“1||0・・・0を付加して、m−sビット長のi倍のビット長の値M’を処理装置により生成する。
このように、パディングして値M’を生成しても、衝突困難性を高くすることができる。
FIG. 16 is a structural diagram of a hash function realized by the hash value calculation apparatus 10 shown in FIG. 12 when performing the padding process described below.
In (S212), the padding unit 16 adds “1 || 0... 0 to the value M input in (S211), and a value M having a bit length i times the m-s bit length. 'Is generated by the processing device.
Thus, even if padding generates the value M ′, the collision difficulty can be increased.

なお、実施の形態1と同様に、予めiの値を決めておくのではなく、iの値は、入力された任意ビット長の値Mに応じて決定されるとしてもよい。   As in the first embodiment, the value of i may not be determined in advance, but the value of i may be determined according to the input arbitrary bit length value M.

次に、図12に示すハッシュ値演算装置10の圧縮関数としてSHA−256を用いた場合の例を説明する。なお、SHA−256の圧縮関数をSHA256と呼ぶ。SHA256は、256ビット長の値と512ビット長の値との2つの値が入力された場合に、256ビット長の値を出力する関数である。
図17は、圧縮関数としてSHA−256を用いる場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
なお、以下の説明では、値sを56として説明する。
Next, an example in which SHA-256 is used as the compression function of the hash value computing device 10 shown in FIG. Note that the compression function of SHA-256 is called SHA256. SHA256 is a function that outputs a 256-bit value when two values, a 256-bit value and a 512-bit value, are input.
FIG. 17 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 12 when SHA-256 is used as the compression function.
In the following description, the value s is assumed to be 56.

(S211)では、任意長値入力部15は、任意ビット長の値Mを入力する。
(S212)では、パディング部16は、(S211)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して456(=512−56)ビット長のi倍のビット長の値M’を生成する。
(S213)では、分割部17は、(S212)で生成された値M’をi個に分割して、456ビット長の値p[1],...,値p[i]を生成する。
(S214)では、既定長値入力部11は、(S213)で生成された456ビット長の値p[1],...,値p[i]を入力する。
(S215)では、排他的論理和計算部18は、(S214)で入力された456ビット長の値p[1],...,p[i]と、456ビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを計算して456ビット長の値sumを得る。
(S216)では、固定値付加部12は、(S211)で入力された456ビット長の値p[1],...,値p[i]のそれぞれに対して、56ビット長の固定値const[1],...,固定値const[i]を付加して、512ビット長の値x[1],...,値x[i]を生成する。
(S217)では、圧縮関数計算部13は、256ビット長の固定値IV1と、(S216)で生成された512ビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を計算して256ビット長の値c[1]を得る。
(S218)では、圧縮関数計算部13は、j=2からiまで順に、256ビット長の値c[j−1]と512ビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を計算して256ビット長の値c[j]を得る。
(S219)では、圧縮関数計算部13は、(S218)で計算した256ビット長の値c[i]と、(S215)で計算された456ビット長の値sumに56ビット長の固定値const[i+1]を付加した512ビット長の値x[i+1]とを圧縮関数hの入力として、c[i+1]=h(c[i],x[i+1])を計算して256ビット長の値c[i+1]を得る。
(S220)では、圧縮関数計算部13は、256ビット長の固定値IV2と、(S215)で計算した256ビット長の値c[i+1]に256ビット長の固定値const[i+2]を付加した値x[i+2]とを圧縮関数hの入力として、c[i+2]=h(IV2,x[i+2])を計算して256ビット長の値c[i+2]を得る。
(S221)では、出力部14は、(S220)で計算された値c[i+2]を出力する。
In (S211), the arbitrary length value input unit 15 inputs a value M having an arbitrary bit length.
In (S212), the padding unit 16 adds a predetermined value to the value M input in (S211) using the padding function pad, and is i times the length of 456 (= 512-56) bits. A bit length value M ′ is generated.
In (S213), the dividing unit 17 divides the value M ′ generated in (S212) into i pieces and 456-bit length values p [1],. . . , Value p [i].
In (S214), the predetermined length value input unit 11 receives the 456-bit length values p [1],. . . , Input the value p [i].
In (S215), the exclusive OR calculation unit 18 determines the values p [1],. . . , P [i] and a fixed value y of 456 bits as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated to obtain a value sum of 456 bits.
In (S216), the fixed value adding unit 12 receives the values p [1],. . . , Value p [i], a fixed value const [1],. . . , A fixed value const [i] is added to the value x [1],. . . , Value x [i].
In (S217), the compression function calculation unit 13 uses the 256-bit fixed value IV1 and the 512-bit length value x [1] generated in (S216) as the input of the compression function h, and c [1] = h (IV1, x [1]) is calculated to obtain a 256-bit long value c [1].
In (S218), the compression function calculation unit 13 sequentially inputs a value c [j−1] of 256 bits and a value x [j] of 512 bits in length from j = 2 to i as inputs of the compression function h. c [j] = h (c [j−1], x [j]) is calculated to obtain a 256-bit long value c [j].
In (S219), the compression function calculation unit 13 adds a 56-bit length fixed value const to the 256-bit length value c [i] calculated in (S218) and the 456-bit length value sum calculated in (S215). Using a 512-bit length value x [i + 1] with [i + 1] added as an input to the compression function h, c [i + 1] = h (c [i], x [i + 1]) is calculated and a 256-bit length value is obtained. c [i + 1] is obtained.
In (S220), the compression function calculation unit 13 adds a 256-bit fixed value IV2 and a 256-bit fixed value const [i + 2] to the 256-bit long value c [i + 1] calculated in (S215). Using the value x [i + 2] as an input to the compression function h, c [i + 2] = h (IV2, x [i + 2]) is calculated to obtain a 256-bit long value c [i + 2].
In (S221), the output unit 14 outputs the value c [i + 2] calculated in (S220).

実施の形態2に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。   The hash function configured by the hash value computing device 10 according to the second embodiment is indistinguishable from a random oracle even if the compression function h is an ideal compression function whose unidirectionality is broken. A hash function that satisfies

なお、実施の形態1と同様に、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。   Note that, as in the first embodiment, the calculation is not necessarily performed according to the above-described processing order. When the stream processing can be performed, the calculation may be performed by the stream processing.

また、実施の形態1と同様に、圧縮関数計算部13は、ハッシュ値演算装置10の外部に備える圧縮関数計算装置に入力値を入力して、圧縮関数計算装置に圧縮関数hを計算させることにより、圧縮関数hを計算した結果を得てもよい。
また、同様に、排他的論理和計算部18は、ハッシュ値演算装置10の外部に備える排他的論理和計算装置に入力値を入力して、排他的論理和計算装置に排他的論理和演算を計算させることにより、排他的論理和演算を計算した結果を得てもよい。
Similarly to the first embodiment, the compression function calculation unit 13 inputs an input value to a compression function calculation device provided outside the hash value calculation device 10 and causes the compression function calculation device to calculate the compression function h. Thus, the result of calculating the compression function h may be obtained.
Similarly, the exclusive OR calculator 18 inputs an input value to an exclusive OR calculator provided outside the hash value calculator 10 and performs an exclusive OR operation on the exclusive OR calculator. By calculating, an exclusive OR operation result may be obtained.

また、圧縮関数計算部13が値c[1],...,値c[i+2]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。   In addition, the compression function calculation unit 13 receives the values c [1],. . . , C [i + 2] may be the same compression function h or different compression functions h.

つまり、実施の形態2に係るハッシュ値演算装置10をまとめると次のようになる。
ハッシュ値演算装置10は、i個のm−sビットの入力値p[1],...,p[i]に対して、圧縮関数演算装置に、nビット固定値IV1、第1メッセージp[1]、1のsビット表現値を入力し、その出力c[1]を得る。次に、圧縮関数演算装置に、nビット値c[1]、第2メッセージp[2]、2のsビット表現値を入力し、その出力c[2]を得る。この処理を、第iメッセージまで同様に行い、その出力値c[i]を得る。圧縮関数演算装置に、nビット値c[i]、sum=p[1] xor ... xor p[i] xor y、i+1のsビットの表現値を入力し、その出力c[i+1]を得る。圧縮関数演算装置に、初期値IV2、nビット値c[i−1]、m−n−sビット固定値const、i+2のsビット表現値を入力し、その出力c[i+2]を得る。そして、c[i+2]を出力することを特徴とする。ここで、yはm−sビット固定値である。
That is, the hash value calculation device 10 according to the second embodiment is summarized as follows.
The hash value arithmetic unit 10 is configured to input i m-s bit input values p [1],. . . , P [i], the n-bit fixed value IV1, the first message p [1], and the s-bit representation value of 1 are input to the compression function arithmetic unit, and the output c [1] is obtained. Next, the n-bit value c [1], the second message p [2], and the s-bit representation value of 2 are input to the compression function arithmetic unit, and the output c [2] is obtained. This process is similarly performed up to the i-th message, and the output value c [i] is obtained. The compression function arithmetic unit receives an n-bit value c [i], sum = p [1] xor. . . xor p [i] xor y, an s-bit representation value of i + 1 is input, and its output c [i + 1] is obtained. An initial value IV2, an n-bit value c [i-1], an mn-s-bit fixed value const, and an s-bit representation value of i + 2 are input to the compression function arithmetic unit, and an output c [i + 2] is obtained. Then, c [i + 2] is output. Here, y is a fixed value of m−s bits.

また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−sビットの値を出力する任意のパディング処理装置を用いて、m−sビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−sビットの値p[1],...,p[i]に分割することを特徴とする。   Further, the hash value computing device 10 is a multiple of m-s bits using an arbitrary padding processing device that receives an arbitrary length value from an arbitrary length value M and outputs an m-s bit value. A message M ′ is generated. Using a split processor, M 'is replaced with i ms bit values p [1],. . . , P [i].

さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。   Further, the hash value computing device 10 changes the padding processing device to M || 1 || 0. . . 0 || <M> and s = 56. However, <M> represents the bit length of M in 64 bits.

また、さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0とし、s=56とすることを特徴とする。   Further, the hash value calculation device 10 changes the padding processing device to M || 1 || 0. . . 0 and s = 56.

また、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。   Further, the hash value calculation device 10 is characterized by using a SHA-256 compression function calculation device as the compression function calculation device.

実施の形態3.
実施の形態3では、実施の形態1,2とは異なるハッシュ関数であって、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
Embodiment 3 FIG.
In the third embodiment, even if the hash function is different from those in the first and second embodiments and is configured using an ideal compression function (WFILRO) whose unidirectionality is broken, the random oracle The hash value calculation device 10 that constitutes a new hash function that cannot be strongly discriminated will be described.

図18は、実施の形態3に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図19は、図18に示すハッシュ値演算装置10の動作を示すフローチャートである。
図20は、図18に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 18 is a functional block diagram illustrating functions of the hash value computing device 10 according to the third embodiment.
FIG. 19 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 20 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図18に示すハッシュ値演算装置10の機能と動作について説明する。
図18に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 18 will be described.
The hash value calculation device 10 illustrated in FIG. 18 includes a predetermined length value input unit 11, a fixed value addition unit 12, a compression function calculation unit 13, an output unit 14, and an exclusive OR calculation unit 18.

(S301:既定長値入力ステップ)
既定長値入力部11は、m−sビット長のi個の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]との合計i+1個の値を入力装置により入力して記憶装置に記憶する。
(S301: Default length input step)
The predetermined length value input unit 11 includes i values p [1],. . . , Value p [i] and one value p [i + 1] having a length of m−n bits are input by the input device and stored in the storage device.

(S302:排他的論理和計算ステップ)
排他的論理和計算部18は、(S301)で入力されたm−sビット長のi個の値p[1],...,p[i]と、予め記憶装置に記憶したm−sビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算してm−sビット長の値sumを得て記憶装置に記憶する。
(S302: Exclusive OR calculation step)
The exclusive OR calculator 18 calculates the i-values p [1],. . . , P [i] and an m-s bit length fixed value y stored in advance in the storage device as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing device to obtain a value sum of m-s bit length and stored in the storage device.

(S303:固定値付加ステップ)
固定値付加部12は、(S301)で入力されたm−sビット長のi個の値p[1],...,値p[i]のそれぞれに対して、予め記憶装置に記憶したsビット長の固定値const[1],...,固定値const[i]を付加して、mビット長の値x[1],...,値x[i]を処理装置により生成して記憶装置に記憶する。
つまり、固定値付加部12は、値p[1]に固定値const[1]を付加して、値x[1]を生成する。固定値付加部12は、値p[2]に固定値const[2]を付加して、値x[2]を生成する。以下同様に、j=3,...,iに対して、固定値付加部12は、値p[j]に固定値const[j]を付加して、値x[j]を生成する。
なお、j=1,...,i−1について、値p[j]に固定値const[j]を付加する位置は、どこであってもよい。つまり、固定値const[j]は、値p[j]の前や後に追加してもよいし、値p[j]の間に挿入してもよい。
また、固定値const[1]≠固定値const[2]≠...≠固定値const[i]である。例えば、j=1,...,iについて、固定値const[j]は、jをsビットで表現した値<j>である。
(S303: fixed value addition step)
The fixed value adding unit 12 receives the i values p [1],. . . , Values p [i], s bit length fixed values const [1],. . . , A fixed value const [i], and an m-bit length value x [1],. . . , Value x [i] is generated by the processing device and stored in the storage device.
That is, the fixed value adding unit 12 adds the fixed value const [1] to the value p [1] to generate the value x [1]. The fixed value adding unit 12 adds the fixed value const [2] to the value p [2] to generate the value x [2]. Similarly, j = 3,. . . , I, the fixed value adding unit 12 adds the fixed value const [j] to the value p [j] to generate the value x [j].
Note that j = 1,. . . , I−1, the position where the fixed value const [j] is added to the value p [j] may be anywhere. That is, the fixed value const [j] may be added before or after the value p [j], or may be inserted between the values p [j].
Further, the fixed value const [1] ≠ fixed value const [2] ≠. . . ≠ Fixed value const [i]. For example, j = 1,. . . , I, the fixed value const [j] is a value <j> in which j is expressed by s bits.

(S304:第1圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV1と、(S303)で生成されたmビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を処理装置により計算してnビット長の値c[1]を得て記憶装置に記憶する。
(S304: First compression function calculation step)
The compression function calculation unit 13 uses the n-bit fixed value IV1 stored in the storage device in advance and the m-bit length value x [1] generated in (S303) as the input of the compression function h. = H (IV1, x [1]) is calculated by the processing device to obtain an n-bit length value c [1] and stored in the storage device.

(S305:第2圧縮関数計算ステップ)
圧縮関数計算部13は、j=2からiまで順に、nビット長の値c[j−1]とmビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を処理装置により計算してnビット長の値c[j]を得て記憶装置に記憶する。
つまり、まず、圧縮関数計算部13は、(S304)で計算したnビット長の値c[1]と、(S303)で生成されたmビット長の値x[2]とを入力として、c[2]=h(c[1],x[2])を処理装置により計算してnビット長の値c[2]を得る。
次に、圧縮関数計算部13は、計算したnビット長の値c[2]と、(S303)で生成されたmビット長の値x[3]とを入力として、c[3]=h(c[2],x[3])を処理装置により計算してnビット長の値c[3]を得る。
これを繰り返して、最終的に、圧縮関数計算部13は、計算したnビット長の値c[i−1]と、(S303)で生成されたmビット長の値x[i]とを入力として、c[i]=h(c[i−1],x[i])を処理装置により計算してnビット長の値c[i]を得る。
(S305: second compression function calculation step)
The compression function calculation unit 13 sequentially inputs the value c [j−1] having an n-bit length and the value x [j] having an m-bit length from j = 2 to i, and inputs c [j] = h (c [j−1], x [j]) is calculated by the processing device to obtain a value c [j] having an n-bit length and stored in the storage device.
That is, first, the compression function calculation unit 13 receives the value c [1] of n-bit length calculated in (S304) and the value x [2] of m-bit length generated in (S303) as c [2] = h (c [1], x [2]) is calculated by the processing device to obtain an n-bit length value c [2].
Next, the compression function calculation unit 13 receives the calculated n-bit length value c [2] and the m-bit length value x [3] generated in (S303) as c [3] = h. (C [2], x [3]) is calculated by the processing device to obtain an n-bit length value c [3].
By repeating this, finally, the compression function calculation unit 13 inputs the calculated n-bit length value c [i−1] and the m-bit length value x [i] generated in (S303). C [i] = h (c [i−1], x [i]) is calculated by the processing device to obtain an n-bit length value c [i].

(S306:第3圧縮関数計算ステップ)
圧縮関数計算部13は、(S305)で計算したnビット長の値c[i]と、(S302)で計算されたm−sビット長の値sumにsビット長の固定値const[i+1]を付加したmビット長の値x[i+1]とを圧縮関数hの入力として、c[i+1]=h(c[i],x[i+1])を処理装置により計算してnビット長の値c[i+1]を得て記憶装置に記憶する。
なお、固定値const[i+1]≠固定値const[1]≠...≠固定値const[i]である。例えば、固定値const[i+1]は、i+1をsビットで表現した値<i+1>である。
また、値sumに固定値const[i+1]を付加する位置は、どこであってもよい。つまり、固定値const[i+1]は、値sumの前や後に追加してもよいし、値sumの間に挿入してもよい。
(S306: third compression function calculation step)
The compression function calculation unit 13 adds the fixed value const [i + 1] of the s bit length to the value c [i] of the n bit length calculated in (S305) and the value sum of the m−s bit length calculated in (S302). C [i + 1] = h (c [i], x [i + 1]) is calculated by the processing device using the m-bit length value x [i + 1] to which is added as an input to the compression function h, and the n-bit length value is calculated. c [i + 1] is obtained and stored in the storage device.
Note that the fixed value const [i + 1] ≠ fixed value const [1] ≠. . . ≠ Fixed value const [i]. For example, the fixed value const [i + 1] is a value <i + 1> in which i + 1 is expressed by s bits.
Further, the position where the fixed value const [i + 1] is added to the value sum may be anywhere. That is, the fixed value const [i + 1] may be added before or after the value sum, or may be inserted between the values sum.

(S307:第4圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV2と、(S306)で計算したnビット長の値c[i+1]に(S301)で入力されたm−nビット長の値p[i+1]を付加した値x[i+2]とを圧縮関数hの入力として、c[i+2]=h(IV2,x[i+2])を処理装置により計算してnビット長の値c[i+2]を得て記憶装置に記憶する。
なお、値c[i+1]に値p[i+1]を付加する位置は、どこであってもよい。つまり、値p[i+1]は、値c[i+1]の前や後に追加してもよいし、値c[i+1]の間に挿入してもよい。
(S307: Fourth compression function calculation step)
The compression function calculation unit 13 inputs the m-n bit length input in (S301) to the fixed value IV2 of n bit length stored in the storage device in advance and the value c [i + 1] of n bit length calculated in (S306). C [i + 2] = h (IV2, x [i + 2]) is calculated by the processing device using the value x [i + 2] to which the value p [i + 1] is added as the input of the compression function h, and the value c of n-bit length is calculated. [I + 2] is obtained and stored in the storage device.
The position where the value p [i + 1] is added to the value c [i + 1] may be anywhere. That is, the value p [i + 1] may be added before or after the value c [i + 1], or may be inserted between the values c [i + 1].

(S308:出力ステップ)
出力部14は、(S307)で計算された値c[i+2]を出力装置により出力する。
(S308: Output step)
The output unit 14 outputs the value c [i + 2] calculated in (S307) from the output device.

なお、i=1の場合、つまり(S301)で2個の値p[1](値p[i])と値p[2](値p[i+1])とのみが入力された場合には、(S305)は実行されない。つまり、(S304)で値c[1]を得た後、(S306)で値c[1]と、値sumに固定値const[2]を付加した値x[2]とを入力として、値c[2]を得る。そして、(S307)へ進む。   When i = 1, that is, when only two values p [1] (value p [i]) and value p [2] (value p [i + 1]) are input in (S301). , (S305) are not executed. That is, after obtaining the value c [1] in (S304), the value c [1] in (S306) and the value x [2] obtained by adding the fixed value const [2] to the value sum are input. c [2] is obtained. Then, the process proceeds to (S307).

以上をまとめると、次のようになる。
まず、ハッシュ値演算装置10は、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算する。
また、ハッシュ値演算装置10は、j=1からiまで順に、c[j]=h(c[j−1],p[j]||<j>)を計算する。ここで、c[0]は、IV1とする。
次に、ハッシュ値演算装置10は、c[i+1]=h(c[i],sum||<i+1>)を計算する。
次に、ハッシュ値演算装置10は、c[i+2]=h(IV,c[i+1]||p[i+1])を計算する。
そして、ハッシュ値演算装置10は、値c[i+2]を出力する。
The above is summarized as follows.
First, the hash value computing device 10 is sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing unit.
Further, the hash value calculation device 10 calculates c [j] = h (c [j−1], p [j] || <j>) in order from j = 1 to i. Here, c [0] is IV1.
Next, the hash value calculation device 10 calculates c [i + 1] = h (c [i], sum || <i + 1>).
Next, the hash value calculation device 10 calculates c [i + 2] = h (IV, c [i + 1] || p [i + 1]).
Then, the hash value calculation device 10 outputs the value c [i + 2].

上記説明では、(S301)で既定長値入力部11が、m−sビット長のi個の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]とを入力するとした。しかし、通常、ハッシュ関数へ入力される値は、1個の任意ビット長の値である。つまり、上記説明では、1個の任意ビット長の値が入力された場合に、どのようにm−sビット長のi個の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]とを生成するのかについては説明を省略した。
次に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]とを生成する機能を追加したハッシュ値演算装置10について説明する。
In the above description, in (S301), the predetermined length value input unit 11 determines that the i values p [1],. . . , Value p [i] and one value p [i + 1] having an mn bit length are input. However, normally, the value input to the hash function is one arbitrary bit length value. In other words, in the above description, when one arbitrary bit length value is input, how the i values p [1],. . . , Value p [i] and whether to generate one value p [i + 1] having a length of m−n bits are not described.
Next, when an arbitrary bit length value is input, i values p [1],. . . , A value p [i] and a hash value computing device 10 to which a function for generating one value p [i + 1] having an mn bit length is added will be described.

図21は、図18に示すハッシュ値演算装置10に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]とを生成する機能を追加したハッシュ値演算装置10の機能を示す機能ブロック図である。
図22は、図21に示すハッシュ値演算装置10の動作を示すフローチャートである。
図23は、図21に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 21 shows i values p [1],... Of m-s bit length when an arbitrary bit length value is input to the hash value calculation apparatus 10 shown in FIG. . . , Value p [i] and a function for generating one value p [i + 1] having a length of m−n bits.
FIG. 22 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 23 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図21に示すハッシュ値演算装置10の機能と動作について説明する。
図21に示すハッシュ値演算装置10は、図18に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 21 will be described.
The hash value calculation device 10 illustrated in FIG. 21 includes an arbitrary length value input unit 15, a padding unit 16, and a division unit 17 in addition to the functions included in the hash value calculation device 10 illustrated in FIG. 18.

(S311:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S311: Arbitrary length input step)
The arbitrary length value input unit 15 inputs an arbitrary bit length value M from the input device.

(S312:パディングステップ)
パディング部16は、(S311)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して((m−s)×i+(m−n))ビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S312: Padding step)
The padding unit 16 adds a predetermined value to the value M input in (S311) using the padding function pad ((ms) × i + (mn)) and has a bit length value. M ′ is generated by the processing device and stored in the storage device. That is, the padding unit 16 calculates M ′ = pad (M) by the processing device to obtain the value M ′.

(S313:分割ステップ)
分割部17は、(S312)で生成された値M’を処理装置によりi+1個に分割して、m−sビット長の値p[1],...,値p[i]と、m−nビット長の1個の値p[i+1]とを生成して記憶装置に記憶する。つまり、分割部17は、M’=p[1]||...||p[i]||p[i+1]を処理装置により計算して値p[1],...,値p[i]と、値p[i+1]とを得る。
(S313: Division step)
The dividing unit 17 divides the value M ′ generated in (S312) into i + 1 pieces by the processing device, and sets the values p [1],. . . , Value p [i] and one value p [i + 1] having an mn bit length are generated and stored in the storage device. That is, the dividing unit 17 sets M ′ = p [1] ||. . . || p [i] || p [i + 1] is calculated by the processing unit and the values p [1],. . . , Value p [i] and value p [i + 1].

(S314:既定長値入力ステップ)
既定長値入力部11は、(S313)で生成された値p[1],...,値p[i]と、値p[i+1]とを入力装置により入力する。
(S314: Default length input step)
The predetermined length value input unit 11 receives the values p [1],. . . , Value p [i] and value p [i + 1] are input by the input device.

(S315)から(S321)までの処理は、(S302)から(S308)までの処理と同一である。   The processing from (S315) to (S321) is the same as the processing from (S302) to (S308).

(S312)におけるパディング方法の一例を説明する。
図24は、以下に説明するパディング処理を行う場合の図21に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S312)でパディング部16は、実施の形態1で説明した(S112)におけるパディング方法と同様に、(S311)で入力された値Mに対して、“1||0・・・0||<M>を付加して、m−sビット長のi倍のビット長の値M’を処理装置により生成する。ここで、<M>は、Mのビット長|M|の64ビット表現である。
このように、パディングして値M’を生成することにより、衝突困難性を高くすることができる。
An example of the padding method in (S312) will be described.
FIG. 24 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 21 when the padding process described below is performed.
In (S312), the padding unit 16 performs "1 || 0 ... 0 || for the value M input in (S311), similarly to the padding method in (S112) described in the first embodiment. A value M ′ having a bit length i times the m-s bit length is generated by the processing device by adding <M>, where <M> is a 64-bit representation of the bit length | M | is there.
Thus, the difficulty of collision can be increased by generating the value M ′ by padding.

なお、実施の形態1と同様に、予めiの値を決めておくのではなく、iの値は、入力された任意ビット長の値Mに応じて決定されるとしてもよい。この場合、値M’のビット長|M’|が「|M’| mod m−s=m−n」となるように、値M’を生成すればよい。   As in the first embodiment, the value of i may not be determined in advance, but the value of i may be determined according to the input arbitrary bit length value M. In this case, the value M ′ may be generated so that the bit length | M ′ | of the value M ′ is “| M ′ | mod m−s = mn”.

次に、図21に示すハッシュ値演算装置10の圧縮関数としてSHA−256を用いた場合の例を説明する。なお、SHA−256の圧縮関数をSHA256と呼ぶ。SHA256は、256ビット長の値と512ビット長の値との2つの値が入力された場合に、256ビット長の値を出力する関数である。
図25は、圧縮関数としてSHA−256を用いる場合の図12に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
なお、以下の説明では、値sを56として説明する。
Next, an example in which SHA-256 is used as the compression function of the hash value computing device 10 shown in FIG. Note that the compression function of SHA-256 is called SHA256. SHA256 is a function that outputs a 256-bit value when two values, a 256-bit value and a 512-bit value, are input.
FIG. 25 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 12 when SHA-256 is used as the compression function.
In the following description, the value s is assumed to be 56.

(S311)では、任意長値入力部15は、任意ビット長の値Mを入力する。
(S312)では、パディング部16は、(S311)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して((512−56)×i+(512−256))ビット長の値M’を生成する。
(S313)では、分割部17は、(S312)で生成された値M’をi個の456ビット長の値p[1],...,値p[i]と、1個の256ビット長の値p[i+1]とに分割する。
(S314)では、既定長値入力部11は、(S313)で生成されたi個の456ビット長の値p[1],...,値p[i]と、1個の256ビット長の値p[i+1]とを入力する。
(S315)では、排他的論理和計算部18は、(S314)で入力された456ビット長の値p[1],...,p[i]と、456ビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを計算して456ビット長の値sumを得る。
(S316)では、固定値付加部12は、(S311)で入力された456ビット長の値p[1],...,値p[i]のそれぞれに対して、56ビット長の固定値const[1],...,固定値const[i]を付加して、512ビット長の値x[1],...,値x[i]を生成する。
(S317)では、圧縮関数計算部13は、256ビット長の固定値IV1と、(S316)で生成された512ビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を計算して256ビット長の値c[1]を得る。
(S318)では、圧縮関数計算部13は、j=2からiまで順に、256ビット長の値c[j−1]と512ビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を計算して256ビット長の値c[j]を得る。
(S319)では、圧縮関数計算部13は、(S318)で計算した256ビット長の値c[i]と、(S315)で計算された456ビット長の値sumに56ビット長の固定値const[i+1]を付加した512ビット長の値x[i+1]とを圧縮関数hの入力として、c[i+1]=h(c[i],x[i+1])を計算して256ビット長の値c[i+1]を得る。
(S320)では、圧縮関数計算部13は、256ビット長の固定値IV2と、(S315)で計算した256ビット長の値c[i+1]に、(S314)で入力された256ビット長の値p[i+1]を付加した値x[i+2]とを圧縮関数hの入力として、c[i+2]=h(IV2,x[i+2])を計算して256ビット長の値c[i+2]を得る。
(S321)では、出力部14は、(S320)で計算された値c[i+2]を出力する。
In (S311), the arbitrary length value input unit 15 inputs a value M having an arbitrary bit length.
In (S312), the padding unit 16 adds a predetermined value to the value M input in (S311) using the padding function pad ((512-56) × i + (512-256)). ) Generate a bit length value M ′.
In (S313), the dividing unit 17 converts the value M ′ generated in (S312) into i 456-bit length values p [1],. . . , Value p [i] and one 256-bit length value p [i + 1].
In (S314), the predetermined length input unit 11 determines the i 456-bit length values p [1],. . . , Value p [i] and one 256-bit length value p [i + 1].
In (S315), the exclusive OR calculator 18 determines the values p [1],. . . , P [i] and a fixed value y of 456 bits as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated to obtain a value sum of 456 bits.
In (S316), the fixed value adding unit 12 receives the 456-bit value p [1],. . . , Value p [i], a fixed value const [1],. . . , A fixed value const [i] is added to the value x [1],. . . , Value x [i].
In (S317), the compression function calculation unit 13 uses the 256-bit length fixed value IV1 and the 512-bit length value x [1] generated in (S316) as the input of the compression function h, and c [1] = h (IV1, x [1]) is calculated to obtain a 256-bit long value c [1].
In (S <b> 318), the compression function calculation unit 13 uses a 256-bit length value c [j−1] and a 512-bit length value x [j] as inputs to the compression function h in order from j = 2 to i. c [j] = h (c [j−1], x [j]) is calculated to obtain a 256-bit long value c [j].
In (S319), the compression function calculation unit 13 adds the 56-bit length fixed value const to the 256-bit length value c [i] calculated in (S318) and the 456-bit length value sum calculated in (S315). Using a 512-bit length value x [i + 1] with [i + 1] added as an input to the compression function h, c [i + 1] = h (c [i], x [i + 1]) is calculated and a 256-bit length value is obtained. c [i + 1] is obtained.
In (S320), the compression function calculation unit 13 adds the 256-bit length value input in (S314) to the 256-bit length fixed value IV2 and the 256-bit length value c [i + 1] calculated in (S315). c [i + 2] = h (IV2, x [i + 2]) is calculated using the value x [i + 2] to which p [i + 1] is added as an input to the compression function h to obtain a 256-bit long value c [i + 2]. .
In (S321), the output unit 14 outputs the value c [i + 2] calculated in (S320).

実施の形態3に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。   The hash function configured by the hash value computing device 10 according to the third embodiment is indistinguishable from a random oracle even if the compression function h is an ideal compression function whose unidirectionality is broken. A hash function that satisfies

なお、実施の形態1と同様に、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。   Note that, as in the first embodiment, the calculation is not necessarily performed according to the above-described processing order. When the stream processing can be performed, the calculation may be performed by the stream processing.

また、実施の形態1と同様に、圧縮関数計算部13は、ハッシュ値演算装置10の外部に備える圧縮関数計算装置に入力値を入力して、圧縮関数計算装置に圧縮関数hを計算させることにより、圧縮関数hを計算した結果を得てもよい。
また、同様に、排他的論理和計算部18は、ハッシュ値演算装置10の外部に備える排他的論理和計算装置に入力値を入力して、排他的論理和計算装置に排他的論理和演算を計算させることにより、排他的論理和演算を計算した結果を得てもよい。
Similarly to the first embodiment, the compression function calculation unit 13 inputs an input value to a compression function calculation device provided outside the hash value calculation device 10 and causes the compression function calculation device to calculate the compression function h. Thus, the result of calculating the compression function h may be obtained.
Similarly, the exclusive OR calculator 18 inputs an input value to an exclusive OR calculator provided outside the hash value calculator 10 and performs an exclusive OR operation on the exclusive OR calculator. By calculating, an exclusive OR operation result may be obtained.

また、圧縮関数計算部13が値c[1],...,値c[i+2]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。   In addition, the compression function calculation unit 13 receives the values c [1],. . . , C [i + 2] may be the same compression function h or different compression functions h.

つまり、実施の形態3に係るハッシュ値演算装置10をまとめると次のようになる。
ハッシュ値演算装置10は、i個のm−sビットの入力値m[1],…,m[i]とm−nビットの入力m[i+1]に対して、圧縮関数演算装置に、nビット固定値IV1、第一メッセージm[1]、1のsビット表現値を入力し、その出力c[1]を得る。次に、圧縮関数演算装置に、nビット値c[1]、第2メッセージm[2]、2のsビット表現値を入力し、その出力c[2]を得る。この処理を、第iメッセージまで同様に行い、その出力値c[i]を得る。圧縮関数演算装置に、nビット値c[i]、sum=m[1] xor … xor m[i] xor y、i+1のsビットの表現値を入力し、その出力c[i+1]を得る。圧縮関数演算装置に、初期値IV2、m−nビットのメッセージm[i+1]、nビット値c[i−1]を入力し、その出力c[i+2]を得る。そして、c[i+2]を出力することを特徴とする。ここで、yはm−sビット固定値である。
That is, the hash value calculation device 10 according to the third embodiment is summarized as follows.
The hash value arithmetic unit 10 applies n m-s bit input values m [1],..., M [i] and mn bit input m [i + 1] to the compression function arithmetic unit n. The bit fixed value IV1, the first message m [1], and the s bit representation value of 1 are input, and the output c [1] is obtained. Next, the n-bit value c [1], the second message m [2], and the s-bit representation value of 2 are input to the compression function arithmetic unit, and the output c [2] is obtained. This process is similarly performed up to the i-th message, and the output value c [i] is obtained. An n-bit value c [i], sum = m [1] xor... Xor m [i] xor y, i + 1 s-bit representation values are input to the compression function arithmetic unit, and an output c [i + 1] is obtained. An initial value IV2, an m-n bit message m [i + 1], and an n-bit value c [i-1] are input to the compression function arithmetic unit, and an output c [i + 2] is obtained. Then, c [i + 2] is output. Here, y is a fixed value of m−s bits.

また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、任意のパディング処理装置を用いて、メッセージM’を生成する。ただし、|M’| mod m−s= m−nとなるようにする。分割処理装置を用いてM’をi個のm−sビットの値m[1],…,m[i]、m−nビットの値m[i]に分割することを特徴とする。   In addition, the hash value calculation device 10 receives an arbitrary length value from the arbitrary length value M, and generates a message M ′ using an arbitrary padding processing device. However, it is set so that | M ′ | mod m−s = mn. M ′ is divided into i m-s bit values m [1],..., M [i] and m−n bit values m [i] using a division processing apparatus.

さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0…0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。   Further, the hash value computing device 10 is characterized in that the padding processing device is M || 1 || 0 ... 0 || <M> and s = 56. However, <M> represents the bit length of M in 64 bits.

また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。   Further, the hash value calculation device 10 is characterized in that a compression function calculation device of SHA-256 is used as the compression function calculation device.

実施の形態4.
実施の形態4では、準一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
Embodiment 4 FIG.
In the fourth embodiment, even if it is configured using an ideal compression function whose quasi-unidirectionality has been broken, a hash value calculation that constitutes a new hash function that cannot be strongly discriminated from a random oracle. The apparatus 10 will be described.

図26は、実施の形態4に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図27は、図26に示すハッシュ値演算装置10の動作を示すフローチャートである。
図28は、図26に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 26 is a functional block diagram illustrating functions of the hash value computing device 10 according to the fourth embodiment.
FIG. 27 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 28 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図26に示すハッシュ値演算装置10の機能と動作について説明する。
図26に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、置換関数計算部19を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 26 will be described.
The hash value calculation device 10 illustrated in FIG. 26 includes a predetermined length value input unit 11, a fixed value addition unit 12, a compression function calculation unit 13, an output unit 14, and a replacement function calculation unit 19.

(S401:既定長値入力ステップ)
既定長値入力部11は、m−nビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S401: Default length input step)
The predetermined length value input unit 11 includes i values p [1],. . . , Value p [i] is input by the input device and stored in the storage device.

(S402:固定値付加ステップ)
固定値付加部12は、(S401)で入力されたm−nビット長のi個の値p[1],...,値p[i]のそれぞれに対して、予め記憶装置に記憶したnビット長の固定値const[1],...,固定値const[i]を付加して、mビット長の値x[1],...,値x[i]を処理装置により生成して記憶装置に記憶する。
つまり、固定値付加部12は、値p[1]に固定値const[1]を付加して、値x[1]を生成する。固定値付加部12は、値p[2]に固定値const[2]を付加して、値x[2]を生成する。以下同様に、j=3,...,iに対して、固定値付加部12は、値p[j]に固定値const[j]を付加して、値x[j]を生成する。
なお、j=1,...,iについて、値p[j]に固定値const[j]を付加する位置は、どこであってもよい。つまり、固定値const[j]は、値p[j]の前や後に追加してもよいし、値p[j]の間に挿入してもよい。
また、固定値const[1]=固定値const[2]=...=固定値const[i]でもよいし、固定値const[1]≠固定値const[2]≠...≠固定値const[i]でもよい。
(S402: Fixed value addition step)
The fixed value adding unit 12 receives the i values p [1],. . . , Values p [i], n-bit fixed values const [1],. . . , A fixed value const [i], and an m-bit length value x [1],. . . , Value x [i] is generated by the processing device and stored in the storage device.
That is, the fixed value adding unit 12 adds the fixed value const [1] to the value p [1] to generate the value x [1]. The fixed value adding unit 12 adds the fixed value const [2] to the value p [2] to generate the value x [2]. Similarly, j = 3,. . . , I, the fixed value adding unit 12 adds the fixed value const [j] to the value p [j] to generate the value x [j].
Note that j = 1,. . . , I, the position where the fixed value const [j] is added to the value p [j] may be anywhere. That is, the fixed value const [j] may be added before or after the value p [j], or may be inserted between the values p [j].
Also, fixed value const [1] = fixed value const [2] =. . . = Fixed value const [i], or fixed value const [1] ≠ fixed value const [2] ≠. . . ≠ Fixed value const [i] may be used.

(S403:第1圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV1と、(S402)で生成されたmビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を処理装置により計算してnビット長の値c[1]を得て記憶装置に記憶する。
(S403: First compression function calculation step)
The compression function calculation unit 13 uses the n-bit length fixed value IV1 stored in the storage device in advance and the m-bit length value x [1] generated in (S402) as an input of the compression function h, c [1] = H (IV1, x [1]) is calculated by the processing device to obtain an n-bit length value c [1] and stored in the storage device.

(S404:第2圧縮関数計算ステップ)
圧縮関数計算部13は、j=2からi−1まで順に、nビット長の値c[j−1]とmビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を処理装置により計算してnビット長の値c[j]を得て記憶装置に記憶する。
つまり、まず、圧縮関数計算部13は、(S403)で計算したnビット長の値c[1]と、(S402)で生成されたmビット長の値x[2]とを入力として、c[2]=h(c[1],x[2])を処理装置により計算してnビット長の値c[2]を得る。
次に、圧縮関数計算部13は、計算したnビット長の値c[2]と、(S402)で生成されたmビット長の値x[3]とを入力として、c[3]=h(c[2],x[3])を処理装置により計算してnビット長の値c[3]を得る。
これを繰り返して、最終的に、圧縮関数計算部13は、計算したnビット長の値c[i−2]と、(S402)で生成されたmビット長の値x[i−1]とを入力として、c[i−1]=h(c[i−2],x[i−1])を処理装置により計算してnビット長の値c[i−1]を得る。
(S404: Second compression function calculation step)
The compression function calculation unit 13 uses the value c [j−1] of n bits and the value x [j] of m bits in order from j = 2 to i−1 as inputs of the compression function h. ] = H (c [j−1], x [j]) is calculated by the processing device to obtain a value c [j] having an n-bit length and stored in the storage device.
That is, first, the compression function calculation unit 13 receives the n-bit length value c [1] calculated in (S403) and the m-bit length value x [2] generated in (S402) as c [2] = h (c [1], x [2]) is calculated by the processing device to obtain an n-bit length value c [2].
Next, the compression function calculation unit 13 receives the calculated n-bit length value c [2] and the m-bit length value x [3] generated in (S402) as input, and c [3] = h (C [2], x [3]) is calculated by the processing device to obtain an n-bit length value c [3].
By repeating this, finally, the compression function calculation unit 13 calculates the calculated n-bit length value c [i−2] and the m-bit length value x [i−1] generated in (S402). As an input, c [i-1] = h (c [i-2], x [i-1]) is calculated by the processing device to obtain an n-bit long value c [i-1].

(S405:置換関数計算ステップ)
置換関数計算部19は、(S404)で計算されたnビット長の値c[i−1]を置換関数πの入力として、c’[i−1]=π(c[i−1])を処理装置により計算してnビット長の値c’[i−1]を得て記憶装置に記憶する。
なお、置換関数πは、任意の値aを入力した場合に値aとは異なる値a’に置換する置換関数であって、値aを入力した場合に入力した値aがそのまま出力されることのない置換関数である。つまり、置換関数πは、π(a)=aとなるような固定点(Fixed Point)を有さない置換関数である。
(S405: Substitution function calculation step)
The replacement function calculation unit 19 uses the value c [i−1] of n bits calculated in (S404) as an input of the replacement function π, and c ′ [i−1] = π (c [i−1]) Is calculated by the processing device to obtain a value c ′ [i−1] having an n-bit length and stored in the storage device.
The replacement function π is a replacement function that replaces a value a ′ different from the value a when an arbitrary value a is input, and the input value a is output as it is when the value a is input. It is a replacement function without That is, the replacement function π is a replacement function that does not have a fixed point such that π (a) = a.

(S406:第3圧縮関数計算ステップ)
圧縮関数計算部13は、(S405)で計算されたnビット長の値c’[i−1]と、(S402)で生成されたmビット長の値x[i]とを圧縮関数hの入力として、c[i]=h(c’[i−1],x[i])を処理装置により計算してnビット長の値c[i]を得て記憶装置に記憶する。
(S406: third compression function calculation step)
The compression function calculation unit 13 uses the n-bit length value c ′ [i−1] calculated in (S405) and the m-bit length value x [i] generated in (S402) for the compression function h. As an input, c [i] = h (c ′ [i−1], x [i]) is calculated by the processing device to obtain an n-bit length value c [i] and stored in the storage device.

(S407:出力ステップ)
出力部14は、(S406)で計算された値c[i]を出力装置により出力する。
(S407: output step)
The output unit 14 outputs the value c [i] calculated in (S406) by the output device.

なお、i=2の場合、つまり(S401)で2個の値p[1]と値p[2]とのみが入力された場合には、(S404)は実行されない。つまり、(S403)で値c[1]を得た後、(S405)で値c[1]を入力として、値c’[1]を得る。そして、(S406)で値c’[1]と値x[2]とを入力として、値c[2]を得る。   When i = 2, that is, when only two values p [1] and p [2] are input in (S401), (S404) is not executed. That is, after obtaining the value c [1] in (S403), the value c [1] is input in (S405) to obtain the value c '[1]. In (S406), the value c '[1] and the value x [2] are input to obtain the value c [2].

また、i=1の場合、つまり(S401)で1個の値p[1]のみが入力された場合には、(S403)と(S404)とは実行されない。つまり、(S402)で値x[1]が生成された後、(S405)で固定値IV1を入力として、値IV1’を得る。そして、(S406)で値IV1’と値x[1]とを入力として、値c[1]を得る。   When i = 1, that is, when only one value p [1] is input in (S401), (S403) and (S404) are not executed. That is, after the value x [1] is generated in (S402), the fixed value IV1 is input in (S405) to obtain the value IV1 '. In step S406, the value IV1 'and the value x [1] are input to obtain the value c [1].

以上をまとめると、次のようになる。
まず、ハッシュ値演算装置10は、j=1からi−1まで順に、c[j]=h(c[j−1],p[j]||const[j])を計算する。ここで、c[0]は、IV1とする。
次に、ハッシュ値演算装置10は、c[i]=h(π(c[i−1]),p[i]||const[i])を計算する。
そして、ハッシュ値演算装置10は、値c[i]を出力する。
The above is summarized as follows.
First, the hash value calculation device 10 calculates c [j] = h (c [j−1], p [j] || const [j]) in order from j = 1 to i−1. Here, c [0] is IV1.
Next, the hash value calculation device 10 calculates c [i] = h (π (c [i−1]), p [i] || const [i]).
Then, the hash value calculation device 10 outputs the value c [i].

上記説明では、(S401)で既定長値入力部11が、m−nビット長のi個の値p[1],...,値p[i]を入力するとした。しかし、通常、ハッシュ関数へ入力される値は、1個の任意ビット長の値である。つまり、上記説明では、1個の任意ビット長の値が入力された場合に、どのようにm−nビット長のi個の値p[1],...,値p[i]を生成するのかについては説明を省略した。
次に、任意ビット長の値が入力された場合に、m−nビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10について説明する。
In the above description, in (S401), the default length value input unit 11 determines that i values p [1],. . . , The value p [i] is input. However, normally, the value input to the hash function is one arbitrary bit length value. In other words, in the above description, when one arbitrary bit length value is input, how the i values p [1],. . . , And the value p [i] is not described.
Next, when a value having an arbitrary bit length is input, i values p [1],. . . The hash value computing device 10 to which a function for generating the value p [i] is added will be described.

図29は、図26に示すハッシュ値演算装置10に、任意ビット長の値が入力された場合に、m−nビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10の機能を示す機能ブロック図である。
図30は、図29に示すハッシュ値演算装置10の動作を示すフローチャートである。
図31は、図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
29 shows a case where i values p [1],... With m−n bit length are inputted to the hash value computing device 10 shown in FIG. . . , Is a functional block diagram showing functions of the hash value computing device 10 to which a function for generating a value p [i] is added.
FIG. 30 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 31 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図29に示すハッシュ値演算装置10の機能と動作について説明する。
図29に示すハッシュ値演算装置10は、図1に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 29 will be described.
The hash value calculation device 10 illustrated in FIG. 29 includes an arbitrary length value input unit 15, a padding unit 16, and a division unit 17, in addition to the functions of the hash value calculation device 10 illustrated in FIG.

(S411:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S411: Arbitrary length value input step)
The arbitrary length value input unit 15 inputs an arbitrary bit length value M from the input device.

(S412:パディングステップ)
パディング部16は、(S411)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−nビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S412: Padding step)
The padding unit 16 adds a predetermined value to the value M input in (S411) using the padding function pad, and processes the value M ′ having a bit length i times the mn bit length. Is generated and stored in the storage device. That is, the padding unit 16 calculates M ′ = pad (M) by the processing device to obtain the value M ′.

(S413:分割ステップ)
分割部17は、(S412)で生成された値M’を処理装置によりi個に分割して、m−nビット長の値p[1],...,値p[i]を生成して記憶装置に記憶する。つまり、分割部17は、M’=p[1]||...||p[i]を処理装置により計算して値p[1],...,値p[i]を得る。
(S413: division step)
The dividing unit 17 divides the value M ′ generated in (S412) into i pieces by the processing device, and the values p [1],. . . , Value p [i] is generated and stored in the storage device. That is, the dividing unit 17 sets M ′ = p [1] ||. . . || p [i] is calculated by the processing unit and the values p [1],. . . , Value p [i] is obtained.

(S414:既定長値入力ステップ)
既定長値入力部11は、(S413)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S414: Default length input step)
The predetermined length value input unit 11 receives the values p [1],. . . , Value p [i] is input by an input device.

(S415)から(S420)までの処理は、(S402)から(S407)までの処理と同一である。   The processing from (S415) to (S420) is the same as the processing from (S402) to (S407).

(S412)におけるパディング方法の一例を説明する。
図32は、以下に説明する所定のパディング処理を行う場合の図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S412)でパディング部16は、(S411)で入力された値Mに対して、“1||0・・・0||<M>を付加して、m−nビット長のi倍のビット長の値M’を処理装置により生成する。ここで、<M>は、Mのビット長|M|の64ビット表現である。
このように、パディングして値M’を生成することにより、衝突困難性を高くすることができる。
An example of the padding method in (S412) will be described.
FIG. 32 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 29 when performing a predetermined padding process described below.
In (S412), the padding unit 16 adds “1 || 0... 0 || <M> to the value M input in (S411), i times the mn bit length. A bit length value M ′ is generated by the processing unit, where <M> is a 64-bit representation of the bit length | M |
Thus, the difficulty of collision can be increased by generating the value M ′ by padding.

なお、実施の形態1と同様に、予めiの値を決めておくのではなく、iの値は、入力された任意ビット長の値Mに応じて決定されるとしてもよい。   As in the first embodiment, the value of i may not be determined in advance, but the value of i may be determined according to the input arbitrary bit length value M.

次に、図32に示すハッシュ値演算装置10の圧縮関数としてSHA−256を用いた場合の例を説明する。なお、SHA−256の圧縮関数をSHA256と呼ぶ。SHA256は、256ビット長の値と512ビット長の値との2つの値が入力された場合に、256ビット長の値を出力する関数である。
図33は、圧縮関数としてSHA−256を用いる場合の図29に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
Next, an example in which SHA-256 is used as the compression function of the hash value computing device 10 shown in FIG. 32 will be described. Note that the compression function of SHA-256 is called SHA256. SHA256 is a function that outputs a 256-bit value when two values, a 256-bit value and a 512-bit value, are input.
FIG. 33 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 29 when SHA-256 is used as the compression function.

(S411)では、任意長値入力部15は、任意ビット長の値Mを入力する。
(S412)では、パディング部16は、(S411)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して256(=512−256)ビット長のi倍のビット長の値M’を生成する。
(S413)では、分割部17は、(S412)で生成された値M’をi個に分割して、256ビット長の値p[1],...,値p[i]を生成する。
(S414)では、既定長値入力部11は、(S413)で生成された256ビット長の値p[1],...,値p[i]を入力する。
(S415)では、固定値付加部12は、(S414)で入力された256ビット長の値p[1],...,値p[i]のそれぞれに対して、256ビット長の固定値const[1],...,固定値const[i]を付加して、512ビット長の値x[1],...,値x[i]を生成する。
(S416)では、圧縮関数計算部13は、256ビット長の固定値IV1と、(S415)で生成された512ビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を計算して256ビット長の値c[1]を得る。
(S417)では、圧縮関数計算部13は、j=2からi−1まで順に、256ビット長の値c[j−1]と512ビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を計算して256ビット長の値c[j]を得る。
(S418)では、置換関数計算部19は、(S417)で計算された256ビット長の値c[i−1]を置換関数πの入力として、c’[i−1]=π(c[i−1])を計算して256ビット長の値c’[i−1]を得る。
(S419)では、圧縮関数計算部13は、(S418)で計算された256ビット長の値c’[i−1]と、(S415)で生成された512ビット長の値x[i]とを圧縮関数hの入力として、c[i]=h(c’[i−1],x[i])を計算して256ビット長の値c[i]を得る。
(S420)では、出力部14は、(S419)で計算された値c[i]を出力する。
In (S411), the arbitrary length value input unit 15 inputs a value M having an arbitrary bit length.
In (S412), the padding unit 16 adds a predetermined value to the value M input in (S411) using the padding function pad, and is i times the 256 (= 512-256) bit length. A bit length value M ′ is generated.
In (S413), the dividing unit 17 divides the value M ′ generated in (S412) into i pieces and divides the values p [1],. . . , Value p [i].
In (S414), the predetermined length value input unit 11 performs the 256-bit length values p [1],. . . , Input the value p [i].
In (S415), the fixed value adding unit 12 receives the 256-bit length values p [1],. . . , Value p [i], a fixed value const [1],. . . , A fixed value const [i] is added to the value x [1],. . . , Value x [i].
In (S416), the compression function calculation unit 13 uses the fixed value IV1 of 256 bits and the value x [1] of 512 bits generated in (S415) as the input of the compression function h, and c [1] = h (IV1, x [1]) is calculated to obtain a 256-bit long value c [1].
In (S417), the compression function calculation unit 13 inputs the value c [j-1] having a 256-bit length and the value x [j] having a 512-bit length to the compression function h in order from j = 2 to i-1. C [j] = h (c [j−1], x [j]) is calculated to obtain a 256-bit long value c [j].
In (S418), the permutation function calculation unit 19 uses the value c [i−1] of 256 bits calculated in (S417) as an input of the permutation function π, and c ′ [i−1] = π (c [ i-1]) to obtain a 256-bit long value c ′ [i−1].
In (S419), the compression function calculation unit 13 calculates the 256-bit length value c ′ [i−1] calculated in (S418) and the 512-bit length value x [i] generated in (S415). As the input of the compression function h, c [i] = h (c ′ [i−1], x [i]) is calculated to obtain a 256-bit long value c [i].
In (S420), the output unit 14 outputs the value c [i] calculated in (S419).

実施の形態4に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが準一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。   The hash function configured by the hash value calculation device 10 according to the fourth embodiment cannot be strongly distinguished from a random oracle even if the compression function h is an ideal compression function whose quasi-unidirectionality is broken. It becomes a hash function that satisfies the characteristics.

なお、実施の形態1と同様に、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。   Note that, as in the first embodiment, the calculation is not necessarily performed according to the above-described processing order. When the stream processing can be performed, the calculation may be performed by the stream processing.

また、実施の形態1と同様に、圧縮関数計算部13は、ハッシュ値演算装置10の外部に備える圧縮関数計算装置に入力値を入力して、圧縮関数計算装置に圧縮関数hを計算させることにより、圧縮関数hを計算した結果を得てもよい。
また、同様に、置換関数計算部19は、ハッシュ値演算装置10の外部に備える置換関数演算装置に入力値を入力して、置換関数演算装置に置換関数πを計算させることにより、置換関数演算を計算した結果を得てもよい。
Similarly to the first embodiment, the compression function calculation unit 13 inputs an input value to a compression function calculation device provided outside the hash value calculation device 10 and causes the compression function calculation device to calculate the compression function h. Thus, the result of calculating the compression function h may be obtained.
Similarly, the replacement function calculation unit 19 inputs the input value to the replacement function calculation device provided outside the hash value calculation device 10 and causes the replacement function calculation device to calculate the replacement function π, thereby performing the replacement function calculation. You may obtain the result of having calculated.

また、圧縮関数計算部13が値c[1],...,値c[i]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。   In addition, the compression function calculation unit 13 receives the values c [1],. . . , C [i], the compression function h used for calculating the value c [i] may be the same compression function h or different compression functions h.

つまり、実施の形態4に係るハッシュ値演算装置10をまとめると次のようになる。
ハッシュ値演算装置10は、i個のm−sビットの入力値p[1],...,p[i]に対して、圧縮関数演算装置に、nビット固定値IV1、第1メッセージp[1]、nビット固定値const[1]を入力し、その出力c[1]を得る。次に、圧縮関数演算装置に、nビット値c[1]、第2メッセージp[2]、nビット固定値const[2]を入力し、その出力c[2]を得る。この処理を、第i−1メッセージまで同様に行い、その出力値c[i−1]を得る。fixed pointを持たないnビット上の任意の置換関数πを用いて、c=π(c[i−1])を計算する。圧縮関数演算装置に、nビット値c、第iメッセージp[i]、nビット固定値const[i]を入力し、その出力c[i]を得る。そして、c[i]を出力することを特徴とする。
That is, the hash value calculation device 10 according to the fourth embodiment is summarized as follows.
The hash value arithmetic unit 10 is configured to input i m-s bit input values p [1],. . . , P [i], the n-bit fixed value IV1, the first message p [1], and the n-bit fixed value const [1] are input to the compression function arithmetic unit, and the output c [1] is obtained. Next, the n-bit value c [1], the second message p [2], and the n-bit fixed value const [2] are input to the compression function arithmetic unit, and the output c [2] is obtained. This process is similarly performed up to the (i-1) th message, and the output value c [i-1] is obtained. c = π (c [i−1]) is calculated by using an arbitrary permutation function π on n bits having no fixed point. An n-bit value c, an i-th message p [i], and an n-bit fixed value const [i] are input to the compression function arithmetic unit, and an output c [i] is obtained. Then, c [i] is output.

また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−nビットの値を出力する任意のパディング処理装置を用いて、m−nビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−nビットの値p[1],...,p[i]に分割することを特徴とする。   In addition, the hash value calculation device 10 uses an arbitrary padding processing device that receives an arbitrary length value from an arbitrary length value M and outputs an mn bit value, and is a multiple of mn bits. A message M ′ is generated. Using a split processor, M 'is converted into i mn bit values p [1],. . . , P [i].

さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。   Further, the hash value computing device 10 changes the padding processing device to M || 1 || 0. . . 0 || <M>. However, <M> represents the bit length of M in 64 bits.

また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。   Further, the hash value calculation device 10 is characterized in that a compression function calculation device of SHA-256 is used as the compression function calculation device.

実施の形態5.
実施の形態5では、実施の形態4とは異なるハッシュ関数であって、準一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
Embodiment 5 FIG.
In the fifth embodiment, even when the hash function is different from that of the fourth embodiment and is configured using an ideal compression function whose quasi-unidirectionality has been broken, random oracles and so-called strong discrimination failures are not used. The hash value calculation device 10 that constitutes a new hash function that is possible will be described.

図34は、実施の形態5に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図35は、図34に示すハッシュ値演算装置10の動作を示すフローチャートである。
図36は、図34に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 34 is a functional block diagram illustrating functions of the hash value computing device 10 according to the fifth embodiment.
FIG. 35 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 36 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図34に示すハッシュ値演算装置10の機能と動作について説明する。
図34に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18、置換関数計算部19を備える。
The function and operation of the hash value calculation device 10 shown in FIG. 34 will be described.
The hash value calculation device 10 shown in FIG. 34 includes a predetermined length value input unit 11, a fixed value addition unit 12, a compression function calculation unit 13, an output unit 14, an exclusive OR calculation unit 18, and a substitution function calculation unit 19.

(S501:既定長値入力ステップ)
既定長値入力部11は、m−sビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S501: Default length input step)
The predetermined length value input unit 11 includes i values p [1],. . . , Value p [i] is input by the input device and stored in the storage device.

(S502:排他的論理和計算ステップ)
排他的論理和計算部18は、(S501)で入力されたm−sビット長の値p[1],...,p[i]と、予め記憶装置に記憶したm−sビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算してm−sビット長の値sumを得て記憶装置に記憶する。
(S502: exclusive OR calculation step)
The exclusive OR calculator 18 calculates the value p [1],... Of the m-s bit length input in (S501). . . , P [i] and an m-s bit length fixed value y stored in advance in the storage device as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing device to obtain a value sum of m-s bit length and stored in the storage device.

(S503:固定値付加ステップ)
固定値付加部12は、(S501)で入力されたm−sビット長の値p[1],...,値p[i]のそれぞれに対して、予め記憶装置に記憶したsビット長の固定値const[1],...,固定値const[i]を付加して、mビット長の値x[1],...,値x[i]を処理装置により生成して記憶装置に記憶する。
つまり、固定値付加部12は、値p[1]に固定値const[1]を付加して、値x[1]を生成する。固定値付加部12は、値p[2]に固定値const[2]を付加して、値x[2]を生成する。以下同様に、j=3,...,iに対して、固定値付加部12は、値p[j]に固定値const[j]を付加して、値x[j]を生成する。
なお、j=1,...,i−1について、値p[j]に固定値const[j]を付加する位置は、どこであってもよい。つまり、固定値const[j]は、値p[j]の前や後に追加してもよいし、値p[j]の間に挿入してもよい。
また、固定値const[1]≠固定値const[2]≠...≠固定値const[i]である。例えば、j=1,...,iについて、固定値const[j]は、jをsビットで表現した値<j>である。
(S503: fixed value addition step)
The fixed value adding unit 12 receives the m-s bit length values p [1],. . . , Values p [i], s bit length fixed values const [1],. . . , A fixed value const [i], and an m-bit length value x [1],. . . , Value x [i] is generated by the processing device and stored in the storage device.
That is, the fixed value adding unit 12 adds the fixed value const [1] to the value p [1] to generate the value x [1]. The fixed value adding unit 12 adds the fixed value const [2] to the value p [2] to generate the value x [2]. Similarly, j = 3,. . . , I, the fixed value adding unit 12 adds the fixed value const [j] to the value p [j] to generate the value x [j].
Note that j = 1,. . . , I−1, the position where the fixed value const [j] is added to the value p [j] may be anywhere. That is, the fixed value const [j] may be added before or after the value p [j], or may be inserted between the values p [j].
Further, the fixed value const [1] ≠ fixed value const [2] ≠. . . ≠ Fixed value const [i]. For example, j = 1,. . . , I, the fixed value const [j] is a value <j> in which j is expressed by s bits.

(S504:第1圧縮関数計算ステップ)
圧縮関数計算部13は、予め記憶装置に記憶したnビット長の固定値IV1と、(S503)で生成されたmビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を処理装置により計算してnビット長の値c[1]を得て記憶装置に記憶する。
(S504: First compression function calculation step)
The compression function calculator 13 uses the n-bit fixed value IV1 stored in the storage device in advance and the m-bit length value x [1] generated in (S503) as an input of the compression function h, and c [1] = H (IV1, x [1]) is calculated by the processing device to obtain an n-bit length value c [1] and stored in the storage device.

(S505:第2圧縮関数計算ステップ)
圧縮関数計算部13は、j=2からiまで順に、nビット長の値c[j−1]とmビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を処理装置により計算してnビット長の値c[j]を得て記憶装置に記憶する。
つまり、まず、圧縮関数計算部13は、(S504)で計算したnビット長の値c[1]と、(S503)で生成されたmビット長の値x[2]とを入力として、c[2]=h(c[1],x[2])を処理装置により計算してnビット長の値c[2]を得る。
次に、圧縮関数計算部13は、計算したnビット長の値c[2]と、(S503)で生成されたmビット長の値x[3]とを入力として、c[3]=h(c[2],x[3])を処理装置により計算してnビット長の値c[3]を得る。
これを繰り返して、最終的に、圧縮関数計算部13は、計算したnビット長の値c[i−1]と、(S503)で生成されたmビット長の値x[i]とを入力として、c[i]=h(c[i−1],x[i])を処理装置により計算してnビット長の値c[i]を得る。
(S505: Second compression function calculation step)
The compression function calculation unit 13 sequentially inputs the value c [j−1] having an n-bit length and the value x [j] having an m-bit length from j = 2 to i, and inputs c [j] = h (c [j−1], x [j]) is calculated by the processing device to obtain a value c [j] having an n-bit length and stored in the storage device.
That is, first, the compression function calculation unit 13 receives the value c [1] of the n-bit length calculated in (S504) and the value x [2] of the m-bit length generated in (S503) as c [2] = h (c [1], x [2]) is calculated by the processing device to obtain an n-bit length value c [2].
Next, the compression function calculation unit 13 receives the calculated n-bit length value c [2] and the m-bit length value x [3] generated in (S503) as input, and c [3] = h (C [2], x [3]) is calculated by the processing device to obtain an n-bit length value c [3].
By repeating this, finally, the compression function calculation unit 13 inputs the calculated n-bit length value c [i−1] and the m-bit length value x [i] generated in (S503). C [i] = h (c [i−1], x [i]) is calculated by the processing device to obtain an n-bit length value c [i].

(S506:置換関数計算ステップ)
置換関数計算部19は、(S505)で計算されたnビット長の値c[i]を置換関数πの入力として、c’[i]=π(c[i])を処理装置により計算してnビット長の値c’[i]を得て記憶装置に記憶する。
なお、置換関数πは、任意の値aを入力した場合に値aとは異なる値a’に置換する置換関数であって、値aを入力した場合に入力した値aがそのまま出力されることのない置換関数である。つまり、置換関数πは、π(a)=aとなるような固定点(Fixed Point)を有さない置換関数である。
(S506: Substitution function calculation step)
The replacement function calculation unit 19 uses the processing device to calculate c ′ [i] = π (c [i]) using the n-bit length value c [i] calculated in (S505) as an input of the replacement function π. N-bit length value c ′ [i] is obtained and stored in the storage device.
The replacement function π is a replacement function that replaces a value a ′ different from the value a when an arbitrary value a is input, and the input value a is output as it is when the value a is input. It is a replacement function without That is, the replacement function π is a replacement function that does not have a fixed point such that π (a) = a.

(S507:第3圧縮関数計算ステップ)
圧縮関数計算部13は、(S506)で計算されたnビット長の値c’[i]と、(S502)で計算されたm−sビット長の値sumにsビット長の固定値const[i+1]を付加したmビット長のx[i+1]を圧縮関数hの入力として、c[i+1]=h(c’[i],x[i+1])を処理装置により計算してnビット長の値c[i+1]を得て記憶装置に記憶する。
なお、固定値const[i+1]≠固定値const[1]≠...≠固定値const[i]である。例えば、固定値const[i+1]は、i+1をsビットで表現した値<i+1>である。
また、値sumに固定値const[i+1]を付加する位置は、どこであってもよい。つまり、固定値const[i+1]は、値sumの前や後に追加してもよいし、値sumの間に挿入してもよい。
(S507: third compression function calculation step)
The compression function calculation unit 13 adds the value c ′ [i] of the n-bit length calculated in (S506) and the value sum of the m-s bit length calculated in (S502) to a fixed value const [ c [i + 1] = h (c ′ [i], x [i + 1]) is calculated by the processing device using m [i + 1] with x [i + 1] added with i + 1] as an input to the compression function h, and nbit length The value c [i + 1] is obtained and stored in the storage device.
Note that the fixed value const [i + 1] ≠ fixed value const [1] ≠. . . ≠ Fixed value const [i]. For example, the fixed value const [i + 1] is a value <i + 1> in which i + 1 is expressed by s bits.
Further, the position where the fixed value const [i + 1] is added to the value sum may be anywhere. That is, the fixed value const [i + 1] may be added before or after the value sum, or may be inserted between the values sum.

(S508:出力ステップ)
出力部14は、(S507)で計算された値c[i+1]を出力装置により出力する。
(S508: Output step)
The output unit 14 outputs the value c [i + 1] calculated in (S507) from the output device.

なお、i=1の場合、つまり(S501)で1個の値p[1]のみが入力された場合には、(S505)は実行されない。つまり、(S504)で値c[1]を得た後、(S506)で値c[1]を入力として、値c’[1]を得る。そして、(S507)で値c’[1]と値sumに固定値const[i+1]を付加した値x[2]とを入力として、値c[2]を得る。   When i = 1, that is, when only one value p [1] is input in (S501), (S505) is not executed. That is, after obtaining the value c [1] in (S504), the value c [1] is input in (S506) to obtain the value c '[1]. In step S507, the value c '[1] and the value x [2] obtained by adding the fixed value const [i + 1] to the value sum are input to obtain the value c [2].

以上をまとめると、次のようになる。
まず、ハッシュ値演算装置10は、sum=p[1] xor,...,xor p[i] xor yを処理装置により計算する。
また、ハッシュ値演算装置10は、j=1からiまで順に、c[j]=h(c[j−1],p[j]||<j>)を計算する。ここで、c[0]は、IV1とする。
次に、ハッシュ値演算装置10は、c[i+1]=h(π(c[i]),sum||<i+1>)を計算する。
そして、ハッシュ値演算装置10は、値c[i+1]を出力する。
The above is summarized as follows.
First, the hash value computing device 10 is sum = p [1] xor,. . . , Xor p [i] xor y is calculated by the processing unit.
Further, the hash value calculation device 10 calculates c [j] = h (c [j−1], p [j] || <j>) in order from j = 1 to i. Here, c [0] is IV1.
Next, the hash value calculation device 10 calculates c [i + 1] = h (π (c [i]), sum || <i + 1>).
Then, the hash value calculation device 10 outputs the value c [i + 1].

上記説明では、(S501)で既定長値入力部11が、m−sビット長のi個の値p[1],...,値p[i]を入力するとした。しかし、通常、ハッシュ関数へ入力される値は、1個の任意ビット長の値である。つまり、上記説明では、1個の任意ビット長の値が入力された場合に、どのようにm−sビット長のi個の値p[1],...,値p[i]を生成するのかについては説明を省略した。
次に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10について説明する。
In the above description, in (S501), the predetermined length value input unit 11 determines that the i values p [1],. . . , The value p [i] is input. However, normally, the value input to the hash function is one arbitrary bit length value. In other words, in the above description, when one arbitrary bit length value is input, how the i values p [1],. . . , And the value p [i] is not described.
Next, when an arbitrary bit length value is input, i values p [1],. . . The hash value computing device 10 to which a function for generating the value p [i] is added will be described.

図37は、図34に示すハッシュ値演算装置10に、任意ビット長の値が入力された場合に、m−sビット長のi個の値p[1],...,値p[i]を生成する機能を追加したハッシュ値演算装置10の機能を示す機能ブロック図である。
図38は、図37に示すハッシュ値演算装置10の動作を示すフローチャートである。
図39は、図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 37 illustrates the case where i values p [1],... With m−s bit length are input to the hash value computing device 10 illustrated in FIG. . . , Is a functional block diagram showing functions of the hash value computing device 10 to which a function for generating a value p [i] is added.
FIG. 38 is a flowchart showing the operation of the hash value computing device 10 shown in FIG.
FIG. 39 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG.

図37に示すハッシュ値演算装置10の機能と動作について説明する。
図37に示すハッシュ値演算装置10は、図34に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash value computing device 10 shown in FIG. 37 will be described.
The hash value calculation device 10 illustrated in FIG. 37 includes an arbitrary length value input unit 15, a padding unit 16, and a division unit 17 in addition to the functions provided in the hash value calculation device 10 illustrated in FIG.

(S511:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S511: Arbitrary length value input step)
The arbitrary length value input unit 15 inputs an arbitrary bit length value M from the input device.

(S512:パディングステップ)
パディング部16は、(S511)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−sビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S512: Padding step)
The padding unit 16 adds a predetermined value to the value M input in (S511) using the padding function pad, and processes the value M ′ having a bit length i times the m-s bit length. Is generated and stored in the storage device. That is, the padding unit 16 calculates M ′ = pad (M) by the processing device to obtain the value M ′.

(S513:分割ステップ)
分割部17は、(S512)で生成された値M’を処理装置によりi個に分割して、m−sビット長の値p[1],...,値p[i]を生成して記憶装置に記憶する。つまり、分割部17は、M’=p[1]||...||p[i]を処理装置により計算して値p[1],...,値p[i]を得る。
(S513: Division step)
The dividing unit 17 divides the value M ′ generated in (S512) into i pieces by the processing device, and sets the values p [1],. . . , Value p [i] is generated and stored in the storage device. That is, the dividing unit 17 sets M ′ = p [1] ||. . . || p [i] is calculated by the processing unit and the values p [1],. . . , Value p [i] is obtained.

(S514:既定長値入力ステップ)
既定長値入力部11は、(S513)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S514: Default length input step)
The predetermined length value input unit 11 receives the values p [1],. . . , Value p [i] is input by an input device.

(S515)から(S521)までの処理は、(S502)から(S508)までの処理と同一である。   The processing from (S515) to (S521) is the same as the processing from (S502) to (S508).

(S512)におけるパディング方法の一例を説明する。
図40は、以下に説明するパディング処理を行う場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S512)でパディング部16は、実施の形態1で説明した(S112)におけるパディング方法と同様に、(S511)で入力された値Mに対して、“1||0・・・0||<M>を付加して、m−sビット長のi倍のビット長の値M’を処理装置により生成する。ここで、<M>は、Mのビット長|M|の64ビット表現である。
このように、パディングして値M’を生成することにより、衝突困難性を高くすることができる。
An example of the padding method in (S512) will be described.
FIG. 40 is a structural diagram of a hash function realized by the hash value calculation apparatus 10 shown in FIG. 37 when the padding process described below is performed.
In (S512), the padding unit 16 performs "1 || 0 ... 0 || for the value M input in (S511), similarly to the padding method in (S112) described in the first embodiment. A value M ′ having a bit length i times the m-s bit length is generated by the processing device by adding <M>, where <M> is a 64-bit representation of the bit length | M | is there.
Thus, the difficulty of collision can be increased by generating the value M ′ by padding.

図41は、以下に説明するパディング処理を行う場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
(S512)でパディング部16は、(S511)で入力された値Mに対して、“1||0・・・0を付加して、m−sビット長のi倍のビット長の値M’を処理装置により生成する。
このように、パディングして値M’を生成しても、衝突困難性を高くすることができる。
FIG. 41 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37 when the padding process described below is performed.
In (S512), the padding unit 16 adds “1 || 0... 0 to the value M input in (S511), and a value M having a bit length i times the m-s bit length. 'Is generated by the processing device.
Thus, even if padding generates the value M ′, the collision difficulty can be increased.

なお、実施の形態1と同様に、予めiの値を決めておくのではなく、iの値は、入力された任意ビット長の値Mに応じて決定されるとしてもよい。   As in the first embodiment, the value of i may not be determined in advance, but the value of i may be determined according to the input arbitrary bit length value M.

次に、図37に示すハッシュ値演算装置10の圧縮関数としてSHA−256を用いた場合の例を説明する。なお、SHA−256の圧縮関数をSHA256と呼ぶ。SHA256は、256ビット長の値と512ビット長の値との2つの値が入力された場合に、256ビット長の値を出力する関数である。
図42は、圧縮関数としてSHA−256を用いる場合の図37に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
なお、以下の説明では、値sを56として説明する。
Next, an example in which SHA-256 is used as the compression function of the hash value computing device 10 shown in FIG. Note that the compression function of SHA-256 is called SHA256. SHA256 is a function that outputs a 256-bit value when two values, a 256-bit value and a 512-bit value, are input.
FIG. 42 is a structural diagram of a hash function realized by the hash value computing device 10 shown in FIG. 37 when SHA-256 is used as the compression function.
In the following description, the value s is assumed to be 56.

(S511)では、任意長値入力部15は、任意ビット長の値Mを入力する。
(S512)では、パディング部16は、(S511)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して456(=512−56)ビット長のi倍のビット長の値M’を生成する。
(S513)では、分割部17は、(S512)で生成された値M’をi個に分割して、456ビット長の値p[1],...,値p[i]を生成する。
(S514)では、既定長値入力部11は、(S513)で生成された456ビット長の値p[1],...,値p[i]を入力する。
(S515)では、排他的論理和計算部18は、(S514)で入力された456ビット長の値p[1],...,p[i]と、456ビット長の固定値yとを排他的論理和演算の入力として、sum=p[1] xor,...,xor p[i] xor yを計算して456ビット長の値sumを得る。
(S516)では、固定値付加部12は、(S511)で入力された456ビット長の値p[1],...,値p[i]のそれぞれに対して、56ビット長の固定値const[1],...,固定値const[i]を付加して、512ビット長の値x[1],...,値x[i]を生成する。
(S517)では、圧縮関数計算部13は、256ビット長の固定値IV1と、(S516)で生成された512ビット長の値x[1]を圧縮関数hの入力として、c[1]=h(IV1,x[1])を計算して256ビット長の値c[1]を得る。
(S518)では、圧縮関数計算部13は、j=2からiまで順に、256ビット長の値c[j−1]と512ビット長の値x[j]とを圧縮関数hの入力として、c[j]=h(c[j−1],x[j])を計算して256ビット長の値c[j]を得る。
(S519)では、置換関数計算部19は、(S518)で計算された256ビット長の値c[i]を置換関数πの入力として、c’[i]=π(c[i])を計算して256ビット長の値c’[i]を得る。
(S520)では、圧縮関数計算部13は、(S519)で計算された256ビット長の値c’[i]と、(S515)で計算された456ビット長の値sumに56ビット長の固定値const[i+1]を付加した512ビット長のx[i+1]を圧縮関数hの入力として、c[i+1]=h(c’[i],x[i+1])を計算して256ビット長の値c[i+1]を得る。
(S521)では、出力部14は、(S520)で計算された値c[i+1]を出力する。
In (S511), the arbitrary length value input unit 15 inputs a value M having an arbitrary bit length.
In (S512), the padding unit 16 adds a predetermined value to the value M input in (S511) by using the padding function pad, i times the 456 (= 512-56) bit length. A bit length value M ′ is generated.
In (S513), the dividing unit 17 divides the value M ′ generated in (S512) into i pieces and 456-bit length values p [1],. . . , Value p [i].
In (S514), the predetermined length value input unit 11 receives the 456-bit length values p [1],. . . , Input the value p [i].
In (S515), the exclusive OR calculation unit 18 uses the 456-bit length values p [1],. . . , P [i] and a fixed value y of 456 bits as inputs of the exclusive OR operation, sum = p [1] xor,. . . , Xor p [i] xor y is calculated to obtain a value sum of 456 bits.
In (S516), the fixed value adding unit 12 receives the values p [1],. . . , Value p [i], a fixed value const [1],. . . , A fixed value const [i] is added to the value x [1],. . . , Value x [i].
In (S517), the compression function calculation unit 13 uses the fixed value IV1 of 256 bits and the value x [1] of 512 bits generated in (S516) as the input of the compression function h, and c [1] = h (IV1, x [1]) is calculated to obtain a 256-bit long value c [1].
In (S518), the compression function calculation unit 13 sequentially inputs a value c [j−1] of 256 bits and a value x [j] of 512 bits in length from j = 2 to i as inputs of the compression function h. c [j] = h (c [j−1], x [j]) is calculated to obtain a 256-bit long value c [j].
In (S519), the permutation function calculation unit 19 takes c ′ [i] = π (c [i]) as the input of the permutation function π using the 256-bit length value c [i] calculated in (S518). Calculate to obtain a value c ′ [i] that is 256 bits long.
In (S520), the compression function calculation unit 13 fixes the 56-bit length to the 256-bit length value c ′ [i] calculated in (S519) and the 456-bit length value sum calculated in (S515). Using a 512-bit length x [i + 1] to which the value const [i + 1] is added as an input to the compression function h, c [i + 1] = h (c ′ [i], x [i + 1]) is calculated to obtain a 256-bit length. The value c [i + 1] is obtained.
In (S521), the output unit 14 outputs the value c [i + 1] calculated in (S520).

実施の形態5に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが準一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。   The hash function configured by the hash value computing device 10 according to the fifth embodiment cannot be strongly distinguished from a random oracle even if the compression function h is an ideal compression function whose quasi-unidirectionality is broken. It becomes a hash function that satisfies the characteristics.

なお、実施の形態1と同様に、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。   Note that, as in the first embodiment, the calculation is not necessarily performed according to the above-described processing order. When the stream processing can be performed, the calculation may be performed by the stream processing.

また、実施の形態1と同様に、圧縮関数計算部13は、ハッシュ値演算装置10の外部に備える圧縮関数計算装置に入力値を入力して、圧縮関数計算装置に圧縮関数hを計算させることにより、圧縮関数hを計算した結果を得てもよい。
また、同様に、排他的論理和計算部18は、ハッシュ値演算装置10の外部に備える排他的論理和計算装置に入力値を入力して、排他的論理和計算装置に排他的論理和演算を計算させることにより、排他的論理和演算を計算した結果を得てもよい。同様に、置換関数計算部19は、ハッシュ値演算装置10の外部に備える置換関数演算装置に入力値を入力して、置換関数演算装置に置換関数πを計算させることにより、置換関数演算を計算した結果を得てもよい。
Similarly to the first embodiment, the compression function calculation unit 13 inputs an input value to a compression function calculation device provided outside the hash value calculation device 10 and causes the compression function calculation device to calculate the compression function h. Thus, the result of calculating the compression function h may be obtained.
Similarly, the exclusive OR calculator 18 inputs an input value to an exclusive OR calculator provided outside the hash value calculator 10 and performs an exclusive OR operation on the exclusive OR calculator. By calculating, an exclusive OR operation result may be obtained. Similarly, the substitution function calculation unit 19 calculates a substitution function calculation by inputting an input value to a substitution function calculation device provided outside the hash value calculation device 10 and causing the substitution function calculation device to calculate a substitution function π. Results may be obtained.

また、圧縮関数計算部13が値c[1],...,値c[i+1]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。   In addition, the compression function calculation unit 13 receives the values c [1],. . . , C [i + 1] may be the same compression function h or different compression functions h.

つまり、実施の形態5に係るハッシュ値演算装置10をまとめると次のようになる。
ハッシュ値演算装置10は、i個のm−sビットの入力値p[1],...,p[i]に対して、圧縮関数演算装置に、nビット固定値IV1、第1メッセージp[1]、1のsビット表現値を入力し、その出力c[1]を得る。次に、圧縮関数演算装置に、nビット値c[1]、第2メッセージp[2]、2のsビット表現値を入力し、その出力c[2]を得る。この処理を、第iメッセージまで同様に行い、その出力値c[i]を得る。fixed pointを持たないnビット上の任意の置換関数πを用いて、c=π(c[i])を計算する。圧縮関数演算装置に、nビット値c、sum=p[1] xor ... xor p[i] xor y、i+1のsビットの表現値を入力し、その出力c[i+1]を得る。c[i+1]を出力することを特徴とする。ここで、yはm−sビット固定値である。
That is, the hash value calculation apparatus 10 according to the fifth embodiment is summarized as follows.
The hash value arithmetic unit 10 is configured to input i m-s bit input values p [1],. . . , P [i], the n-bit fixed value IV1, the first message p [1], and the s-bit representation value of 1 are input to the compression function arithmetic unit, and the output c [1] is obtained. Next, the n-bit value c [1], the second message p [2], and the s-bit representation value of 2 are input to the compression function arithmetic unit, and the output c [2] is obtained. This process is similarly performed up to the i-th message, and the output value c [i] is obtained. c = π (c [i]) is calculated by using an arbitrary permutation function π on n bits having no fixed point. The compression function arithmetic unit receives an n-bit value c, sum = p [1] xor. . . xor p [i] xor y, an s-bit representation value of i + 1 is input, and its output c [i + 1] is obtained. c [i + 1] is output. Here, y is a fixed value of m−s bits.

また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−sビットの値を出力する任意のパディング処理装置を用いて、m−sビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−sビットの値p[1],...,p[i]に分割することを特徴とする。   Further, the hash value computing device 10 is a multiple of m-s bits using an arbitrary padding processing device that receives an arbitrary length value from an arbitrary length value M and outputs an m-s bit value. A message M ′ is generated. Using a split processor, M 'is replaced with i ms bit values p [1],. . . , P [i].

さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。   Further, the hash value computing device 10 changes the padding processing device to M || 1 || 0. . . 0 || <M> and s = 56. However, <M> represents the bit length of M in 64 bits.

また、さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0とし、s=56とすることを特徴とする。   Further, the hash value calculation device 10 changes the padding processing device to M || 1 || 0. . . 0 and s = 56.

また、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。   Further, the hash value calculation device 10 is characterized by using a SHA-256 compression function calculation device as the compression function calculation device.

すなわち、以上の実施の形態に係るハッシュ値演算装置10は、EMD構造、MDP構造、圧縮関数に固定値を入力する操作、圧縮関数に圧縮関数番号を入力する操作、メッセージの排他的論理輪値を圧縮関数の入力とする操作を利用してハッシュ関数を構成する。これにより、一方向性が破られた圧縮関数または準一方向性が破られた圧縮関数から、ランダムオラクルと強識別不可能性を満たす、効率的なハッシュ関数を構成する。   In other words, the hash value calculation apparatus 10 according to the above embodiments includes an EMD structure, an MDP structure, an operation for inputting a fixed value to the compression function, an operation for inputting a compression function number to the compression function, and an exclusive logical value of the message. A hash function is constructed using an operation that uses as a compression function input. As a result, an efficient hash function that satisfies the random oracle and the strong indistinguishability is constructed from the compression function with broken unidirectionality or the compression function with broken quasi-unidirectionality.

なお、以上の実施の形態に係るハッシュ値演算装置10は、暗号処理(署名処理を含む)を行う暗号処理装置等において用いられるハッシュ値を計算するための装置である。   The hash value calculation device 10 according to the above embodiment is a device for calculating a hash value used in a cryptographic processing device or the like that performs cryptographic processing (including signature processing).

次に、実施の形態におけるハッシュ値演算装置10のハードウェア構成について説明する。
図43は、ハッシュ値演算装置10のハードウェア構成の一例を示す図である。
図43に示すように、ハッシュ値演算装置10は、プログラムを実行するCPU911(Central・Processing・Unit、中央処理装置、処理装置、演算装置、演算回路、マイクロプロセッサ、マイクロコンピュータ、プロセッサともいう)を備えている。CPU911は、バス912を介してROM913、RAM914、LCD901(Liquid Crystal Display)、キーボード902(K/B)、通信ボード915、磁気ディスク装置920と接続され、これらのハードウェアデバイスを制御する。磁気ディスク装置920(固定ディスク装置)の代わりに、光ディスク装置、メモリカード読み書き装置などの記憶装置でもよい。磁気ディスク装置920は、所定の固定ディスクインタフェースを介して接続される。
Next, the hardware configuration of the hash value calculation device 10 in the embodiment will be described.
FIG. 43 is a diagram illustrating an example of a hardware configuration of the hash value calculation device 10.
As shown in FIG. 43, the hash value calculation apparatus 10 includes a CPU 911 (also referred to as a central processing unit, a central processing unit, a processing unit, an arithmetic unit, an arithmetic circuit, a microprocessor, a microcomputer, and a processor) that executes a program. I have. The CPU 911 is connected to the ROM 913, the RAM 914, the LCD 901 (Liquid Crystal Display), the keyboard 902 (K / B), the communication board 915, and the magnetic disk device 920 via the bus 912, and controls these hardware devices. Instead of the magnetic disk device 920 (fixed disk device), a storage device such as an optical disk device or a memory card read / write device may be used. The magnetic disk device 920 is connected via a predetermined fixed disk interface.

ROM913、磁気ディスク装置920は、不揮発性メモリの一例である。RAM914は、揮発性メモリの一例である。ROM913とRAM914と磁気ディスク装置920とは、記憶装置の一例である。また、キーボード902、通信ボード915は、入力装置の一例である。また、通信ボード915は、通信装置(ネットワークインタフェース)の一例である。さらに、LCD901は、表示装置の一例である。   The ROM 913 and the magnetic disk device 920 are examples of a nonvolatile memory. The RAM 914 is an example of a volatile memory. The ROM 913, the RAM 914, and the magnetic disk device 920 are examples of storage devices. The keyboard 902 and the communication board 915 are examples of input devices. The communication board 915 is an example of a communication device (network interface). Furthermore, the LCD 901 is an example of a display device.

磁気ディスク装置920又はROM913などには、オペレーティングシステム921(OS)、ウィンドウシステム922、プログラム群923、ファイル群924が記憶されている。プログラム群923のプログラムは、CPU911、オペレーティングシステム921、ウィンドウシステム922により実行される。   An operating system 921 (OS), a window system 922, a program group 923, and a file group 924 are stored in the magnetic disk device 920 or the ROM 913. The programs in the program group 923 are executed by the CPU 911, the operating system 921, and the window system 922.

プログラム群923には、上記の説明において「既定長値入力部11」、「固定値付加部12」、「圧縮関数計算部13」、「出力部14」、「任意長値入力部15」、「パディング部16」、「分割部17」、「排他的論理和計算部18」、「置換関数計算部19」等として説明した機能を実行するソフトウェアやプログラムやその他のプログラムが記憶されている。プログラムは、CPU911により読み出され実行される。
ファイル群924には、上記の説明において固定値や途中計算結果等の情報やデータや信号値や変数値やパラメータが、「ファイル」や「データベース」の各項目として記憶される。「ファイル」や「データベース」は、ディスクやメモリなどの記録媒体に記憶される。ディスクやメモリなどの記憶媒体に記憶された情報やデータや信号値や変数値やパラメータは、読み書き回路を介してCPU911によりメインメモリやキャッシュメモリに読み出され、抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示などのCPU911の動作に用いられる。抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示のCPU911の動作の間、情報やデータや信号値や変数値やパラメータは、メインメモリやキャッシュメモリやバッファメモリに一時的に記憶される。
In the program group 923, in the above description, “predetermined length value input unit 11”, “fixed value addition unit 12”, “compression function calculation unit 13”, “output unit 14”, “arbitrary length value input unit 15”, Stored are software, programs, and other programs that execute the functions described as “padding unit 16”, “dividing unit 17”, “exclusive OR calculator 18”, “replacement function calculator 19”, and the like. The program is read and executed by the CPU 911.
In the file group 924, information such as fixed values, intermediate calculation results, data, signal values, variable values, and parameters in the above description are stored as items of “file” and “database”. The “file” and “database” are stored in a recording medium such as a disk or a memory. Information, data, signal values, variable values, and parameters stored in a storage medium such as a disk or memory are read out to the main memory or cache memory by the CPU 911 via a read / write circuit, and extracted, searched, referenced, compared, and calculated. Used for the operation of the CPU 911 such as calculation / processing / output / printing / display. Information, data, signal values, variable values, and parameters are temporarily stored in the main memory, cache memory, and buffer memory during the operation of the CPU 911 for extraction, search, reference, comparison, calculation, calculation, processing, output, printing, and display. Is remembered.

また、上記の説明におけるフローチャートの矢印の部分は主としてデータや信号の入出力を示し、データや信号値は、RAM914のメモリ、その他光ディスク等の記録媒体やICチップに記録される。また、データや信号は、バス912や信号線やケーブルその他の伝送媒体や電波によりオンライン伝送される。
また、上記の説明において「〜部」として説明するものは、「〜回路」、「〜装置」、「〜機器」、「〜手段」、「〜機能」であってもよく、また、「〜ステップ」、「〜手順」、「〜処理」であってもよい。また、「〜装置」として説明するものは、「〜回路」、「〜装置」、「〜機器」、「〜手段」、「〜機能」であってもよく、また、「〜ステップ」、「〜手順」、「〜処理」であってもよい。さらに、「〜処理」として説明するものは「〜ステップ」であっても構わない。すなわち、「〜部」として説明するものは、ROM913に記憶されたファームウェアで実現されていても構わない。或いは、ソフトウェアのみ、或いは、素子・デバイス・基板・配線などのハードウェアのみ、或いは、ソフトウェアとハードウェアとの組み合わせ、さらには、ファームウェアとの組み合わせで実施されても構わない。ファームウェアとソフトウェアは、プログラムとして、ROM913等の記録媒体に記憶される。プログラムはCPU911により読み出され、CPU911により実行される。すなわち、プログラムは、上記で述べた「〜部」としてコンピュータ等を機能させるものである。あるいは、上記で述べた「〜部」の手順や方法をコンピュータ等に実行させるものである。
In the above description, the arrows in the flowchart mainly indicate input / output of data and signals, and the data and signal values are recorded in a memory of the RAM 914, other recording media such as an optical disk, and an IC chip. Data and signals are transmitted online by a bus 912, signal lines, cables, other transmission media, and radio waves.
In addition, what is described as “to part” in the above description may be “to circuit”, “to device”, “to device”, “to means”, and “to function”. It may be “step”, “˜procedure”, “˜processing”. In addition, what is described as “˜device” may be “˜circuit”, “˜device”, “˜device”, “˜means”, “˜function”, and “˜step”, “ ~ Procedure "," ~ process ". Furthermore, what is described as “to process” may be “to step”. That is, what is described as “˜unit” may be realized by firmware stored in the ROM 913. Alternatively, it may be implemented only by software, or only by hardware such as elements, devices, substrates, and wirings, by a combination of software and hardware, or by a combination of firmware. Firmware and software are stored in a recording medium such as ROM 913 as a program. The program is read by the CPU 911 and executed by the CPU 911. That is, the program causes a computer or the like to function as the “˜unit” described above. Alternatively, the computer or the like is caused to execute the procedures and methods of “to part” described above.

10 ハッシュ値演算装置、11 既定長値入力部、12 固定値付加部、13 圧縮関数計算部、14 出力部、15 任意長値入力部、16 パディング部、17 分割部、18 排他的論理和計算部、19 置換関数計算部。   DESCRIPTION OF SYMBOLS 10 Hash value arithmetic unit, 11 Default length value input part, 12 Fixed value addition part, 13 Compression function calculation part, 14 Output part, 15 Arbitrary length value input part, 16 Padding part, 17 Dividing part, 18 Exclusive OR calculation Part, 19 substitution function calculation part.

Claims (2)

値M’が分割されたi個の値p[1],...,値p[i]であって、所定の自然数mと、自然数mよりも小さい自然数nとについて、m−nビット長の値p[1],...,値p[i]を入力する既定長値入力部と、
前記既定長値入力部が入力したm−nビット長の値p[1],...,値p[i]のうち、i−1個の値p[1],...,値p[i−1]それぞれに対して、nビット長の固定値const[1],...,固定値const[i−1]を付加して、mビット長の値x[1],...,値x[i−1]を生成して記憶装置に記憶する固定値付加部と、
j=1からi−1まで順に、nビット長の値c[j−1](値c[0]はnビット長の固定値IV1とする)と、前記固定値付加部が生成したmビット長の値x[j]とを入力として、圧縮関数hを計算した結果であるnビット長の値c[j]を得ることにより、nビット長の値c[i−1]を得て記憶装置に記憶し、
nビット長の固定値IV2と、m−nビット長の値p[i]にnビット長の値c[i−1]を付加したmビット長の値x[i]とを入力として、圧縮関数hを計算した結果であるnビット長の値c[i]を得て記憶装置に記憶する圧縮関数計算部と、
前記圧縮関数計算部が得た値c[i]を出力する出力部と
を備えることを特徴とするハッシュ値演算装置。
I values p [1],. . . , Value p [i], for a predetermined natural number m and a natural number n smaller than the natural number m, the value p [1],. . . , A predetermined length input unit for inputting the value p [i],
The mn bit length values p [1],. . . , Value p [i], i−1 values p [1],. . . , Values p [i−1], n-bit fixed values const [1],. . . , A fixed value const [i−1], and an m-bit length value x [1],. . . , A fixed value adding unit that generates a value x [i−1] and stores it in the storage device;
In order from j = 1 to i−1, an n-bit value c [j−1] (value c [0] is an n-bit fixed value IV1) and m bits generated by the fixed value adding unit By inputting the length value x [j] and obtaining the n-bit length value c [j] which is the result of calculating the compression function h, the n-bit length value c [i-1] is obtained and stored. Memorize in the device,
a fixed value IV2 of n bit length, m-n to the value p [i] of the bit length of an n-bit length value c [i-1] by adding the m-bit length of the value x [i] as input, compression A compression function calculation unit that obtains an n-bit length value c [i], which is a result of calculating the function h, and stores it in a storage device;
A hash value calculation device comprising: an output unit that outputs a value c [i] obtained by the compression function calculation unit.
前記ハッシュ値演算装置は、さらに、
任意ビット長の値Mを入力する任意長値入力部と、
前記任意長値入力部が入力した値Mに対して、所定の値を付加してm−nビット長のi倍のビット長の値M’を生成して記憶装置に記憶するパディング部と、
前記パディング部が生成した値M’を分割して、m−nビット長の値p[1],...,値p[i]を生成して記憶装置に記憶する分割部とを備え、
前記既定長値入力部は、前記分割部が生成した値p[1],...,値p[i]を入力する
ことを特徴とする請求項に記載のハッシュ値演算装置。
The hash value calculation device further includes:
An arbitrary length value input unit for inputting an arbitrary bit length value M;
A padding unit for adding a predetermined value to the value M input by the arbitrary length value input unit to generate a value M ′ having a bit length i times mn bit length and storing the value M ′ in a storage device;
The value M ′ generated by the padding unit is divided into values p [1],. . . , A dividing unit that generates a value p [i] and stores it in a storage device,
The predetermined length value input unit includes the values p [1],. . . , The hash value calculation device according to claim 1, characterized in that the input values p [i].
JP2009125976A 2009-05-26 2009-05-26 Hash value calculation device, hash value calculation method, and hash value calculation program Expired - Fee Related JP5398353B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009125976A JP5398353B2 (en) 2009-05-26 2009-05-26 Hash value calculation device, hash value calculation method, and hash value calculation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009125976A JP5398353B2 (en) 2009-05-26 2009-05-26 Hash value calculation device, hash value calculation method, and hash value calculation program

Publications (2)

Publication Number Publication Date
JP2010276629A JP2010276629A (en) 2010-12-09
JP5398353B2 true JP5398353B2 (en) 2014-01-29

Family

ID=43423691

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009125976A Expired - Fee Related JP5398353B2 (en) 2009-05-26 2009-05-26 Hash value calculation device, hash value calculation method, and hash value calculation program

Country Status (1)

Country Link
JP (1) JP5398353B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5621569B2 (en) 2010-12-13 2014-11-12 ソニー株式会社 Imaging apparatus and shutter operation correction method

Also Published As

Publication number Publication date
JP2010276629A (en) 2010-12-09

Similar Documents

Publication Publication Date Title
US10284368B2 (en) Secure key storage
JP6058245B2 (en) Random number expansion apparatus, random number expansion method and random number expansion program
EP3096245B1 (en) Retrievable cryptograph processing system and retrievable cryptograph processing method
JP6144992B2 (en) Searchable cryptographic processing system and method
JP5710460B2 (en) Encryption key generation apparatus and program
CN109993008A (en) Method and arrangement for implicit integrality
US10326589B2 (en) Message authenticator generating apparatus, message authenticator generating method, and computer readable recording medium
US20200089921A1 (en) Tamper-resistant component networks
US10536264B2 (en) Efficient cryptographically secure control flow integrity protection
CN105095097B (en) The memory access of randomization
JP6735926B2 (en) Encryption device, decryption device, encryption method, decryption method, encryption program, and decryption program
CN106792686B (en) RFID bidirectional authentication method
CN107534549B (en) Readable storage medium, method and system for encrypting data stream block
EP3959618A1 (en) Efficient side-channel-attack-resistant memory encryptor based on key update
CN111008407A (en) Encryption circuit for performing virtual encryption operations
WO2016063512A1 (en) Mac tag list generating apparatus, mac tag list verifying apparatus, mac tag list generating method, mac tag list verifying method and program recording medium
WO2019114084A1 (en) Encrypting/decrypting method for multi-digit number and encrypting/decrypting server
JP5398353B2 (en) Hash value calculation device, hash value calculation method, and hash value calculation program
JP6040780B2 (en) Cryptographic processing apparatus, method and program
US11177936B2 (en) Message authenticator generation apparatus
TWI565285B (en) A cryptographic device, a memory system, a decoding device, a cryptographic method, a decoding method, a cryptographic program product and a decoding program product
JP2013126078A (en) Encryption processing apparatus, encryption processing method, and program
JP6830867B2 (en) Authenticated encryption system with additional data, decryption device, authenticated encryption method with additional data, and program
CN111092721A (en) Method and device for setting access password
JP6033504B1 (en) Message authenticator generator

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120305

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20120305

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130702

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130827

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130924

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131022

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees