NIST FIPS 180-4 日本語訳
英語タイトル : Secure Hash Standard (SHS)日本語タイトル : セキュアハッシュ標準(SHS)
公開日 : 2015-08-04
原文URL : https://csrc.nist.gov/pubs/fips/180-4/upd1/final
翻訳編集 : 自動生成(有志による非公式の日本語訳), 原文取得日 : 2026-10-25, 訳文 : 395 / 396 ブロック
[要約] FIPS 180-4 は、メッセージのダイジェストを生成するために使用できるハッシュアルゴリズム(SHA-1 および SHA-2 系列)を規定する連邦情報処理標準です。ダイジェストは、生成後にメッセージが変更されたかどうかを検出するために使われ、本標準は定義、表記、関数と定数、前処理、各アルゴリズム、メッセージダイジェストの切り詰めを章立てで扱います。付録で FIPS 180-3 からの技術的変更点を示しており、2002年連邦情報セキュリティマネジメント法(FISMA)に基づき採択・公布される標準の出版物シリーズに属します。
FIPS PUB 180-4
FIPS PUB 180-4
FEDERAL INFORMATION PROCESSING STANDARDS PUBLICATION
連邦情報処理標準規格出版物
Secure Hash Standard (SHS)
セキュアハッシュ標準(SHS)
CATEGORY: COMPUTER SECURITY SUBCATEGORY: CRYPTOGRAPHY
カテゴリ:コンピュータセキュリティ サブカテゴリ:暗号
Information Technology Laboratory National Institute of Standards and Technology Gaithersburg, MD 20899-8900
情報技術研究所(Information Technology Laboratory) 米国国立標準技術研究所 Gaithersburg, MD 20899-8900
This publication is available free of charge from: http://dx.doi.org/10.6028/NIST.FIPS.180-4
本出版物は次から無償で入手できる:http://dx.doi.org/10.6028/NIST.FIPS.180-4
August 2015
2015年8月
[米国商務省の紋章。公的な標章のため、この非公式サイトには掲載していません。原本 PDF を参照してください。]
U.S. Department of Commerce Penny Pritzker, Secretary
米国商務省 長官 Penny Pritzker
National Institute of Standards and Technology Willie E. May, Under Secretary for Standards and Technology and Director
米国国立標準技術研究所 標準技術担当次官兼所長 Willie E. May
FOREWORD
序文
The Federal Information Processing Standards Publication Series of the National Institute of Standards and Technology (NIST) is the official series of publications relating to standards and guidelines adopted and promulgated under the provisions of the Federal Information Security Management Act (FISMA) of 2002.
米国国立標準技術研究所(NIST)の連邦情報処理標準規格出版物シリーズは、2002年連邦情報セキュリティマネジメント法(FISMA)の規定に基づいて採択・公布される標準およびガイドラインに関する公式の出版物シリーズです。
Comments concerning FIPS publications are welcomed and should be addressed to the Director, Information Technology Laboratory, National Institute of Standards and Technology, 100 Bureau Drive, Stop 8900, Gaithersburg, MD 20899-8900.
FIPS 出版物に関するコメントを歓迎します。コメントは Director, Information Technology Laboratory, National Institute of Standards and Technology, 100 Bureau Drive, Stop 8900, Gaithersburg, MD 20899-8900 宛てに送付されました。
Charles H. Romine, Director Information Technology Laboratory
情報技術研究所 所長 Charles H. Romine
Abstract
要旨
This standard specifies hash algorithms that can be used to generate digests of messages. The digests are used to detect whether messages have been changed since the digests were generated.
本標準は、メッセージのダイジェストの生成に使用できるハッシュアルゴリズムを規定します。ダイジェストは、ダイジェストの生成後にメッセージが変更されたかどうかを検出するために使用されます。
Key words: computer security, cryptography, message digest, hash function, hash algorithm, Federal Information Processing Standards, Secure Hash Standard.
キーワード:コンピュータセキュリティ、暗号、メッセージダイジェスト、ハッシュ関数、ハッシュアルゴリズム、連邦情報処理標準規格、Secure Hash Standard。
Federal Information Processing Standards Publication 180-4
連邦情報処理標準規格出版物 180-4
August 2015
2015年8月
Announcing the
以下を公表する
SECURE HASH STANDARD
SECURE HASH STANDARD
Federal Information Processing Standards Publications (FIPS PUBS) are issued by the National Institute of Standards and Technology (NIST) after approval by the Secretary of Commerce pursuant to Section 5131 of the Information Technology Management Reform Act of 1996 (Public Law 104-106), and the Computer Security Act of 1987 (Public Law 100-235).
連邦情報処理標準規格出版物(FIPS PUBS)は、1996年情報技術管理改革法(Public Law 104-106)第5131条および1987年コンピュータセキュリティ法(Public Law 100-235)に基づき、商務長官の承認を経て米国国立標準技術研究所(NIST)が発行します。
1.Name of Standard: Secure Hash Standard (SHS) (FIPS PUB 180-4).
1.標準の名称:Secure Hash Standard (SHS)(FIPS PUB 180-4)。
2.Category of Standard: Computer Security Standard, Cryptography.
2.標準のカテゴリ:コンピュータセキュリティ標準、暗号。
3.Explanation: This Standard specifies secure hash algorithms - SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 - for computing a condensed representation of electronic data (message). When a message of any length less than \(2^{64}\) bits (for SHA-1, SHA-224 and SHA-256) or less than \(2^{128}\) bits (for SHA-384, SHA-512, SHA-512/224 and SHA-512/256) is input to a hash algorithm, the result is an output called a message digest. The message digests range in length from 160 to 512 bits, depending on the algorithm. Secure hash algorithms are typically used with other cryptographic algorithms, such as digital signature algorithms and keyed-hash message authentication codes, or in the generation of random numbers (bits).
3.説明:本標準は、電子データ(メッセージ)の圧縮された表現を計算するためのセキュアハッシュアルゴリズム SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 を規定します。長さが \(2^{64}\) ビット未満(SHA-1、SHA-224 および SHA-256 の場合)または \(2^{128}\) ビット未満(SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の場合)の任意の長さのメッセージをハッシュアルゴリズムに入力すると、その結果としてメッセージダイジェストと呼ばれる出力が得られます。メッセージダイジェストの長さはアルゴリズムに応じて160ビットから512ビットまでです。セキュアハッシュアルゴリズムは通常、デジタル署名アルゴリズムや鍵付きハッシュメッセージ認証コードなどの他の暗号アルゴリズムとともに、または乱数(ビット)の生成において使用されます。
The hash algorithms specified in this Standard are called secure because, for a given algorithm, it is computationally infeasible 1) to find a message that corresponds to a given message digest, or 2) to find two different messages that produce the same message digest. Any change to a message will, with a very high probability, result in a different message digest. This will result in a verification failure when the secure hash algorithm is used with a digital signature algorithm or a keyed-hash message authentication algorithm.
本標準で規定するハッシュアルゴリズムがセキュアと呼ばれるのは、あるアルゴリズムについて、1) 与えられたメッセージダイジェストに対応するメッセージを見つけること、または 2) 同じメッセージダイジェストを生成する2つの異なるメッセージを見つけることが、計算量的に実行不可能だからです。メッセージにいかなる変更を加えても、非常に高い確率で異なるメッセージダイジェストが得られます。このため、セキュアハッシュアルゴリズムをデジタル署名アルゴリズムまたは鍵付きハッシュメッセージ認証アルゴリズムとともに使用した場合、検証は失敗します。
This Standard supersedes FIPS 180-3 [FIPS 180-3].
本標準は FIPS 180-3 [FIPS 180-3] に置き換わります。
4.Approving Authority: Secretary of Commerce.
4.承認機関:商務長官。
5.Maintenance Agency: U.S. Department of Commerce, National Institute of Standards and Technology (NIST), Information Technology Laboratory (ITL).
5.維持管理機関:米国商務省、米国国立標準技術研究所(NIST)、情報技術研究所(ITL)。
6.Applicability: This Standard is applicable to all Federal departments and agencies for the protection of sensitive unclassified information that is not subject to Title 10 United States Code Section 2315 (10 USC 2315) and that is not within a national security system as defined in Title 40 United States Code Section 11103(a)(1) (40 USC 11103(a)(1)). Either this Standard or Federal Information Processing Standard (FIPS) 202 must be implemented wherever a secure hash algorithm is required for Federal applications, including as a component within other cryptographic algorithms and protocols. This Standard may be adopted and used by non-Federal Government organizations.
6.適用範囲:本標準は、合衆国法典第10編第2315条(10 USC 2315)の対象とならず、かつ合衆国法典第40編第11103条(a)(1)(40 USC 11103(a)(1))に定義される国家安全保障システムに含まれない、機密扱いではないセンシティブな情報を保護するために、すべての連邦省庁に適用されます。連邦のアプリケーションにおいてセキュアハッシュアルゴリズムが必要とされる場合には、他の暗号アルゴリズムやプロトコルの構成要素として使用する場合も含め、本標準または連邦情報処理標準規格(FIPS)202 のいずれかを実装しなければなりません。本標準は、連邦政府以外の組織が採用し使用してもよいです。
7.Specifications: Federal Information Processing Standard (FIPS) 180-4, Secure Hash Standard (SHS) (affixed).
7.仕様:連邦情報処理標準規格(FIPS)180-4、Secure Hash Standard (SHS)(添付)。
8.Implementations: The secure hash algorithms specified herein may be implemented in software, firmware, hardware or any combination thereof. Only algorithm implementations that are validated by NIST will be considered as complying with this standard. Information about the validation program can be obtained at http://csrc.nist.gov/groups/STM/index.html.
8.実装:本標準で規定するセキュアハッシュアルゴリズムは、ソフトウェア、ファームウェア、ハードウェア、またはそれらの任意の組み合わせで実装してもよいです。NIST によって検証されたアルゴリズム実装のみが本標準に適合するものとみなされます。検証プログラムに関する情報は http://csrc.nist.gov/groups/STM/index.html で入手できます。
9.Implementation Schedule: Guidance regarding the testing and validation to FIPS 180-4 and its relationship to FIPS 140-2 can be found in IG 1.10 of the Implementation Guidance for FIPS PUB 140-2 and the Cryptographic Module Validation Program at http://csrc.nist.gov/groups/STM/cmvp/index.html.
9.実施スケジュール:FIPS 180-4 に対する試験と検証、および FIPS 140-2 との関係に関するガイダンスは、Implementation Guidance for FIPS PUB 140-2 and the Cryptographic Module Validation Program の IG 1.10 に記載されています(http://csrc.nist.gov/groups/STM/cmvp/index.html)。
10.Patents: Implementations of the secure hash algorithms in this standard may be covered by U.S. or foreign patents.
10.特許:本標準のセキュアハッシュアルゴリズムの実装は、米国または外国の特許の対象となる場合があります。
11.Export Control: Certain cryptographic devices and technical data regarding them are subject to Federal export controls. Exports of cryptographic modules implementing this standard and technical data regarding them must comply with these Federal regulations and be licensed by the Bureau of Export Administration of the U.S. Department of Commerce. Information about export regulations is available at: http://www.bis.doc.gov/index.htm.
11.輸出管理:特定の暗号装置およびそれに関する技術データは、連邦の輸出管理の対象となります。本標準を実装する暗号モジュールおよびそれに関する技術データの輸出は、これらの連邦規則に従わなければならず、米国商務省輸出管理局(Bureau of Export Administration)の許可を受けなければなりません。輸出規制に関する情報は http://www.bis.doc.gov/index.htm で入手できます。
12.Qualifications: While it is the intent of this Standard to specify general security requirements for generating a message digest, conformance to this Standard does not assure that a particular implementation is secure. The responsible authority in each agency or department shall assure that an overall implementation provides an acceptable level of security. This Standard will be reviewed every five years in order to assess its adequacy.
12.留意事項:本標準はメッセージダイジェストの生成に関する一般的なセキュリティ要件を規定することを意図していますが、本標準に適合していても特定の実装が安全であることは保証されません。各省庁の責任当局は、実装全体が許容可能なレベルのセキュリティを提供することを保証しなければなりません。本標準は、その妥当性を評価するために5年ごとに見直されます。
13.Waiver Procedure: The Federal Information Security Management Act (FISMA) does not allow for waivers to a FIPS that is made mandatory by the Secretary of Commerce.
13.適用除外手続:連邦情報セキュリティマネジメント法(FISMA)は、商務長官が義務化した FIPS の適用除外を認めていません。
14.Where to Obtain Copies of the Standard: This publication is available electronically by accessing http://csrc.nist.gov/publications/. Other computer security publications are available at the same web site.
14.本標準の入手先:本出版物は http://csrc.nist.gov/publications/ から電子的に入手できます。その他のコンピュータセキュリティ関連の出版物も同じウェブサイトで入手できます。
Federal Information Processing Standards Publication 180-4
連邦情報処理標準規格出版物 180-4
Specifications for the
以下の仕様
SECURE HASH STANDARD
SECURE HASH STANDARD
1. INTRODUCTION — 3
1. はじめに — 3
2. DEFINITIONS — 4
2. 定義 — 4
Table of Contents
目次
1. INTRODUCTION
1. はじめに
This Standard specifies secure hash algorithms, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256. All of the algorithms are iterative, one-way hash functions that can process a message to produce a condensed representation called a message digest. These algorithms enable the determination of a message’s integrity: any change to the message will, with a very high probability, result in a different message digest. This property is useful in the generation and verification of digital signatures and message authentication codes, and in the generation of random numbers or bits.
本標準は、セキュアハッシュアルゴリズム SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 を規定します。これらのアルゴリズムはすべて反復型の一方向ハッシュ関数であり、メッセージを処理して、メッセージダイジェストと呼ばれる圧縮された表現を生成できます。これらのアルゴリズムにより、メッセージの完全性を判定できます。すなわち、メッセージにいかなる変更を加えても、非常に高い確率で異なるメッセージダイジェストが得られます。この性質は、デジタル署名およびメッセージ認証コードの生成と検証、ならびに乱数またはランダムビットの生成において有用です。
Each algorithm can be described in two stages: preprocessing and hash computation. Preprocessing involves padding a message, parsing the padded message into m-bit blocks, and setting initialization values to be used in the hash computation. The hash computation generates a message schedule from the padded message and uses that schedule, along with functions, constants, and word operations to iteratively generate a series of hash values. The final hash value generated by the hash computation is used to determine the message digest.
各アルゴリズムは、前処理とハッシュ計算の2段階で記述できます。前処理では、メッセージのパディング、パディング済みメッセージの m ビットブロックへの解析、およびハッシュ計算で使用する初期値の設定を行います。ハッシュ計算では、パディング済みメッセージからメッセージスケジュールを生成し、そのスケジュールを関数、定数、ワード演算とともに用いて、一連のハッシュ値を反復的に生成します。ハッシュ計算によって生成された最終ハッシュ値を用いてメッセージダイジェストが決定されます。
The algorithms differ most significantly in the security strengths that are provided for the data being hashed. The security strengths of these hash functions and the system as a whole when each of them is used with other cryptographic algorithms, such as digital signature algorithms and keyed-hash message authentication codes, can be found in [SP 800-57] and [SP 800-107].
これらのアルゴリズムの最も大きな違いは、ハッシュ対象のデータに対して提供されるセキュリティ強度にあります。これらのハッシュ関数のセキュリティ強度、および各ハッシュ関数をデジタル署名アルゴリズムや鍵付きハッシュメッセージ認証コードなどの他の暗号アルゴリズムとともに使用した場合のシステム全体のセキュリティ強度は、[SP 800-57] および [SP 800-107] に記載されています。
Additionally, the algorithms differ in terms of the size of the blocks and words of data that are used during hashing or message digest sizes. Figure 1 presents the basic properties of these hash algorithms.
さらに、これらのアルゴリズムは、ハッシュ処理中に使用されるデータのブロックおよびワードのサイズ、またはメッセージダイジェストのサイズの点でも異なります。図1に、これらのハッシュアルゴリズムの基本的な特性を示します。
| Algorithm | Message Size (bits) | Block Size (bits) | Word Size (bits) | Message Digest Size (bits) |
|---|---|---|---|---|
| SHA-1 | \(< 2^{64}\) | 512 | 32 | 160 |
| SHA-224 | \(< 2^{64}\) | 512 | 32 | 224 |
| SHA-256 | \(< 2^{64}\) | 512 | 32 | 256 |
| SHA-384 | \(< 2^{128}\) | 1024 | 64 | 384 |
| SHA-512 | \(< 2^{128}\) | 1024 | 64 | 512 |
| SHA-512/224 | \(< 2^{128}\) | 1024 | 64 | 224 |
| SHA-512/256 | \(< 2^{128}\) | 1024 | 64 | 256 |
| アルゴリズム | メッセージサイズ(ビット) | ブロックサイズ(ビット) | ワードサイズ(ビット) | メッセージダイジェストサイズ(ビット) |
|---|---|---|---|---|
| SHA-1 | \(< 2^{64}\) | 512 | 32 | 160 |
| SHA-224 | \(< 2^{64}\) | 512 | 32 | 224 |
| SHA-256 | \(< 2^{64}\) | 512 | 32 | 256 |
| SHA-384 | \(< 2^{128}\) | 1024 | 64 | 384 |
| SHA-512 | \(< 2^{128}\) | 1024 | 64 | 512 |
| SHA-512/224 | \(< 2^{128}\) | 1024 | 64 | 224 |
| SHA-512/256 | \(< 2^{128}\) | 1024 | 64 | 256 |
Figure 1: Secure Hash Algorithm Properties
図1:セキュアハッシュアルゴリズムの特性
2. DEFINITIONS
2. 定義
2.1 Glossary of Terms and Acronyms
2.1 用語および略語の解説
Bit — A binary digit having a value of 0 or 1.
Bit — 0または1の値をとる2進数字。
Byte — A group of eight bits.
Byte — 8ビットのまとまり。
FIPS — Federal Information Processing Standard.
FIPS — Federal Information Processing Standard(連邦情報処理標準規格)。
NIST — National Institute of Standards and Technology.
NIST — National Institute of Standards and Technology(米国国立標準技術研究所)。
SHA — Secure Hash Algorithm.
SHA — Secure Hash Algorithm(セキュアハッシュアルゴリズム)。
SP — Special Publication
SP — Special Publication
Word — A group of either 32 bits (4 bytes) or 64 bits (8 bytes), depending on the secure hash algorithm.
Word — セキュアハッシュアルゴリズムに応じて、32ビット(4バイト)または64ビット(8バイト)のまとまり。
2.2 Algorithm Parameters, Symbols, and Terms
2.2 アルゴリズムのパラメータ、記号、用語
2.2.1 Parameters
2.2.1 パラメータ
The following parameters are used in the secure hash algorithm specifications in this Standard.
本標準のセキュアハッシュアルゴリズムの仕様では、以下のパラメータを使用します。
\(a, b, c, \ldots, h\) — Working variables that are the \(w\)-bit words used in the computation of the hash values, \(H^{(i)}\).
\(a, b, c, \ldots, h\) — ハッシュ値 \(H^{(i)}\) の計算で使用される \(w\) ビットワードである作業変数。
\(H^{(i)}\) — The \(i^{\text{th}}\) hash value. \(H^{(0)}\) is the initial hash value; \(H^{(N)}\) is the final hash value and is used to determine the message digest.
\(H^{(i)}\) — \(i^{\text{th}}\) 番目のハッシュ値。\(H^{(0)}\) は初期ハッシュ値であり、\(H^{(N)}\) は最終ハッシュ値で、メッセージダイジェストの決定に使用されます。
\(H_j^{(i)}\) — The \(j^{\text{th}}\) word of the \(i^{\text{th}}\) hash value, where \(H_0^{(i)}\) is the left-most word of hash value \(i\).
\(H_j^{(i)}\) — \(i^{\text{th}}\) 番目のハッシュ値の \(j^{\text{th}}\) 番目のワード。\(H_0^{(i)}\) はハッシュ値 \(i\) の最も左のワードです。
\(K_t\) — Constant value to be used for the iteration \(t\) of the hash computation.
\(K_t\) — ハッシュ計算の反復 \(t\) で使用される定数値。
\(k\) — Number of zeroes appended to a message during the padding step.
\(k\) — パディングの段階でメッセージに付加される0の個数。
\(\ell\) — Length of the message, \(M\), in bits.
\(\ell\) — メッセージ \(M\) のビット長。
\(m\) — Number of bits in a message block, \(M^{(i)}\).
\(m\) — メッセージブロック \(M^{(i)}\) のビット数。
\(M\) — Message to be hashed.
\(M\) — ハッシュ対象のメッセージ。
\(M^{(i)}\) — Message block \(i\), with a size of \(m\) bits.
\(M^{(i)}\) — サイズ \(m\) ビットのメッセージブロック \(i\)。
\(M_j^{(i)}\) — The \(j^{\text{th}}\) word of the \(i^{\text{th}}\) message block, where \(M_0^{(i)}\) is the left-most word of message block \(i\).
\(M_j^{(i)}\) — \(i^{\text{th}}\) 番目のメッセージブロックの \(j^{\text{th}}\) 番目のワード。\(M_0^{(i)}\) はメッセージブロック \(i\) の最も左のワードです。
\(n\) — Number of bits to be rotated or shifted when a word is operated upon.
\(n\) — ワードを操作する際に回転またはシフトするビット数。
\(N\) — Number of blocks in the padded message.
\(N\) — パディング済みメッセージのブロック数。
\(T\) — Temporary \(w\)-bit word used in the hash computation.
\(T\) — ハッシュ計算で使用される一時的な \(w\) ビットワード。
\(w\) — Number of bits in a word.
\(w\) — 1ワードのビット数。
\(W_t\) — The \(t^{\text{th}}\) \(w\)-bit word of the message schedule.
\(W_t\) — メッセージスケジュールの \(t^{\text{th}}\) 番目の \(w\) ビットワード。
2.2.2 Symbols and Operations
2.2.2 記号と演算
The following symbols are used in the secure hash algorithm specifications; each operates on \(w\)-bit words.
セキュアハッシュアルゴリズムの仕様では、以下の記号を使用します。いずれも \(w\) ビットワードに対して作用します。
\(\wedge\) — Bitwise AND operation.
\(\wedge\) — ビット単位の AND 演算。
\(\vee\) — Bitwise OR (“inclusive-OR”) operation.
\(\vee\) — ビット単位の OR(「包含的論理和」)演算。
\(\oplus\) — Bitwise XOR (“exclusive-OR”) operation.
\(\oplus\) — ビット単位の XOR(「排他的論理和」)演算。
\(\neg\) — Bitwise complement operation.
\(\neg\) — ビット単位の補数演算。
\(+\) — Addition modulo \(2^w\).
\(+\) — \(2^w\) を法とする加算。
\(<<\) — Left-shift operation, where \(x << n\) is obtained by discarding the left-most \(n\) bits of the word \(x\) and then padding the result with \(n\) zeroes on the right.
\(<<\) — 左シフト演算。\(x << n\) は、ワード \(x\) の左端の \(n\) ビットを破棄し、その結果の右側に \(n\) 個の0をパディングして得られます。
\(>>\) — Right-shift operation, where \(x >> n\) is obtained by discarding the right-most \(n\) bits of the word \(x\) and then padding the result with \(n\) zeroes on the left.
\(>>\) — 右シフト演算。\(x >> n\) は、ワード \(x\) の右端の \(n\) ビットを破棄し、その結果の左側に \(n\) 個の0をパディングして得られます。
The following operations are used in the secure hash algorithm specifications:
セキュアハッシュアルゴリズムの仕様では、以下の演算を使用します。
\(\boldsymbol{ROTL}^{n}(\boldsymbol{x})\) — The rotate left (circular left shift) operation, where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by \(ROTL^{n}(x) = (x << n) \vee (x >> w - n)\).
\(\boldsymbol{ROTL}^{n}(\boldsymbol{x})\) — 左回転(循環左シフト)演算。\(x\) を \(w\) ビットワード、\(n\) を \(0 \le n < w\) を満たす整数として、\(ROTL^{n}(x) = (x << n) \vee (x >> w - n)\) で定義されます。
\(\boldsymbol{ROTR}^{n}(\boldsymbol{x})\) — The rotate right (circular right shift) operation, where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by \(ROTR^{n}(x) = (x >> n) \vee (x << w - n)\).
\(\boldsymbol{ROTR}^{n}(\boldsymbol{x})\) — 右回転(循環右シフト)演算。\(x\) を \(w\) ビットワード、\(n\) を \(0 \le n < w\) を満たす整数として、\(ROTR^{n}(x) = (x >> n) \vee (x << w - n)\) で定義されます。
\(\boldsymbol{SHR}^{n}(\boldsymbol{x})\) — The right shift operation, where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by \(SHR^{n}(x) = x >> n\).
\(\boldsymbol{SHR}^{n}(\boldsymbol{x})\) — 右シフト演算。\(x\) を \(w\) ビットワード、\(n\) を \(0 \le n < w\) を満たす整数として、\(SHR^{n}(x) = x >> n\) で定義されます。
3. NOTATION AND CONVENTIONS
3. 表記と規約
3.1 Bit Strings and Integers
3.1 ビット列と整数
The following terminology related to bit strings and integers will be used.
ビット列と整数に関して、以下の用語を使用します。
1.A hex digit is an element of the set {0, 1,…, 9, a,…, f}. A hex digit is the representation of a 4-bit string. For example, the hex digit “7” represents the 4-bit string “0111”, and the hex digit “a” represents the 4-bit string “1010”.
1.16進数字は、集合 {0, 1,…, 9, a,…, f} の要素です。16進数字は4ビット列の表現です。たとえば、16進数字「7」は4ビット列「0111」を表し、16進数字「a」は4ビット列「1010」を表します。
2.A word is a w-bit string that may be represented as a sequence of hex digits. To convert a word to hex digits, each 4-bit string is converted to its hex digit equivalent, as described in (1) above. For example, the 32-bit string
2.ワードは w ビットの列であり、16進数字の列として表現できます。ワードを16進数字に変換するには、上記 (1) で述べたとおり、各4ビット列を対応する16進数字に変換します。たとえば、32ビット列
1010 0001 0000 0011 1111 1110 0010 0011
1010 0001 0000 0011 1111 1110 0010 0011
can be expressed as “a103fe23”, and the 64-bit string
は「a103fe23」と表すことができ、64ビット列
1010 0001 0000 0011 1111 1110 0010 0011 0011 0010 1110 1111 0011 0000 0001 1010
1010 0001 0000 0011 1111 1110 0010 0011 0011 0010 1110 1111 0011 0000 0001 1010
can be expressed as “a103fe2332ef301a”.
は「a103fe2332ef301a」と表すことができます。
Throughout this specification, the “big-endian” convention is used when expressing both 32- and 64-bit words, so that within each word, the most significant bit is stored in the left-most bit position.
本仕様全体を通じて、32ビットワードと64ビットワードのいずれを表す場合にも「ビッグエンディアン」の規約を用います。すなわち、各ワード内では最上位ビットが最も左のビット位置に格納されます。
3.An integer may be represented as a word or pair of words. A word representation of the message length, \(\ell\), in bits, is required for the padding techniques of Sec. 5.1.
3.整数は、1つのワードまたはワードの対として表現できます。5.1節のパディング手法では、メッセージのビット長 \(\ell\) のワード表現が必要となります。
An integer between 0 and \(2^{32}-1\) inclusive may be represented as a 32-bit word. The least significant four bits of the integer are represented by the right-most hex digit of the word representation. For example, the integer \(291=2^8 + 2^5 + 2^1 + 2^0=256+32+2+1\) is represented by the hex word “00000123”.
0以上 \(2^{32}-1\) 以下の整数は、32ビットワードとして表現できます。整数の下位4ビットは、ワード表現の最も右の16進数字で表されます。たとえば、整数 \(291=2^8 + 2^5 + 2^1 + 2^0=256+32+2+1\) は16進ワード「00000123」で表されます。
The same holds true for an integer between 0 and \(2^{64}-1\) inclusive, which may be represented as a 64-bit word.
0以上 \(2^{64}-1\) 以下の整数についても同様であり、64ビットワードとして表現できます。
If \(Z\) is an integer, \(0 \le Z < 2^{64}\), then \(Z=2^{32}X + Y\), where \(0 \le X < 2^{32}\) and \(0 \le Y < 2^{32}\). Since \(X\) and \(Y\) can be represented as 32-bit words \(x\) and \(y\), respectively, the integer \(Z\) can be represented as the pair of words \((x, y)\). This property is used for SHA-1, SHA-224 and SHA-256.
\(Z\) が \(0 \le Z < 2^{64}\) を満たす整数であれば、\(Z=2^{32}X + Y\) です。ここで \(0 \le X < 2^{32}\) かつ \(0 \le Y < 2^{32}\) です。\(X\) と \(Y\) はそれぞれ32ビットワード \(x\) と \(y\) として表現できるので、整数 \(Z\) はワードの対 \((x, y)\) として表現できます。この性質は SHA-1、SHA-224 および SHA-256 で使用されます。
If \(Z\) is an integer, \(0 \le Z < 2^{128}\), then \(Z=2^{64}X + Y\), where \(0 \le X < 2^{64}\) and \(0 \le Y < 2^{64}\). Since \(X\) and \(Y\) can be represented as 64-bit words \(x\) and \(y\), respectively, the integer \(Z\) can be represented as the pair of words \((x, y)\). This property is used for SHA-384, SHA-512, SHA-512/224 and SHA-512/256.
\(Z\) が \(0 \le Z < 2^{128}\) を満たす整数であれば、\(Z=2^{64}X + Y\) です。ここで \(0 \le X < 2^{64}\) かつ \(0 \le Y < 2^{64}\) です。\(X\) と \(Y\) はそれぞれ64ビットワード \(x\) と \(y\) として表現できるので、整数 \(Z\) はワードの対 \((x, y)\) として表現できます。この性質は SHA-384、SHA-512、SHA-512/224 および SHA-512/256 で使用されます。
4.For the secure hash algorithms, the size of the message block - \(m\) bits - depends on the algorithm.
4.セキュアハッシュアルゴリズムでは、メッセージブロックのサイズ(\(m\) ビット)はアルゴリズムによって異なります。
a)For SHA-1, SHA-224 and SHA-256, each message block has 512 bits, which are represented as a sequence of sixteen 32-bit words.
a)SHA-1、SHA-224 および SHA-256 では、各メッセージブロックは512ビットであり、16個の32ビットワードの列として表されます。
b) For SHA-384, SHA-512, SHA-512/224 and SHA-512/256 each message block has 1024 bits, which are represented as a sequence of sixteen 64-bit words.
b) SHA-384、SHA-512、SHA-512/224 および SHA-512/256 では、各メッセージブロックは1024ビットであり、16個の64ビットワードの列として表されます。
3.2 Operations on Words
3.2 ワードに対する演算
The following operations are applied to \(w\)-bit words in all five secure hash algorithms. SHA-1, SHA-224 and SHA-256 operate on 32-bit words (\(w=32\)), and SHA-384, SHA-512, SHA-512/224 and SHA-512/256 operate on 64-bit words (\(w=64\)).
以下の演算は、5つのセキュアハッシュアルゴリズムすべてにおいて \(w\) ビットワードに適用されます。SHA-1、SHA-224 および SHA-256 は32ビットワード(\(w=32\))を、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 は64ビットワード(\(w=64\))を対象とします。
1.Bitwise logical word operations: \(\wedge\), \(\vee\), \(\oplus\), and \(\neg\) (see Sec. 2.2.2).
1.ビット単位の論理ワード演算:\(\wedge\)、\(\vee\)、\(\oplus\)、\(\neg\)(2.2.2節を参照してください)。
2.Addition modulo \(2^w\).
2.\(2^w\) を法とする加算。
The operation \(x + y\) is defined as follows. The words \(x\) and \(y\) represent integers \(X\) and \(Y\), where \(0 \le X < 2^w\) and \(0 \le Y < 2^w\). For positive integers \(U\) and \(V\), let \(U \bmod V\) be the remainder upon dividing \(U\) by \(V\). Compute
演算 \(x + y\) は次のように定義されます。ワード \(x\) と \(y\) は整数 \(X\) と \(Y\) を表し、\(0 \le X < 2^w\) かつ \(0 \le Y < 2^w\) です。正の整数 \(U\) と \(V\) について、\(U \bmod V\) を \(U\) を \(V\) で割った余りとします。次を計算します。
Then \(0 \le Z < 2^w\). Convert the integer \(Z\) to a word, \(z\), and define \(z=x + y\).
このとき \(0 \le Z < 2^w\) です。整数 \(Z\) をワード \(z\) に変換し、\(z=x + y\) と定義します。
3.The right shift operation \(\boldsymbol{SHR^n(x)}\), where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by
3.右シフト演算 \(\boldsymbol{SHR^n(x)}\) は、\(x\) を \(w\) ビットワード、\(n\) を \(0 \le n < w\) を満たす整数として、次のように定義されます。
This operation is used in the SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 algorithms.
この演算は、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の各アルゴリズムで使用されます。
4.The rotate right (circular right shift) operation \(\boldsymbol{ROTR^n(x)}\), where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by
4.右ローテート(巡回右シフト)演算 \(\boldsymbol{ROTR^n(x)}\)(\(x\) は \(w\) ビットのワード、\(n\) は \(0 \le n < w\) を満たす整数)は、次のように定義されます。
Thus, \(ROTR^{n}(x)\) is equivalent to a circular shift (rotation) of \(x\) by \(n\) positions to the right.
すなわち、\(ROTR^{n}(x)\) は、\(x\) を右に \(n\) 位置だけ巡回シフト(ローテート)することと等価です。
This operation is used by the SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 algorithms.
この演算は、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の各アルゴリズムで使用されます。
5.The rotate left (circular left shift) operation, \(\boldsymbol{ROTL^{n}(x)}\), where \(x\) is a \(w\)-bit word and \(n\) is an integer with \(0 \le n < w\), is defined by
5.左ローテート(巡回左シフト)演算 \(\boldsymbol{ROTL^{n}(x)}\)(\(x\) は \(w\) ビットのワード、\(n\) は \(0 \le n < w\) を満たす整数)は、次のように定義されます。
Thus, \(ROTL^{n}(x)\) is equivalent to a circular shift (rotation) of \(x\) by \(n\) positions to the left.
すなわち、\(ROTL^{n}(x)\) は、\(x\) を左に \(n\) 位置だけ巡回シフト(ローテート)することと等価です。
This operation is used only in the SHA-1 algorithm.
この演算は SHA-1 アルゴリズムでのみ使用されます。
6.Note the following equivalence relationships, where w is fixed in each relationship:
6.次の等価関係に注意すること。ここで、各関係において w は固定です。
4. FUNCTIONS AND CONSTANTS
4. 関数と定数
4.1 Functions
4.1 関数
This section defines the functions that are used by each of the algorithms. Although the SHA-224, SHA-256, SHA-384,SHA-512, SHA-512/224 and SHA-512/256 algorithms all use similar functions, their descriptions are separated into sections for SHA-224 and SHA-256 (Sec. 4.1.2) and for SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (Sec. 4.1.3), since the input and output for these functions are words of different sizes. Each of the algorithms include \(Ch(x, y, z)\) and \(Maj(x, y, z)\) functions; the exclusive-OR operation (\(\oplus\)) in these functions may be replaced by a bitwise OR operation (\(\lor\)) and produce identical results.
本節では、各アルゴリズムで使用される関数を定義します。SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の各アルゴリズムはいずれも類似の関数を使用しますが、これらの関数の入出力はサイズの異なるワードであるため、その記述は SHA-224 と SHA-256 の節(4.1.2 節)と、SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の節(4.1.3 節)に分けています。各アルゴリズムには \(Ch(x, y, z)\) 関数と \(Maj(x, y, z)\) 関数が含まれます。これらの関数における排他的論理和演算(\(\oplus\))は、ビットごとの論理和演算(\(\lor\))に置き換えても同一の結果が得られます。
4.1.1 SHA-1 Functions
4.1.1 SHA-1 の関数
SHA-1 uses a sequence of logical functions, \(f_0, f_1, \ldots, f_{79}\). Each function \(f_t\), where \(0 \le t \le 79\), operates on three 32-bit words, \(x\), \(y\), and \(z\), and produces a 32-bit word as output. The function \(f_t(x, y, z)\) is defined as follows:
SHA-1 は、一連の論理関数 \(f_0, f_1, \ldots, f_{79}\) を使用します。各関数 \(f_t\)(\(0 \le t \le 79\))は、3つの32ビットワード \(x\)、\(y\)、\(z\) に作用し、32ビットワードを出力として生成します。関数 \(f_t(x, y, z)\) は次のように定義されます。
4.1.2 SHA-224 and SHA-256 Functions
4.1.2 SHA-224 と SHA-256 の関数
SHA-224 and SHA-256 both use six logical functions, where each function operates on 32-bit words, which are represented as \(x\), \(y\), and \(z\). The result of each function is a new 32-bit word.
SHA-224 と SHA-256 はいずれも6つの論理関数を使用します。各関数は32ビットワードに作用し、それらのワードを \(x\)、\(y\)、\(z\) で表します。各関数の結果は新たな32ビットワードです。
4.1.3 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 Functions
4.1.3 SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の関数
SHA-384, SHA-512, SHA-512/224 and SHA-512/256 use six logical functions, where each function operates on 64-bit words, which are represented as x, y, and z. The result of each function is a new 64-bit word.
SHA-384、SHA-512、SHA-512/224 および SHA-512/256 は6つの論理関数を使用します。各関数は64ビットワードに作用し、それらのワードを x、y、z で表します。各関数の結果は新たな64ビットワードです。
4.2 Constants
4.2 定数
4.2.1 SHA-1 Constants
4.2.1 SHA-1 の定数
SHA-1 uses a sequence of eighty constant 32-bit words, \(K_0, K_1, \ldots, K_{79}\), which are given by
SHA-1 は、80個の32ビット定数ワードの列 \(K_0, K_1, \ldots, K_{79}\) を使用します。これらは次で与えられます。
4.2.2 SHA-224 and SHA-256 Constants
4.2.2 SHA-224 と SHA-256 の定数
SHA-224 and SHA-256 use the same sequence of sixty-four constant 32-bit words, \(K_0^{\{256\}}, K_1^{\{256\}}, \ldots, K_{63}^{\{256\}}\). These words represent the first thirty-two bits of the fractional parts of the cube roots of the first sixty-four prime numbers. In hex, these constant words are (from left to right)
SHA-224 と SHA-256 は、64個の32ビット定数ワードからなる同一の列 \(K_0^{\{256\}}, K_1^{\{256\}}, \ldots, K_{63}^{\{256\}}\) を使用します。これらのワードは、最初の64個の素数の立方根の小数部の先頭32ビットを表します。これらの定数ワードを16進数で示すと次のとおりです(左から右の順)。
428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2
428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2
4.2.3 SHA-384, SHA-512, SHA-512/224 and SHA-512/256 Constants
4.2.3 SHA-384、SHA-512、SHA-512/224 および SHA-512/256 の定数
SHA-384, SHA-512, SHA-512/224 and SHA-512/256 use the same sequence of eighty constant 64-bit words, \(K_0^{\{512\}}, K_1^{\{512\}}, \ldots, K_{79}^{\{512\}}\). These words represent the first sixty-four bits of the fractional parts of the cube roots of the first eighty prime numbers. In hex, these constant words are (from left to right)
SHA-384、SHA-512、SHA-512/224 および SHA-512/256 は、80個の64ビット定数ワードからなる同一の列 \(K_0^{\{512\}}, K_1^{\{512\}}, \ldots, K_{79}^{\{512\}}\) を使用します。これらのワードは、最初の80個の素数の立方根の小数部の先頭64ビットを表します。これらの定数ワードを16進数で示すと次のとおりです(左から右の順)。
428a2f98d728ae22 7137449123ef65cd b5c0fbcfec4d3b2f e9b5dba58189dbbc 3956c25bf348b538 59f111f1b605d019 923f82a4af194f9b ab1c5ed5da6d8118 d807aa98a3030242 12835b0145706fbe 243185be4ee4b28c 550c7dc3d5ffb4e2 72be5d74f27b896f 80deb1fe3b1696b1 9bdc06a725c71235 c19bf174cf692694 e49b69c19ef14ad2 efbe4786384f25e3 0fc19dc68b8cd5b5 240ca1cc77ac9c65 2de92c6f592b0275 4a7484aa6ea6e483 5cb0a9dcbd41fbd4 76f988da831153b5 983e5152ee66dfab a831c66d2db43210 b00327c898fb213f bf597fc7beef0ee4 c6e00bf33da88fc2 d5a79147930aa725 06ca6351e003826f 142929670a0e6e70 27b70a8546d22ffc 2e1b21385c26c926 4d2c6dfc5ac42aed 53380d139d95b3df 650a73548baf63de 766a0abb3c77b2a8 81c2c92e47edaee6 92722c851482353b a2bfe8a14cf10364 a81a664bbc423001 c24b8b70d0f89791 c76c51a30654be30 d192e819d6ef5218 d69906245565a910 f40e35855771202a 106aa07032bbd1b8 19a4c116b8d2d0c8 1e376c085141ab53 2748774cdf8eeb99 34b0bcb5e19b48a8 391c0cb3c5c95a63 4ed8aa4ae3418acb 5b9cca4f7763e373 682e6ff3d6b2b8a3 748f82ee5defb2fc 78a5636f43172f60 84c87814a1f0ab72 8cc702081a6439ec 90befffa23631e28 a4506cebde82bde9 bef9a3f7b2c67915 c67178f2e372532b ca273eceea26619c d186b8c721c0c207 eada7dd6cde0eb1e f57d4f7fee6ed178 06f067aa72176fba 0a637dc5a2c898a6 113f9804bef90dae 1b710b35131c471b 28db77f523047d84 32caab7b40c72493 3c9ebe0a15c9bebc 431d67c49c100d4c 4cc5d4becb3e42b6 597f299cfc657e2a 5fcb6fab3ad6faec 6c44198c4a475817
428a2f98d728ae22 7137449123ef65cd b5c0fbcfec4d3b2f e9b5dba58189dbbc 3956c25bf348b538 59f111f1b605d019 923f82a4af194f9b ab1c5ed5da6d8118 d807aa98a3030242 12835b0145706fbe 243185be4ee4b28c 550c7dc3d5ffb4e2 72be5d74f27b896f 80deb1fe3b1696b1 9bdc06a725c71235 c19bf174cf692694 e49b69c19ef14ad2 efbe4786384f25e3 0fc19dc68b8cd5b5 240ca1cc77ac9c65 2de92c6f592b0275 4a7484aa6ea6e483 5cb0a9dcbd41fbd4 76f988da831153b5 983e5152ee66dfab a831c66d2db43210 b00327c898fb213f bf597fc7beef0ee4 c6e00bf33da88fc2 d5a79147930aa725 06ca6351e003826f 142929670a0e6e70 27b70a8546d22ffc 2e1b21385c26c926 4d2c6dfc5ac42aed 53380d139d95b3df 650a73548baf63de 766a0abb3c77b2a8 81c2c92e47edaee6 92722c851482353b a2bfe8a14cf10364 a81a664bbc423001 c24b8b70d0f89791 c76c51a30654be30 d192e819d6ef5218 d69906245565a910 f40e35855771202a 106aa07032bbd1b8 19a4c116b8d2d0c8 1e376c085141ab53 2748774cdf8eeb99 34b0bcb5e19b48a8 391c0cb3c5c95a63 4ed8aa4ae3418acb 5b9cca4f7763e373 682e6ff3d6b2b8a3 748f82ee5defb2fc 78a5636f43172f60 84c87814a1f0ab72 8cc702081a6439ec 90befffa23631e28 a4506cebde82bde9 bef9a3f7b2c67915 c67178f2e372532b ca273eceea26619c d186b8c721c0c207 eada7dd6cde0eb1e f57d4f7fee6ed178 06f067aa72176fba 0a637dc5a2c898a6 113f9804bef90dae 1b710b35131c471b 28db77f523047d84 32caab7b40c72493 3c9ebe0a15c9bebc 431d67c49c100d4c 4cc5d4becb3e42b6 597f299cfc657e2a 5fcb6fab3ad6faec 6c44198c4a475817
5. PREPROCESSING
5. 前処理
Preprocessing consists of three steps: padding the message, \(M\) (Sec. 5.1), parsing the message into message blocks (Sec. 5.2), and setting the initial hash value, \(H^{(0)}\) (Sec. 5.3).
前処理は3つのステップからなります。メッセージ \(M\) のパディング(5.1 節)、メッセージのメッセージブロックへの解析(5.2 節)、および初期ハッシュ値 \(H^{(0)}\) の設定(5.3 節)です。
5.1 Padding the Message
5.1 メッセージのパディング
The purpose of this padding is to ensure that the padded message is a multiple of 512 or 1024 bits, depending on the algorithm. Padding can be inserted before hash computation begins on a message, or at any other time during the hash computation prior to processing the block(s) that will contain the padding.
このパディングの目的は、パディング済みメッセージの長さを、アルゴリズムに応じて512ビットまたは1024ビットの倍数にすることです。パディングは、メッセージに対するハッシュ計算の開始前に挿入してもよいし、パディングを含むことになるブロックを処理する前であれば、ハッシュ計算中のどの時点で挿入してもよいです。
5.1.1 SHA-1, SHA-224 and SHA-256
5.1.1 SHA-1、SHA-224 および SHA-256
Suppose that the length of the message, \(M\), is \(\ell\) bits. Append the bit “1” to the end of the message, followed by \(k\) zero bits, where \(k\) is the smallest, non-negative solution to the equation \(\ell + 1 + k \equiv 448 \bmod 512\). Then append the 64-bit block that is equal to the number \(\ell\) expressed using a binary representation. For example, the (8-bit ASCII) message “abc” has length \(8 \times 3 = 24\), so the message is padded with a one bit, then \(448 - (24 + 1) = 423\) zero bits, and then the message length, to become the 512-bit padded message
メッセージ \(M\) の長さを \(\ell\) ビットとします。メッセージの末尾にビット「1」を付加し、続けて \(k\) 個のゼロビットを付加します。ここで、\(k\) は方程式 \(\ell + 1 + k \equiv 448 \bmod 512\) の最小の非負解です。次に、数 \(\ell\) を2進表現で表した64ビットのブロックを付加します。たとえば、(8ビット ASCII の)メッセージ「abc」の長さは \(8 \times 3 = 24\) であるため、このメッセージには1ビットの1、続いて \(448 - (24 + 1) = 423\) 個のゼロビット、さらにメッセージ長がパディングされ、次の512ビットのパディング済みメッセージとなります。
The length of the padded message should now be a multiple of 512 bits.
これで、パディング済みメッセージの長さは512ビットの倍数になっているはずです。
5.1.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256
5.1.2 SHA-384、SHA-512、SHA-512/224 および SHA-512/256
Suppose the length of the message \(M\), in bits, is \(\ell\) bits. Append the bit “1” to the end of the message, followed by \(k\) zero bits, where \(k\) is the smallest non-negative solution to the equation \(\ell + 1 + k \equiv 896 \bmod 1024\). Then append the 128-bit block that is equal to the number \(\ell\) expressed using a binary representation. For example, the (8-bit ASCII) message “abc” has length \(8 \times 3 = 24\), so the message is padded with a one bit, then \(896 - (24 + 1) = 871\) zero bits, and then the message length, to become the 1024-bit padded message
メッセージ \(M\) の長さをビット単位で \(\ell\) ビットとします。メッセージの末尾にビット「1」を付加し、続けて \(k\) 個のゼロビットを付加します。ここで、\(k\) は方程式 \(\ell + 1 + k \equiv 896 \bmod 1024\) の最小の非負解です。次に、数 \(\ell\) を2進表現で表した128ビットのブロックを付加します。たとえば、(8ビット ASCII の)メッセージ「abc」の長さは \(8 \times 3 = 24\) であるため、このメッセージには1ビットの1、続いて \(896 - (24 + 1) = 871\) 個のゼロビット、さらにメッセージ長がパディングされ、次の1024ビットのパディング済みメッセージとなります。
The length of the padded message should now be a multiple of 1024 bits.
これで、パディング済みメッセージの長さは1024ビットの倍数になっているはずです。
5.2 Parsing the Message
5.2 メッセージの解析
The message and its padding must be parsed into N m-bit blocks.
メッセージとそのパディングは、N 個の m ビットブロックに解析されなければなりません。
5.2.1 SHA-1, SHA-224 and SHA-256
5.2.1 SHA-1、SHA-224 および SHA-256
For SHA-1, SHA-224 and SHA-256, the message and its padding are parsed into \(N\) 512-bit blocks, \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\). Since the 512 bits of the input block may be expressed as sixteen 32-bit words, the first 32 bits of message block \(i\) are denoted \(M_0^{(i)}\), the next 32 bits are \(M_1^{(i)}\), and so on up to \(M_{15}^{(i)}\).
SHA-1、SHA-224 および SHA-256 では、メッセージとそのパディングは \(N\) 個の512ビットブロック \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\) に解析されます。入力ブロックの512ビットは16個の32ビットワードとして表せるため、メッセージブロック \(i\) の最初の32ビットを \(M_0^{(i)}\)、次の32ビットを \(M_1^{(i)}\) と表し、以下同様に \(M_{15}^{(i)}\) までを表します。
5.2.2 SHA-384, SHA-512, SHA-512/224 and SHA-512/256
5.2.2 SHA-384、SHA-512、SHA-512/224 および SHA-512/256
For SHA-384, SHA-512, SHA-512/224 and SHA-512/256, the message and its padding are parsed into \(N\) 1024-bit blocks, \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\). Since the 1024 bits of the input block may be expressed as sixteen 64-bit words, the first 64 bits of message block \(i\) are denoted \(M_0^{(i)}\), the next 64 bits are \(M_1^{(i)}\), and so on up to \(M_{15}^{(i)}\).
SHA-384、SHA-512、SHA-512/224 および SHA-512/256 では、メッセージとそのパディングは \(N\) 個の1024ビットブロック \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\) に解析されます。入力ブロックの1024ビットは16個の64ビットワードとして表せるため、メッセージブロック \(i\) の最初の64ビットを \(M_0^{(i)}\)、次の64ビットを \(M_1^{(i)}\) と表し、以下同様に \(M_{15}^{(i)}\) までを表します。
5.3 Setting the Initial Hash Value (\(H^{(0)}\))
5.3 初期ハッシュ値(\(H^{(0)}\))の設定
Before hash computation begins for each of the secure hash algorithms, the initial hash value, \(H^{(0)}\), must be set. The size and number of words in \(H^{(0)}\) depends on the message digest size.
各セキュアハッシュアルゴリズムでハッシュ計算を開始する前に、初期ハッシュ値 \(H^{(0)}\) を設定しなければなりません。\(H^{(0)}\) のワードのサイズと個数は、メッセージダイジェストのサイズによって決まります。
5.3.1 SHA-1
5.3.1 SHA-1
For SHA-1, the initial hash value, \(H^{(0)}\), shall consist of the following five 32-bit words, in hex:
SHA-1 では、初期ハッシュ値 \(H^{(0)}\) は、次の5つの32ビットワード(16進数)で構成されなければなりません。
5.3.2 SHA-224
5.3.2 SHA-224
For SHA-224, the initial hash value, \(H^{(0)}\), shall consist of the following eight 32-bit words, in hex:
SHA-224 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの32ビットワード(16進数)で構成されなければなりません。
5.3.3 SHA-256
5.3.3 SHA-256
For SHA-256, the initial hash value, \(H^{(0)}\), shall consist of the following eight 32-bit words, in hex:
SHA-256 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの32ビットワード(16進数)で構成されなければなりません。
These words were obtained by taking the first thirty-two bits of the fractional parts of the square roots of the first eight prime numbers.
これらのワードは、最初の8個の素数の平方根の小数部の先頭32ビットを取ることによって得られました。
5.3.4 SHA-384
5.3.4 SHA-384
For SHA-384, the initial hash value, \(H^{(0)}\), shall consist of the following eight 64-bit words, in hex:
SHA-384 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの64ビットワード(16進数)で構成されなければなりません。
These words were obtained by taking the first sixty-four bits of the fractional parts of the square roots of the ninth through sixteenth prime numbers.
これらのワードは、9番目から16番目までの素数の平方根の小数部の先頭64ビットを取ることによって得られました。
5.3.5 SHA-512
5.3.5 SHA-512
For SHA-512, the initial hash value, \(H^{(0)}\), shall consist of the following eight 64-bit words, in hex:
SHA-512 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの64ビットワード(16進数)で構成されなければなりません。
These words were obtained by taking the first sixty-four bits of the fractional parts of the square roots of the first eight prime numbers.
これらのワードは、最初の8個の素数の平方根の小数部の先頭64ビットを取ることによって得られました。
5.3.6 SHA-512/t
5.3.6 SHA-512/t
“SHA-512/t” is the general name for a t-bit hash function based on SHA-512 whose output is truncated to t bits. Each hash function requires a distinct initial hash value. This section provides a procedure for determining the initial value for SHA-512/ t for a given value of t.
「SHA-512/t」は、SHA-512 に基づき出力を t ビットに切り詰めた t ビットハッシュ関数の総称です。各ハッシュ関数には、それぞれ異なる初期ハッシュ値が必要です。本節では、与えられた t の値に対して SHA-512/ t の初期値を決定する手順を示します。
For SHA-512/t, t is any positive integer without a leading zero such that t < 512, and t is not 384. For example: t is 256, but not 0256, and “SHA-512/t” is “SHA-512/256” (an 11 character long ASCII string), which is equivalent to 53 48 41 2D 35 31 32 2F 32 35 36 in hexadecimal.
SHA-512/t において、t は先頭にゼロを持たない t < 512 の任意の正の整数であり、かつ t は384ではありません。たとえば、t は256であって0256ではなく、「SHA-512/t」は「SHA-512/256」(11文字の ASCII 文字列)であり、これは16進数で 53 48 41 2D 35 31 32 2F 32 35 36 と等価です。
The initial hash value for SHA-512/t, for a given value of t, shall be generated by the SHA-512/t IV Generation Function below.
与えられた t の値に対する SHA-512/t の初期ハッシュ値は、以下の SHA-512/t IV 生成関数によって生成されなければなりません。
SHA-512/t IV Generation Function
SHA-512/t IV 生成関数
(begin:)
(開始:)
Denote \(H^{(0)\prime}\) to be the initial hash value of SHA-512 as specified in Section 5.3.5 above.
上記 5.3.5 節で規定した SHA-512 の初期ハッシュ値を \(H^{(0)\prime}\) と表します。
Denote \(H^{(0)\prime\prime}\) to be the initial hash value computed below.
以下で計算される初期ハッシュ値を \(H^{(0)\prime\prime}\) と表します。
\(H^{(0)}\) is the IV for SHA-512/\(t\).
\(H^{(0)}\) は SHA-512/\(t\) の IV です。
\(H^{(0)}\) = SHA-512 (“SHA-512/\(t\)”) using \(H^{(0)\prime\prime}\) as the IV, where \(t\) is the specific truncation value.
\(H^{(0)}\) = SHA-512 (“SHA-512/\(t\)”)。ただし、\(H^{(0)\prime\prime}\) を IV として用い、\(t\) は特定の切り詰め値です。
(end.)
(終了。)
SHA-512/224 (\(t = 224\)) and SHA-512/256 (\(t = 256\)) are approved hash algorithms. Other SHA-512/\(t\) hash algorithms with different \(t\) values may be specified in [SP 800-107] in the future as the need arises. Below are the IVs for SHA-512/224 and SHA-512/256.
SHA-512/224(\(t = 224\))と SHA-512/256(\(t = 256\))は承認されたハッシュアルゴリズムです。異なる \(t\) の値を持つ他の SHA-512/\(t\) ハッシュアルゴリズムは、必要に応じて将来 [SP 800-107] で規定される可能性があります。以下に SHA-512/224 と SHA-512/256 の IV を示します。
5.3.6.1 SHA-512/224
5.3.6.1 SHA-512/224
For SHA-512/224, the initial hash value, \(H^{(0)}\), shall consist of the following eight 64-bit words, in hex:
SHA-512/224 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの64ビットワード(16進数)で構成されなければなりません。
These words were obtained by executing the SHA-512/t IV Generation Function with \(t = 224\).
これらのワードは、\(t = 224\) として SHA-512/t IV 生成関数を実行することによって得られました。
5.3.6.2 SHA-512/256
5.3.6.2 SHA-512/256
For SHA-512/256, the initial hash value, \(H^{(0)}\), shall consist of the following eight 64-bit words, in hex:
SHA-512/256 では、初期ハッシュ値 \(H^{(0)}\) は、次の8つの64ビットワード(16進数)で構成されなければなりません。
These words were obtained by executing the SHA-512/t IV Generation Function with \(t = 256\).
これらのワードは、\(t = 256\) として SHA-512/t IV 生成関数を実行することによって得られました。
6. SECURE HASH ALGORITHMS
6. セキュアハッシュアルゴリズム
In the following sections, the hash algorithms are not described in ascending order of size. SHA-256 is described before SHA-224 because the specification for SHA-224 is identical to SHA-256, except that different initial hash values are used, and the final hash value is truncated to 224 bits for SHA-224. The same is true for SHA-512, SHA-384, SHA-512/224 and SHA-512/256, except that the final hash value is truncated to 224 bits for SHA-512/224, 256 bits for SHA-512/256 or 384 bits for SHA-384.
以下の各節では、ハッシュアルゴリズムをサイズの昇順には記述していません。SHA-256 を SHA-224 より先に記述するのは、SHA-224 の仕様が SHA-256 と同一であり、異なる点は、使用する初期ハッシュ値が異なることと、SHA-224 では最終ハッシュ値を224ビットに切り詰めることだけだからです。SHA-512、SHA-384、SHA-512/224 および SHA-512/256 についても同様であり、異なる点は、最終ハッシュ値を SHA-512/224 では224ビット、SHA-512/256 では256ビット、SHA-384 では384ビットに切り詰めることだけです。
For each of the secure hash algorithms, there may exist alternate computation methods that yield identical results; one example is the alternative SHA-1 computation described in Sec. 6.1.3. Such alternate methods may be implemented in conformance to this standard.
各セキュアハッシュアルゴリズムには、同一の結果を得られる別の計算方法が存在する場合があります。その一例が、6.1.3節で説明する SHA-1 の代替計算方法です。このような代替方法は、本標準に適合する形で実装してもよいです。
6.1 SHA-1
6.1 SHA-1
SHA-1 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{64}\). The algorithm uses 1) a message schedule of eighty 32-bit words, 2) five working variables of 32 bits each, and 3) a hash value of five 32-bit words. The final result of SHA-1 is a 160-bit message digest.
SHA-1 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{64}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、1) 80個の32ビットワードからなるメッセージスケジュール、2) それぞれ32ビットの5つの作業変数、3) 5つの32ビットワードからなるハッシュ値を用います。SHA-1 の最終結果は160ビットのメッセージダイジェストです。
The words of the message schedule are labeled \(W_0, W_1, \ldots, W_{79}\). The five working variables are labeled \(\boldsymbol{a}\), \(\boldsymbol{b}\), \(\boldsymbol{c}\), \(\boldsymbol{d}\), and \(\boldsymbol{e}\). The words of the hash value are labeled \(H_0^{(i)}, H_1^{(i)}, \ldots, H_4^{(i)}\), which will hold the initial hash value, \(H^{(0)}\), replaced by each successive intermediate hash value (after each message block is processed), \(H^{(i)}\), and ending with the final hash value, \(H^{(N)}\). SHA-1 also uses a single temporary word, \(T\).
メッセージスケジュールのワードを \(W_0, W_1, \ldots, W_{79}\) と表します。5つの作業変数を \(\boldsymbol{a}\)、\(\boldsymbol{b}\)、\(\boldsymbol{c}\)、\(\boldsymbol{d}\)、\(\boldsymbol{e}\) と表します。ハッシュ値のワードを \(H_0^{(i)}, H_1^{(i)}, \ldots, H_4^{(i)}\) と表します。これらのワードには初期ハッシュ値 \(H^{(0)}\) が格納され、(各メッセージブロックの処理後に)後続の中間ハッシュ値 \(H^{(i)}\) で順次置き換えられ、最終的に最終ハッシュ値 \(H^{(N)}\) となります。SHA-1 はさらに、一時ワード \(T\) を1つ用います。
6.1.1 SHA-1 Preprocessing
6.1.1 SHA-1 の前処理
1.Set the initial hash value, \(H^{(0)}\), as specified in Sec. 5.3.1.
1.5.3.1節の規定に従って初期ハッシュ値 \(H^{(0)}\) を設定します。
2.The message is padded and parsed as specified in Section 5.
2.5節の規定に従ってメッセージをパディングし、解析します。
6.1.2 SHA-1 Hash Computation
6.1.2 SHA-1 のハッシュ計算
The SHA-1 hash computation uses functions and constants previously defined in Sec. 4.1.1 and Sec. 4.2.1, respectively. Addition (+) is performed modulo \(2^{32}\).
SHA-1 のハッシュ計算では、4.1.1節で定義した関数と4.2.1節で定義した定数を用います。加算(+)は \(2^{32}\) を法として行います。
Each message block, \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\), is processed in order, using the following steps:
各メッセージブロック \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\) を、次の手順で順に処理します。
For \(i\)=1 to \(N\): {
\(i\)=1 から \(N\) まで:{
1.Prepare the message schedule, \(\{W_t\}\):
1.メッセージスケジュール \(\{W_t\}\) を準備します。
2.Initialize the five working variables, \(\boldsymbol{a}\), \(\boldsymbol{b}\), \(\boldsymbol{c}\), \(\boldsymbol{d}\), and \(\boldsymbol{e}\), with the \((i\text{-}1)^{\mathrm{st}}\) hash value:
2.5つの作業変数 \(\boldsymbol{a}\)、\(\boldsymbol{b}\)、\(\boldsymbol{c}\)、\(\boldsymbol{d}\)、\(\boldsymbol{e}\) を、\((i\text{-}1)^{\mathrm{st}}\) のハッシュ値で初期化します。
3.For \(t\)=0 to 79: {
3.\(t\)=0 から 79 まで:{
}
4.Compute the \(i^{\mathrm{th}}\) intermediate hash value \(H^{(i)}\):
4.\(i^{\mathrm{th}}\) の中間ハッシュ値 \(H^{(i)}\) を計算します。
}
After repeating steps one through four a total of \(N\) times (i.e., after processing \(M^{(N)}\)), the resulting 160-bit message digest of the message, \(M\), is
手順1~4を合計 \(N\) 回繰り返した後(すなわち \(M^{(N)}\) を処理した後)、メッセージ \(M\) の160ビットのメッセージダイジェストは次のとおりです。
6.1.3 Alternate Method for Computing a SHA-1 Message Digest
6.1.3 SHA-1 メッセージダイジェストの代替計算方法
The SHA-1 hash computation method described in Sec. 6.1.2 assumes that the message schedule \(W_0, W_1, \ldots, W_{79}\) is implemented as an array of eighty 32-bit words. This is efficient from the standpoint of the minimization of execution time, since the addresses of \(W_{t-3}, \ldots, W_{t-16}\) in step (2) of Sec. 6.1.2 are easily computed.
6.1.2節で説明した SHA-1 のハッシュ計算方法は、メッセージスケジュール \(W_0, W_1, \ldots, W_{79}\) を80個の32ビットワードの配列として実装することを前提としています。6.1.2節の手順 (2) における \(W_{t-3}, \ldots, W_{t-16}\) のアドレスを容易に計算できるため、この方法は実行時間を最小化する観点から効率的です。
However, if memory is limited, an alternative is to regard \(\{W_t\}\) as a circular queue that may be implemented using an array of sixteen 32-bit words, \(W_0, W_1, \ldots, W_{15}\). The alternate method that is described in this section yields the same message digest as the SHA-1 computation method described in Sec. 6.1.2. Although this alternate method saves sixty-four 32-bit words of storage, it is likely to lengthen the execution time due to the increased complexity of the address computations for the \(\{W_t\}\) in step (3).
しかし、メモリが限られている場合は、\(\{W_t\}\) を循環キューとみなし、16個の32ビットワード \(W_0, W_1, \ldots, W_{15}\) の配列で実装する方法があります。本節で説明する代替方法は、6.1.2節で説明した SHA-1 の計算方法と同じメッセージダイジェストを生成します。この代替方法は32ビットワード64個分の記憶領域を節約できますが、手順 (3) における \(\{W_t\}\) のアドレス計算が複雑になるため、実行時間が長くなる可能性が高いです。
For this alternate SHA-1 method, let \(\mathit{MASK}\)=0000000f (in hex). As in Sec. 6.1.1, addition is performed modulo \(2^{32}\). Assuming that the preprocessing as described in Sec. 6.1.1 has been performed, the processing of \(M^{(i)}\) is as follows:
この SHA-1 の代替方法では、\(\mathit{MASK}\)=0000000f(16進数)とします。6.1.1節と同様に、加算は \(2^{32}\) を法として行います。6.1.1節で説明した前処理が実行済みであるとすると、\(M^{(i)}\) の処理は次のとおりです。
For \(i\)=1 to \(N\): {
\(i\)=1 から \(N\) まで:{
1.For \(t\)=0 to 15: {
1.\(t\)=0 から 15 まで:{
}
2.Initialize the five working variables, \(\boldsymbol{a}\), \(\boldsymbol{b}\), \(\boldsymbol{c}\), \(\boldsymbol{d}\), and \(\boldsymbol{e}\), with the \((i\text{-}1)^{\mathrm{st}}\) hash value:
2.5つの作業変数 \(\boldsymbol{a}\)、\(\boldsymbol{b}\)、\(\boldsymbol{c}\)、\(\boldsymbol{d}\)、\(\boldsymbol{e}\) を、\((i\text{-}1)^{\mathrm{st}}\) のハッシュ値で初期化します。
3.For \(t\)=0 to 79: {
3.\(t\)=0 から 79 まで:{
4.Compute the \(i^{\text{th}}\) intermediate hash value \(H^{(i)}\):
4.\(i^{\text{th}}\) の中間ハッシュ値 \(H^{(i)}\) を計算します。
After repeating steps one through four a total of \(N\) times (i.e., after processing \(M^{(N)}\)), the resulting 160-bit message digest of the message, \(M\), is
手順1~4を合計 \(N\) 回繰り返した後(すなわち \(M^{(N)}\) を処理した後)、メッセージ \(M\) の160ビットのメッセージダイジェストは次のとおりです。
6.2 SHA-256
6.2 SHA-256
SHA-256 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{64}\). The algorithm uses 1) a message schedule of sixty-four 32-bit words, 2) eight working variables of 32 bits each, and 3) a hash value of eight 32-bit words. The final result of SHA-256 is a 256-bit message digest.
SHA-256 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{64}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、1) 64個の32ビットワードからなるメッセージスケジュール、2) それぞれ32ビットの8つの作業変数、3) 8つの32ビットワードからなるハッシュ値を用います。SHA-256 の最終結果は256ビットのメッセージダイジェストです。
The words of the message schedule are labeled \(W_0\), \(W_1\),…, \(W_{63}\). The eight working variables are labeled \(\mathbf{a}\), \(\mathbf{b}\), \(\mathbf{c}\), \(\mathbf{d}\), \(\mathbf{e}\), \(\mathbf{f}\), \(\mathbf{g}\), and \(\mathbf{h}\). The words of the hash value are labeled \(H_0^{(i)}, H_1^{(i)}, \ldots, H_7^{(i)}\), which will hold the initial hash value, \(H^{(0)}\), replaced by each successive intermediate hash value (after each message block is processed), \(H^{(i)}\), and ending with the final hash value, \(H^{(N)}\). SHA-256 also uses two temporary words, \(T_1\) and \(T_2\).
メッセージスケジュールのワードを \(W_0\)、\(W_1\)、…、\(W_{63}\) と表します。8つの作業変数を \(\mathbf{a}\)、\(\mathbf{b}\)、\(\mathbf{c}\)、\(\mathbf{d}\)、\(\mathbf{e}\)、\(\mathbf{f}\)、\(\mathbf{g}\)、\(\mathbf{h}\) と表します。ハッシュ値のワードを \(H_0^{(i)}, H_1^{(i)}, \ldots, H_7^{(i)}\) と表します。これらのワードには初期ハッシュ値 \(H^{(0)}\) が格納され、(各メッセージブロックの処理後に)後続の中間ハッシュ値 \(H^{(i)}\) で順次置き換えられ、最終的に最終ハッシュ値 \(H^{(N)}\) となります。SHA-256 はさらに、2つの一時ワード \(T_1\) と \(T_2\) を用います。
6.2.1 SHA-256 Preprocessing
6.2.1 SHA-256 の前処理
1.Set the initial hash value, \(H^{(0)}\), as specified in Sec. 5.3.3.
1.5.3.3節の規定に従って初期ハッシュ値 \(H^{(0)}\) を設定します。
2.The message is padded and parsed as specified in Section 5.
2.5節の規定に従ってメッセージをパディングし、解析します。
6.2.2 SHA-256 Hash Computation
6.2.2 SHA-256 のハッシュ計算
The SHA-256 hash computation uses functions and constants previously defined in Sec. 4.1.2 and Sec. 4.2.2, respectively. Addition (+) is performed modulo \(2^{32}\).
SHA-256 のハッシュ計算では、4.1.2節で定義した関数と4.2.2節で定義した定数を用います。加算(+)は \(2^{32}\) を法として行います。
Each message block, \(M^{(1)}\), \(M^{(2)}\), …, \(M^{(N)}\), is processed in order, using the following steps:
各メッセージブロック \(M^{(1)}\)、\(M^{(2)}\)、…、\(M^{(N)}\) を、次の手順で順に処理します。
For \(i\)=1 to \(N\): {
\(i\)=1 から \(N\) まで:{
1.Prepare the message schedule, \(\{W_t\}\):
1.メッセージスケジュール \(\{W_t\}\) を準備します。
2.Initialize the eight working variables, \(\mathbf{a}\), \(\mathbf{b}\), \(\mathbf{c}\), \(\mathbf{d}\), \(\mathbf{e}\), \(\mathbf{f}\), \(\mathbf{g}\), and \(\mathbf{h}\), with the \((i-1)^{\text{st}}\) hash value:
2.8つの作業変数 \(\mathbf{a}\)、\(\mathbf{b}\)、\(\mathbf{c}\)、\(\mathbf{d}\)、\(\mathbf{e}\)、\(\mathbf{f}\)、\(\mathbf{g}\)、\(\mathbf{h}\) を、\((i-1)^{\text{st}}\) のハッシュ値で初期化します。
3.For \(t=0\) to 63:
3.\(t=0\) から 63 まで:
4.Compute the \(i^{\text{th}}\) intermediate hash value \(H^{(i)}\):
4.\(i^{\text{th}}\) の中間ハッシュ値 \(H^{(i)}\) を計算します。
}
After repeating steps one through four a total of \(N\) times (i.e., after processing \(M^{(N)}\)), the resulting 256-bit message digest of the message, \(M\), is
手順1~4を合計 \(N\) 回繰り返した後(すなわち \(M^{(N)}\) を処理した後)、メッセージ \(M\) の256ビットのメッセージダイジェストは次のとおりです。
6.3 SHA-224
6.3 SHA-224
SHA-224 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{64}\). The function is defined in the exact same manner as SHA-256 (Section 6.2), with the following two exceptions:
SHA-224 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{64}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。この関数は、次の2点を除き、SHA-256(6.2節)とまったく同じ方法で定義されます。
1.The initial hash value, \(H^{(0)}\), shall be set as specified in Sec. 5.3.2; and
1.初期ハッシュ値 \(H^{(0)}\) は、5.3.2節の規定に従って設定しなければなりません。
2.The 224-bit message digest is obtained by truncating the final hash value, \(H(N)\), to its left-most 224 bits:
2.224ビットのメッセージダイジェストは、最終ハッシュ値 \(H(N)\) を左端の224ビットに切り詰めることで得られます。
6.4 SHA-512
6.4 SHA-512
SHA-512 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{128}\). The algorithm uses 1) a message schedule of eighty 64-bit words, 2) eight working variables of 64 bits each, and 3) a hash value of eight 64-bit words. The final result of SHA-512 is a 512-bit message digest.
SHA-512 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{128}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、1) 80個の64ビットワードからなるメッセージスケジュール、2) それぞれ64ビットの8つの作業変数、3) 8つの64ビットワードからなるハッシュ値を用います。SHA-512 の最終結果は512ビットのメッセージダイジェストです。
The words of the message schedule are labeled \(W_0, W_1, \ldots, W_{79}\). The eight working variables are labeled \(\mathbf{a}\), \(\mathbf{b}\), \(\mathbf{c}\), \(\mathbf{d}\), \(\mathbf{e}\), \(\mathbf{f}\), \(\mathbf{g}\), and \(\mathbf{h}\). The words of the hash value are labeled \(H_0^{(i)}, H_1^{(i)}, \ldots, H_7^{(i)}\), which will hold the initial hash value, \(H^{(0)}\), replaced by each successive intermediate hash value (after each message block is processed), \(H^{(i)}\), and ending with the final hash value, \(H^{(N)}\). SHA-512 also uses two temporary words, \(T_1\) and \(T_2\).
メッセージスケジュールのワードを \(W_0, W_1, \ldots, W_{79}\) と表します。8つの作業変数を \(\mathbf{a}\)、\(\mathbf{b}\)、\(\mathbf{c}\)、\(\mathbf{d}\)、\(\mathbf{e}\)、\(\mathbf{f}\)、\(\mathbf{g}\)、\(\mathbf{h}\) と表します。ハッシュ値のワードを \(H_0^{(i)}, H_1^{(i)}, \ldots, H_7^{(i)}\) と表します。これらのワードには初期ハッシュ値 \(H^{(0)}\) が格納され、(各メッセージブロックの処理後に)後続の中間ハッシュ値 \(H^{(i)}\) で順次置き換えられ、最終的に最終ハッシュ値 \(H^{(N)}\) となります。SHA-512 はさらに、2つの一時ワード \(T_1\) と \(T_2\) を用います。
6.4.1 SHA-512 Preprocessing
6.4.1 SHA-512 の前処理
1.Set the initial hash value, \(H^{(0)}\), as specified in Sec. 5.3.5.
1.5.3.5節の規定に従って初期ハッシュ値 \(H^{(0)}\) を設定します。
2.The message is padded and parsed as specified in Section 5.
2.5節の規定に従ってメッセージをパディングし、解析します。
6.4.2 SHA-512 Hash Computation
6.4.2 SHA-512 のハッシュ計算
The SHA-512 hash computation uses functions and constants previously defined in Sec. 4.1.3 and Sec. 4.2.3, respectively. Addition (+) is performed modulo \(2^{64}\).
SHA-512 のハッシュ計算では、4.1.3節で定義した関数と4.2.3節で定義した定数を用います。加算(+)は \(2^{64}\) を法として行います。
Each message block, \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\), is processed in order, using the following steps:
各メッセージブロック \(M^{(1)}, M^{(2)}, \ldots, M^{(N)}\) を、次の手順で順に処理します。
For \(i=1\) to \(N\): {
\(i=1\) から \(N\) まで:{
1.Prepare the message schedule, \(\{W_t\}\):
1.メッセージスケジュール \(\{W_t\}\) を準備します。
2.Initialize the eight working variables, \(\mathbf{a}\), \(\mathbf{b}\), \(\mathbf{c}\), \(\mathbf{d}\), \(\mathbf{e}\), \(\mathbf{f}\), \(\mathbf{g}\), and \(\mathbf{h}\), with the \((i\text{-}1)^{\text{st}}\) hash value:
2.8つの作業変数 \(\mathbf{a}\)、\(\mathbf{b}\)、\(\mathbf{c}\)、\(\mathbf{d}\)、\(\mathbf{e}\)、\(\mathbf{f}\)、\(\mathbf{g}\)、\(\mathbf{h}\) を、\((i\text{-}1)^{\text{st}}\) のハッシュ値で初期化します。
3.For \(t=0\) to 79:
3.\(t=0\) から 79 まで:
4.Compute the \(i^{\text{th}}\) intermediate hash value \(H^{(i)}\):
4.\(i^{\text{th}}\) の中間ハッシュ値 \(H^{(i)}\) を計算します。
}
After repeating steps one through four a total of \(N\) times (i.e., after processing \(M^{(N)}\)), the resulting 512-bit message digest of the message, \(M\), is
手順1~4を合計 \(N\) 回繰り返した後(すなわち \(M^{(N)}\) を処理した後)、メッセージ \(M\) の512ビットのメッセージダイジェストは次のとおりです。
6.5 SHA-384
6.5 SHA-384
SHA-384 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{128}\). The algorithm is defined in the exact same manner as SHA-512 (Sec. 6.4), with the following two exceptions:
SHA-384 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{128}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、次の2点を除き、SHA-512(6.4節)とまったく同じ方法で定義されます。
1.The initial hash value, \(H^{(0)}\), shall be set as specified in Sec. 5.3.4; and
1.初期ハッシュ値 \(H^{(0)}\) は、5.3.4節の規定に従って設定しなければなりません。
2.The 384-bit message digest is obtained by truncating the final hash value, \(H^{(N)}\), to its left-most 384 bits:
2.384ビットのメッセージダイジェストは、最終ハッシュ値 \(H^{(N)}\) を左端の384ビットに切り詰めることで得られます。
6.6 SHA-512/224
6.6 SHA-512/224
SHA-512/224 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{128}\). The algorithm is defined in the exact same manner as SHA-512 (Sec. 6.4), with the following two exceptions:
SHA-512/224 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{128}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、次の2点を除き、SHA-512(6.4節)とまったく同じ方法で定義されます。
1.The initial hash value, \(H^{(0)}\), shall be set as specified in Sec. 5.3.6.1; and
1.初期ハッシュ値 \(H^{(0)}\) は、5.3.6.1節の規定に従って設定しなければなりません。
2.The 224-bit message digest is obtained by truncating the final hash value, \(H^{(N)}\), to its left-most 224 bits.
2.224ビットのメッセージダイジェストは、最終ハッシュ値 \(H^{(N)}\) を左端の224ビットに切り詰めることで得られます。
6.7 SHA-512/256
6.7 SHA-512/256
SHA-512/256 may be used to hash a message, \(M\), having a length of \(\ell\) bits, where \(0 \le \ell < 2^{128}\). The algorithm is defined in the exact same manner as SHA-512 (Sec. 6.4), with the following two exceptions:
SHA-512/256 は、長さ \(\ell\) ビット(\(0 \le \ell < 2^{128}\))のメッセージ \(M\) のハッシュ化に用いてもよいです。このアルゴリズムは、次の2点を除き、SHA-512(6.4節)とまったく同じ方法で定義されます。
1.The initial hash value, \(H^{(0)}\), shall be set as specified in Sec. 5.3.6.2; and
1.初期ハッシュ値 \(H^{(0)}\) は、5.3.6.2節の規定に従って設定しなければなりません。
2.The 256-bit message digest is obtained by truncating the final hash value, \(H^{(N)}\), to its left-most 256 bits.
2.256ビットのメッセージダイジェストは、最終ハッシュ値 \(H^{(N)}\) を左端の256ビットに切り詰めることで得られます。
7. TRUNCATION OF A MESSAGE DIGEST
7. メッセージダイジェストの切り詰め
Some application may require a hash function with a message digest length different than those provided by the hash functions in this Standard. In such cases, a truncated message digest may be used, whereby a hash function with a larger message digest length is applied to the data to be hashed, and the resulting message digest is truncated by selecting an appropriate number of the leftmost bits. For guidelines on choosing the length of the truncated message digest and information about its security implications for the cryptographic application that uses it, see SP 800-107 [SP 800-107].
アプリケーションによっては、本標準のハッシュ関数が提供するものとは異なる長さのメッセージダイジェストを持つハッシュ関数を必要とする場合があります。そのような場合には、切り詰めたメッセージダイジェストを用いてもよいです。すなわち、より長いメッセージダイジェストを持つハッシュ関数をハッシュ化対象のデータに適用し、得られたメッセージダイジェストの左端から適切な数のビットを選択して切り詰めます。切り詰めたメッセージダイジェストの長さの選び方に関する指針と、それを用いる暗号アプリケーションにとってのセキュリティ上の影響に関する情報については、SP 800-107 [SP 800-107] を参照のこと。
APPENDIX A: Additional Information
付録 A:補足情報
A.1 Security of the Secure Hash Algorithms
A.1 セキュアハッシュアルゴリズムの安全性
The security of the five hash algorithms, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 is discussed in [SP 800-107].
5つのハッシュアルゴリズム SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256 の安全性については、[SP 800-107] で論じています。
A.2 Implementation Notes
A.2 実装上の注記
Examples of SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 are available at http://csrc.nist.gov/groups/ST/toolkit/examples.html.
SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256 の例は http://csrc.nist.gov/groups/ST/toolkit/examples.html で入手できます。
A.3 Object Identifiers
A.3 オブジェクト識別子
Object identifiers (OIDs) for the SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 algorithms are posted at http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html.
SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA-512/224、SHA-512/256 アルゴリズムのオブジェクト識別子(OID)は http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html に掲載されています。
APPENDIX B: REFERENCES
付録 B:参考文献
[FIPS 180-3] NIST, Federal Information Processing Standards Publication 180-3, Secure Hash Standards (SHS), October 2008.
[FIPS 180-3] NIST, Federal Information Processing Standards Publication 180-3, Secure Hash Standards (SHS), 2008年10月.
[SP 800-57] NIST Special Publication (SP) 800-57, Part 1, Recommendation for Key Management: General, (Draft) May 2011.
[SP 800-57] NIST Special Publication (SP) 800-57, Part 1, Recommendation for Key Management: General,(草案)2011年5月.
[SP 800-107] NIST Special Publication (SP) 800-107, Recommendation for Applications Using Approved Hash Algorithms, (Revised), (Draft) September 2011.
[SP 800-107] NIST Special Publication (SP) 800-107, Recommendation for Applications Using Approved Hash Algorithms,(改訂版),(草案)2011年9月.
APPENDIX C: Technical Changes from FIPS 180-3
付録 C:FIPS 180-3 からの技術的変更点
1.In FIPS 180-3, padding was inserted before hash computation begins. FIPS 140-4 removed this restriction. Padding can be inserted before hash computation begins or at any other time during the hash computation prior to processing the message block(s) containing the padding.
1.FIPS 180-3 では、パディングはハッシュ計算の開始前に挿入されていました。FIPS 140-4 はこの制約を撤廃しました。パディングは、ハッシュ計算の開始前に挿入してもよいし、ハッシュ計算中、パディングを含むメッセージブロックを処理する前であれば任意の時点で挿入してもよいです。
2.FIPS 180-4 adds two additional algorithms: SHA-512/224 and SHA-512/256 to the Standard and the method for determining the initial value for SHA-512/t for a given value of t.
2.FIPS 180-4 は、2つのアルゴリズム SHA-512/224 と SHA-512/256、および所与の t の値に対して SHA-512/t の初期値を決定する方法を本標準に追加します。
ERRATUM
正誤表
The following change has been incorporated into FIPS 180-4, as of the date indicated in the table.
次の変更は、表に示す日付の時点で FIPS 180-4 に反映済みです。
| DATE | TYPE | CHANGE | PAGE NUMBER |
|---|---|---|---|
| 5/9/2014 | Editorial | Change “\(t < 79\)” to “\(t \le 79\)” | Page 10, Section 4.1.1, Line 1 |
| 日付 | 種別 | 変更内容 | ページ番号 |
|---|---|---|---|
| 5/9/2014 | 編集上の修正 | 「\(t < 79\)」を「\(t \le 79\)」に変更 | 10ページ、4.1.1節、1行目 |