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 PDFInfo
- 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
Links
- 238000004364 calculation method Methods 0.000 title claims description 260
- 230000006835 compression Effects 0.000 claims description 277
- 238000007906 compression Methods 0.000 claims description 277
- 230000006870 function Effects 0.000 description 513
- 238000012545 processing Methods 0.000 description 119
- 238000010586 diagram Methods 0.000 description 64
- 238000000034 method Methods 0.000 description 45
- 238000006467 substitution reaction Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
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
非特許文献2には、一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能なハッシュ関数であるダブルパイプハッシュ関数(double pipeハッシュ関数)についての記載がある。
Non-Patent
非特許文献1,2に記載されたジッパーハッシュ関数とダブルパイプハッシュ関数とは、一方向性が破られた理想的な圧縮関数を用い、ランダムオラクルと強識別不可能なハッシュ関数であるものの、計算効率が悪い。
この発明は、例えば、一方向性が破られた理想的な圧縮関数を用いて構成した場合であっても、ランダムオラクルと強識別不可能であるハッシュ関数であって、ジッパーハッシュ関数やダブルパイプハッシュ関数よりも計算効率がよいハッシュ関数を構成することを目的とする。
Although the zipper hash function and the double pipe hash function described in
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.
まず、ハッシュ関数の安全性の概念について説明する。 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
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. (
4). (
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
また、以下の実施の形態において、一方向性が破られた理想的な圧縮関数(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
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
まず、実施の形態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
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
なお、以下の実施の形態において、圧縮関数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
実施の形態1.
実施の形態1では、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
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
図1は、実施の形態1に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図2は、図1に示すハッシュ値演算装置10の動作を示すフローチャートである。
図3は、図1に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 1 is a functional block diagram illustrating functions of the hash
FIG. 2 is a flowchart showing the operation of the hash
FIG. 3 is a structural diagram of a hash function realized by the hash
図1に示すハッシュ値演算装置10の機能と動作について説明する。
図1に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14を備える。
The function and operation of the hash
The hash
(S101:既定長値入力ステップ)
既定長値入力部11は、m−nビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S101: Default length input step)
The predetermined length
(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
That is, the fixed
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
(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
That is, first, the compression
Next, the compression
By repeating this, finally, the compression
(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
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
なお、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
Next, the hash
Then, the hash
上記説明では、(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
Next, when a value having an arbitrary bit length is input, i values p [1],. . . The hash
図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
FIG. 5 is a flowchart showing the operation of the hash
FIG. 6 is a structural diagram of a hash function realized by the hash
図4に示すハッシュ値演算装置10の機能と動作について説明する。
図4に示すハッシュ値演算装置10は、図1に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash
The hash
(S111:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S111: arbitrary length value input step)
The arbitrary length
(S112:パディングステップ)
パディング部16は、(S111)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−nビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S112: Padding step)
The
(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
(S114:既定長値入力ステップ)
既定長値入力部11は、(S113)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S114: predetermined length input step)
The predetermined length
(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
In (S112), the
That is, the
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
FIG. 8 is a structural diagram of a hash function realized by the hash
(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
In (S112), the
In (S113), the dividing
In (S114), the predetermined
In (S115), the fixed
In (S116), the compression
In (S117), the compression
In (S118), the compression
In (S119), the
実施の形態1に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。
The hash function configured by the hash
なお、必ずしも上述した処理順序通りに計算する必要はなく、ストリーム処理ができる場合には、ストリーム処理で計算してもよい。なお、ストリーム処理とは、入力された先頭のビットから到着順に処理を行う方法であり、並列処理の一類型である。 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
また、圧縮関数計算部13が値c[1],...,値c[i]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。
In addition, the compression
つまり、実施の形態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
The hash value
また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、長さがm−nの倍数の値を出力する任意のパディング処理装置を用いて、m−nビットの倍数となるメッセージM’を生成する。そして、分割処理装置を用いてM’をi個のm−nビットの値p[1],...,p[i]に分割することを特徴とする。
In addition, the hash
さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。
Further, the hash
また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。
Further, the hash
実施の形態2.
実施の形態2では、実施の形態1とは異なるハッシュ関数であって、一方向性が破られた理想的な圧縮関数(WFILRO))を用いて構成した場合であっても、ランダムオラクルといわゆる強識別不可能である新たなハッシュ関数を構成するハッシュ値演算装置10について説明する。
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
図9は、実施の形態2に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図10は、図9に示すハッシュ値演算装置10の動作を示すフローチャートである。
図11は、図9に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 9 is a functional block diagram illustrating functions of the hash
FIG. 10 is a flowchart showing the operation of the hash
FIG. 11 is a structural diagram of a hash function realized by the hash
図9に示すハッシュ値演算装置10の機能と動作について説明する。
図9に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18を備える。
The function and operation of the hash
The hash
(S201:既定長値入力ステップ)
既定長値入力部11は、m−sビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S201: Default length input step)
The predetermined length
(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
(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
That is, the fixed
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
(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
That is, first, the compression
Next, the compression
By repeating this, the compression
(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
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
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
なお、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
Further, the hash
Next, the hash
Next, the hash
Then, the hash
上記説明では、(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
Next, when an arbitrary bit length value is input, i values p [1],. . . The hash
図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
FIG. 13 is a flowchart showing the operation of the hash
FIG. 14 is a structural diagram of a hash function realized by the hash
図12に示すハッシュ値演算装置10の機能と動作について説明する。
図12に示すハッシュ値演算装置10は、図9に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash
The hash
(S211:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S211: Arbitrary length value input step)
The arbitrary length
(S212:パディングステップ)
パディング部16は、(S211)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−sビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S212: Padding step)
The
(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
(S214:既定長値入力ステップ)
既定長値入力部11は、(S213)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S214: predetermined length value input step)
The predetermined length
(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
In (S212), the
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
In (S212), the
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
FIG. 17 is a structural diagram of a hash function realized by the hash
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
In (S212), the
In (S213), the dividing
In (S214), the predetermined length
In (S215), the exclusive OR
In (S216), the fixed
In (S217), the compression
In (S218), the compression
In (S219), the compression
In (S220), the compression
In (S221), the
実施の形態2に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。
The hash function configured by the hash
なお、実施の形態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
Similarly, the exclusive OR
また、圧縮関数計算部13が値c[1],...,値c[i+2]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。
In addition, the compression
つまり、実施の形態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
The hash value
また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−sビットの値を出力する任意のパディング処理装置を用いて、m−sビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−sビットの値p[1],...,p[i]に分割することを特徴とする。
Further, the hash
さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。
Further, the hash
また、さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0とし、s=56とすることを特徴とする。
Further, the hash
また、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。
Further, the hash
実施の形態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
図18は、実施の形態3に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図19は、図18に示すハッシュ値演算装置10の動作を示すフローチャートである。
図20は、図18に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 18 is a functional block diagram illustrating functions of the hash
FIG. 19 is a flowchart showing the operation of the hash
FIG. 20 is a structural diagram of a hash function realized by the hash
図18に示すハッシュ値演算装置10の機能と動作について説明する。
図18に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18を備える。
The function and operation of the hash
The hash
(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
(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
(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
That is, the fixed
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
(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
That is, first, the compression
Next, the compression
By repeating this, finally, the compression
(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
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
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
なお、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
Further, the hash
Next, the hash
Next, the hash
Then, the hash
上記説明では、(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
Next, when an arbitrary bit length value is input, i values p [1],. . . , A value p [i] and a hash
図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
FIG. 22 is a flowchart showing the operation of the hash
FIG. 23 is a structural diagram of a hash function realized by the hash
図21に示すハッシュ値演算装置10の機能と動作について説明する。
図21に示すハッシュ値演算装置10は、図18に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash
The hash
(S311:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S311: Arbitrary length input step)
The arbitrary length
(S312:パディングステップ)
パディング部16は、(S311)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加して((m−s)×i+(m−n))ビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S312: Padding step)
The
(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
(S314:既定長値入力ステップ)
既定長値入力部11は、(S313)で生成された値p[1],...,値p[i]と、値p[i+1]とを入力装置により入力する。
(S314: Default length input step)
The predetermined length
(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
In (S312), the
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
FIG. 25 is a structural diagram of a hash function realized by the hash
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
In (S312), the
In (S313), the dividing
In (S314), the predetermined
In (S315), the exclusive OR
In (S316), the fixed
In (S317), the compression
In (S <b> 318), the compression
In (S319), the compression
In (S320), the compression
In (S321), the
実施の形態3に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。
The hash function configured by the hash
なお、実施の形態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
Similarly, the exclusive OR
また、圧縮関数計算部13が値c[1],...,値c[i+2]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。
In addition, the compression
つまり、実施の形態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
The hash value
また、ハッシュ値演算装置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
さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0…0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。
Further, the hash
また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。
Further, the hash
実施の形態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
図26は、実施の形態4に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図27は、図26に示すハッシュ値演算装置10の動作を示すフローチャートである。
図28は、図26に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 26 is a functional block diagram illustrating functions of the hash
FIG. 27 is a flowchart showing the operation of the hash
FIG. 28 is a structural diagram of a hash function realized by the hash
図26に示すハッシュ値演算装置10の機能と動作について説明する。
図26に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、置換関数計算部19を備える。
The function and operation of the hash
The hash
(S401:既定長値入力ステップ)
既定長値入力部11は、m−nビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S401: Default length input step)
The predetermined length
(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
That is, the fixed
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
(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
That is, first, the compression
Next, the compression
By repeating this, finally, the compression
(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
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
(S407:出力ステップ)
出力部14は、(S406)で計算された値c[i]を出力装置により出力する。
(S407: output step)
The
なお、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
Next, the hash
Then, the hash
上記説明では、(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
Next, when a value having an arbitrary bit length is input, i values p [1],. . . The hash
図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
FIG. 30 is a flowchart showing the operation of the hash
FIG. 31 is a structural diagram of a hash function realized by the hash
図29に示すハッシュ値演算装置10の機能と動作について説明する。
図29に示すハッシュ値演算装置10は、図1に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash
The hash
(S411:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S411: Arbitrary length value input step)
The arbitrary length
(S412:パディングステップ)
パディング部16は、(S411)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−nビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S412: Padding step)
The
(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
(S414:既定長値入力ステップ)
既定長値入力部11は、(S413)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S414: Default length input step)
The predetermined length
(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
In (S412), the
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
FIG. 33 is a structural diagram of a hash function realized by the hash
(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
In (S412), the
In (S413), the dividing
In (S414), the predetermined length
In (S415), the fixed
In (S416), the compression
In (S417), the compression
In (S418), the permutation
In (S419), the compression
In (S420), the
実施の形態4に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが準一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。
The hash function configured by the hash
なお、実施の形態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
Similarly, the replacement
また、圧縮関数計算部13が値c[1],...,値c[i]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。
In addition, the compression
つまり、実施の形態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
The hash value
また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−nビットの値を出力する任意のパディング処理装置を用いて、m−nビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−nビットの値p[1],...,p[i]に分割することを特徴とする。
In addition, the hash
さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。
Further, the hash
また、さらに、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。
Further, the hash
実施の形態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
図34は、実施の形態5に係るハッシュ値演算装置10の機能を示す機能ブロック図である。
図35は、図34に示すハッシュ値演算装置10の動作を示すフローチャートである。
図36は、図34に示すハッシュ値演算装置10により実現されるハッシュ関数の構造図である。
FIG. 34 is a functional block diagram illustrating functions of the hash
FIG. 35 is a flowchart showing the operation of the hash
FIG. 36 is a structural diagram of a hash function realized by the hash
図34に示すハッシュ値演算装置10の機能と動作について説明する。
図34に示すハッシュ値演算装置10は、既定長値入力部11、固定値付加部12、圧縮関数計算部13、出力部14、排他的論理和計算部18、置換関数計算部19を備える。
The function and operation of the hash
The hash
(S501:既定長値入力ステップ)
既定長値入力部11は、m−sビット長のi個の値p[1],...,値p[i]を入力装置により入力して記憶装置に記憶する。
(S501: Default length input step)
The predetermined length
(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
(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
That is, the fixed
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
(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
That is, first, the compression
Next, the compression
By repeating this, finally, the compression
(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
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
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
なお、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
Further, the hash
Next, the hash
Then, the hash
上記説明では、(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
Next, when an arbitrary bit length value is input, i values p [1],. . . The hash
図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
FIG. 38 is a flowchart showing the operation of the hash
FIG. 39 is a structural diagram of a hash function realized by the hash
図37に示すハッシュ値演算装置10の機能と動作について説明する。
図37に示すハッシュ値演算装置10は、図34に示すハッシュ値演算装置10が備える機能に加え、任意長値入力部15、パディング部16、分割部17を備える。
The function and operation of the hash
The hash
(S511:任意長値入力ステップ)
任意長値入力部15は、任意ビット長の値Mを入力装置により入力する。
(S511: Arbitrary length value input step)
The arbitrary length
(S512:パディングステップ)
パディング部16は、(S511)で入力された値Mに対して、パディング関数padを用いて、所定の値を付加してm−sビット長のi倍のビット長の値M’を処理装置により生成して記憶装置に記憶する。つまり、パディング部16は、M’=pad(M)を処理装置により計算して値M’を得る。
(S512: Padding step)
The
(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
(S514:既定長値入力ステップ)
既定長値入力部11は、(S513)で生成された値p[1],...,値p[i]を入力装置により入力する。
(S514: Default length input step)
The predetermined length
(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
In (S512), the
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
In (S512), the
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
FIG. 42 is a structural diagram of a hash function realized by the hash
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
In (S512), the
In (S513), the dividing
In (S514), the predetermined length
In (S515), the exclusive OR
In (S516), the fixed
In (S517), the compression
In (S518), the compression
In (S519), the permutation
In (S520), the compression
In (S521), the
実施の形態5に係るハッシュ値演算装置10により構成されたハッシュ関数は、圧縮関数hが準一方向性が破られた理想的な圧縮関数の場合であっても、ランダムオラクルと強識別不可能性を満たすハッシュ関数となる。
The hash function configured by the hash
なお、実施の形態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
Similarly, the exclusive OR
また、圧縮関数計算部13が値c[1],...,値c[i+1]を計算するのに用いる圧縮関数hは、同一の圧縮関数hであってもよいし、それぞれ異なる圧縮関数hであってもよい。
In addition, the compression
つまり、実施の形態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
The hash value
また、ハッシュ値演算装置10は、任意長の値Mから、任意長の値を入力とし、m−sビットの値を出力する任意のパディング処理装置を用いて、m−sビットの倍数となるメッセージM’を生成する。分割処理装置を用いてM’をi個のm−sビットの値p[1],...,p[i]に分割することを特徴とする。
Further, the hash
さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0||<M>とし、s=56とすることを特徴とする。但し、<M>はMのビット長を64ビットで表したものである。
Further, the hash
また、さらに、ハッシュ値演算装置10は、パディング処理装置を、M||1||0...0とし、s=56とすることを特徴とする。
Further, the hash
また、ハッシュ値演算装置10は、圧縮関数演算装置として、SHA−256の圧縮関数演算装置を用いたことを特徴とする。
Further, the hash
すなわち、以上の実施の形態に係るハッシュ値演算装置10は、EMD構造、MDP構造、圧縮関数に固定値を入力する操作、圧縮関数に圧縮関数番号を入力する操作、メッセージの排他的論理輪値を圧縮関数の入力とする操作を利用してハッシュ関数を構成する。これにより、一方向性が破られた圧縮関数または準一方向性が破られた圧縮関数から、ランダムオラクルと強識別不可能性を満たす、効率的なハッシュ関数を構成する。
In other words, the hash
なお、以上の実施の形態に係るハッシュ値演算装置10は、暗号処理(署名処理を含む)を行う暗号処理装置等において用いられるハッシュ値を計算するための装置である。
The hash
次に、実施の形態におけるハッシュ値演算装置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
FIG. 43 is a diagram illustrating an example of a hardware configuration of the hash
As shown in FIG. 43, the hash
ROM913、磁気ディスク装置920は、不揮発性メモリの一例である。RAM914は、揮発性メモリの一例である。ROM913とRAM914と磁気ディスク装置920とは、記憶装置の一例である。また、キーボード902、通信ボード915は、入力装置の一例である。また、通信ボード915は、通信装置(ネットワークインタフェース)の一例である。さらに、LCD901は、表示装置の一例である。
The
磁気ディスク装置920又はROM913などには、オペレーティングシステム921(OS)、ウィンドウシステム922、プログラム群923、ファイル群924が記憶されている。プログラム群923のプログラムは、CPU911、オペレーティングシステム921、ウィンドウシステム922により実行される。
An operating system 921 (OS), a
プログラム群923には、上記の説明において「既定長値入力部11」、「固定値付加部12」、「圧縮関数計算部13」、「出力部14」、「任意長値入力部15」、「パディング部16」、「分割部17」、「排他的論理和計算部18」、「置換関数計算部19」等として説明した機能を実行するソフトウェアやプログラムやその他のプログラムが記憶されている。プログラムは、CPU911により読み出され実行される。
ファイル群924には、上記の説明において固定値や途中計算結果等の情報やデータや信号値や変数値やパラメータが、「ファイル」や「データベース」の各項目として記憶される。「ファイル」や「データベース」は、ディスクやメモリなどの記録媒体に記憶される。ディスクやメモリなどの記憶媒体に記憶された情報やデータや信号値や変数値やパラメータは、読み書き回路を介してCPU911によりメインメモリやキャッシュメモリに読み出され、抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示などのCPU911の動作に用いられる。抽出・検索・参照・比較・演算・計算・処理・出力・印刷・表示のCPU911の動作の間、情報やデータや信号値や変数値やパラメータは、メインメモリやキャッシュメモリやバッファメモリに一時的に記憶される。
In the
In the
また、上記の説明におけるフローチャートの矢印の部分は主としてデータや信号の入出力を示し、データや信号値は、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
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
10 ハッシュ値演算装置、11 既定長値入力部、12 固定値付加部、13 圧縮関数計算部、14 出力部、15 任意長値入力部、16 パディング部、17 分割部、18 排他的論理和計算部、19 置換関数計算部。
DESCRIPTION OF
Claims (2)
前記既定長値入力部が入力した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]を入力する
ことを特徴とする請求項1に記載のハッシュ値演算装置。 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].
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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5621569B2 (en) | 2010-12-13 | 2014-11-12 | ソニー株式会社 | Imaging apparatus and shutter operation correction method |
CN118626052B (en) * | 2024-08-14 | 2024-10-22 | 山东芯安泓锦科技有限公司 | Efficient floating point number processing method for realizing deep learning on FPGA |
-
2009
- 2009-05-26 JP JP2009125976A patent/JP5398353B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010276629A (en) | 2010-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
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 | |
US10284368B2 (en) | Secure key storage | |
JP6144992B2 (en) | Searchable cryptographic processing system and method | |
JP5710460B2 (en) | Encryption key generation apparatus and program | |
CN103166751A (en) | Method and apparatus for protecting block ciphers from template attacks | |
CN109993008A (en) | Methods and arrangements for implicit integrity | |
US10536264B2 (en) | Efficient cryptographically secure control flow integrity protection | |
US10326589B2 (en) | Message authenticator generating apparatus, message authenticator generating method, and computer readable recording medium | |
CN106792686B (en) | A kind of RFID two-way authentication method | |
CN114154174A (en) | State synchronization for post-quantum signature facilities | |
WO2020219398A1 (en) | Efficient side-channel-attack-resistant memory encryptor based on key update | |
CN111008407A (en) | Encryption circuit for performing virtual cryptographic operations | |
JP6735926B2 (en) | Encryption device, decryption device, encryption method, decryption method, encryption program, and decryption program | |
JP6040780B2 (en) | Cryptographic processing apparatus, method and program | |
CN107534549B (en) | Readable storage medium, method and system for encrypting data stream block | |
US9049004B2 (en) | Low-power encryption apparatus and method | |
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 | |
JPWO2016063512A1 (en) | MAC tag list generation device, MAC tag list verification device, MAC tag list generation method, MAC tag list verification method, and program recording medium | |
CN114826562B (en) | Data encryption method, device, electronic device and storage medium | |
US20220398339A1 (en) | Protection of stored and communicated secret data against side-channel attacks | |
US11177936B2 (en) | Message authenticator generation apparatus | |
JP6033504B1 (en) | Message authenticator generator | |
WO2011155039A1 (en) | Message authentication code calculation device, message authentication code calculation method, and message authentication code calculation program |
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 |