RFC4493 日本語訳

4493 The AES-CMAC Algorithm. JH. Song, R. Poovendran, J. Lee, T.Iwata. June 2006. (Format: TXT=38751 bytes) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
英語原文

Network Working Group                                           JH. Song
Request for Comments: 4493                                 R. Poovendran
Category: Informational                         University of Washington
                                                                  J. Lee
                                                     Samsung Electronics
                                                                T. Iwata
                                                       Nagoya University
                                                               June 2006

ワーキンググループJHをネットワークでつないでください。 コメントを求める歌の要求: 4493年のR.Poovendranカテゴリ: 情報のワシントン大学のJ.リー三星電子T.磐田名古屋大学2006年6月

                         The AES-CMAC Algorithm

AES-CMACアルゴリズム

Status of This Memo

このメモの状態

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

このメモはインターネットコミュニティのための情報を提供します。 それはどんな種類のインターネット標準も指定しません。 このメモの分配は無制限です。

Copyright Notice

版権情報

   Copyright (C) The Internet Society (2006).

Copyright(C)インターネット協会(2006)。

Abstract

要約

   The National Institute of Standards and Technology (NIST) has
   recently specified the Cipher-based Message Authentication Code
   (CMAC), which is equivalent to the One-Key CBC MAC1 (OMAC1) submitted
   by Iwata and Kurosawa.  This memo specifies an authentication
   algorithm based on CMAC with the 128-bit Advanced Encryption Standard
   (AES).  This new authentication algorithm is named AES-CMAC.  The
   purpose of this document is to make the AES-CMAC algorithm
   conveniently available to the Internet Community.

米国商務省標準技術局(NIST)は最近、Cipherベースのメッセージ立証コード(CMAC)を指定しました。(それは、磐田と黒沢によって提出されたOne主要なCBC MAC1(OMAC1)に同等です)。 このメモは128ビットのエー・イー・エス(AES)と共にCMACに基づく認証アルゴリズムを指定します。 この新しい認証アルゴリズムはAES-CMACと命名されます。 このドキュメントの目的はAES-CMACアルゴリズムを便利にインターネット共同体に利用可能にすることです。

Song, et al.                 Informational                      [Page 1]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[1ページ]のRFC4493AES-CMACアルゴリズム2006年6月

Table of Contents

目次

   1. Introduction ....................................................2
   2. Specification of AES-CMAC .......................................3
      2.1. Basic Definitions ..........................................3
      2.2. Overview ...................................................4
      2.3. Subkey Generation Algorithm ................................5
      2.4. MAC Generation Algorithm ...................................7
      2.5. MAC Verification Algorithm .................................9
   3. Security Considerations ........................................10
   4. Test Vectors ...................................................11
   5. Acknowledgement ................................................12
   6. References .....................................................12
      6.1. Normative References ......................................12
      6.2. Informative References ....................................12
   Appendix A. Test Code .............................................14

1. 序論…2 2. AES-CMACの仕様…3 2.1. 基本的な定義…3 2.2. 概観…4 2.3. サブキー世代アルゴリズム…5 2.4. MAC世代アルゴリズム…7 2.5. MAC検証アルゴリズム…9 3. セキュリティ問題…10 4. ベクトルをテストしてください…11 5. 承認…12 6. 参照…12 6.1. 標準の参照…12 6.2. 有益な参照…12付録A.はコードをテストします…14

1.  Introduction

1. 序論

   The National Institute of Standards and Technology (NIST) has
   recently specified the Cipher-based Message Authentication Code
   (CMAC).  CMAC [NIST-CMAC] is a keyed hash function that is based on a
   symmetric key block cipher, such as the Advanced Encryption Standard
   [NIST-AES].  CMAC is equivalent to the One-Key CBC MAC1 (OMAC1)
   submitted by Iwata and Kurosawa [OMAC1a, OMAC1b].  OMAC1 is an
   improvement of the eXtended Cipher Block Chaining mode (XCBC)
   submitted by Black and Rogaway [XCBCa, XCBCb], which itself is an
   improvement of the basic Cipher Block Chaining-Message Authentication
   Code (CBC-MAC).  XCBC efficiently addresses the security deficiencies
   of CBC-MAC, and OMAC1 efficiently reduces the key size of XCBC.

米国商務省標準技術局(NIST)は最近、Cipherベースのメッセージ立証コード(CMAC)を指定しました。 CMAC[NIST-CMAC]は対称鍵ブロック暗号に基づいている合わせられたハッシュ関数です、エー・イー・エス[NIST-AES]などのように。 CMACは磐田と黒沢[OMAC1a、OMAC1b]によって提出されたOne主要なCBC MAC1(OMAC1)に同等です。 OMAC1はBlackとRogaway[XCBCa、XCBCb]によって提出されたeXtended Cipher Block Chainingモード(XCBC)の改良です。(それ自体で、それは、基本のCipher Block Chaining-メッセージ立証コード(CBC-MAC)の改良です)。 XCBCは効率的にCBC-MACのセキュリティ欠乏を記述します、そして、OMAC1はXCBCの主要なサイズを効率的に減少させます。

   AES-CMAC provides stronger assurance of data integrity than a
   checksum or an error-detecting code.  The verification of a checksum
   or an error-detecting code detects only accidental modifications of
   the data, while CMAC is designed to detect intentional, unauthorized
   modifications of the data, as well as accidental modifications.

AES-CMACはデータ保全のチェックサムか誤り検出符号より強い保証を提供します。 チェックサムの検証か誤り検出符号がデータの偶然の変更だけを検出します、CMACはデータの意図的で、権限のない変更を検出するように設計されていますが、偶然の変更と同様に。

   AES-CMAC achieves a security goal similar to that of HMAC [RFC-HMAC].
   Since AES-CMAC is based on a symmetric key block cipher, AES, and
   HMAC is based on a hash function, such as SHA-1, AES-CMAC is
   appropriate for information systems in which AES is more readily
   available than a hash function.

AES-CMACはHMAC[RFC-HMAC]のものと同様のセキュリティ目標を達成します。 AES-CMACがブロック暗号、AES、およびHMACに基づいている対称鍵に基づいているので、細切れ肉料理は機能します、SHA-1などのようにAESがハッシュ関数より容易に利用可能である情報システムに、AES-CMACは適切です。

   This memo specifies the authentication algorithm based on CMAC with
   AES-128.  This new authentication algorithm is named AES-CMAC.

このメモはAES-128と共にCMACに基づく認証アルゴリズムを指定します。 この新しい認証アルゴリズムはAES-CMACと命名されます。

Song, et al.                 Informational                      [Page 2]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[2ページ]のRFC4493AES-CMACアルゴリズム2006年6月

2.  Specification of AES-CMAC

2. AES-CMACの仕様

2.1.  Basic Definitions

2.1. 基本的な定義

   The following table describes the basic definitions necessary to
   explain the specification of AES-CMAC.

以下のテーブルはAES-CMACの仕様を説明するのに必要な基本的な定義について説明します。

   x || y          Concatenation.
                   x || y is the string x concatenated with the string
                   y.
                   0000 || 1111 is 00001111.

x|| y連結x|| yはひもyで連結されたストリングxです。 0000 || 1111は00001111です。

   x XOR y         Exclusive-OR operation.
                   For two equal length strings, x and y,
                   x XOR y is their bit-wise exclusive-OR.

x XOR y Exclusive-OR演算。 2の等しい長さストリング、x、およびyのために、x XOR yはそれらのビット的な排他的論理和です。

   ceil(x)         Ceiling function.
                   The smallest integer no smaller than x.
                   ceil(3.5) is 4.  ceil(5) is 5.

ceil(x)天井機能。 x.ceil(3.5)が4ceil(5)であるほどわずかでない最もわずかな整数は5です。

   x << 1          Left-shift of the string x by 1 bit.
                   The most significant bit disappears, and a zero
                   comes into the least significant bit.
                   10010001 << 1 is 00100010.

1のストリングxのx<<1の左シフトに噛み付きました。 最も重要なビットは見えなくなります、そして、ゼロは最下位ビットに入ります。 10010001 <<1は00100010です。

   0^n             The string that consists of n zero-bits.
                   0^3 means 000 in binary format.
                   10^4 means 10000 in binary format.
                   10^i means 1 followed by i-times repeated
                   zeros.

0^n、nゼロ・ビットから成るストリング。 0^3はバイナリフォーマットで000を意味します。 10^4はバイナリフォーマットで10000を意味します。 i-回があとに続いた10^i手段1はゼロを繰り返しました。

   MSB(x)          The most-significant bit of the string x.
                   MSB(10010000) means 1.

ストリングxのMSB(x)最も多くの重要なビット。 MSB(10010000)は1を意味します。

   padding(x)      10^i padded output of input x.
                   It is described in detail in section 2.4.

(x)10^iを水増しすると、入力xの出力は水増しされました。 それはセクション2.4で詳細に説明されます。

   Key             128-bit (16-octet) long key for AES-128.
                   Denoted by K.

(16八重奏)の主要な128ビットのAES-128に、長いキー。 Kで、指示されます。

   First subkey    128-bit (16-octet) long first subkey,
                   derived through the subkey
                   generation algorithm from the key K.
                   Denoted by K1.

K1によって主要なK.Denotedからサブキー世代アルゴリズムで引き出された(16八重奏)の長い最初のサブキーの最初の128ビットのサブキー。

Song, et al.                 Informational                      [Page 3]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[3ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   Second subkey   128-bit (16-octet) long second subkey,
                   derived through the subkey
                   generation algorithm from the key K.
                   Denoted by K2.

ケーツーによって主要なK.Denotedからサブキー世代アルゴリズムで引き出された(16八重奏)の長いサブキーの2番目の128ビットの2番目のサブキー。

   Message         A message to be authenticated.
                   Denoted by M.
                   The message can be null, which means that the length
                   of M is 0.

認証されるべきメッセージAメッセージ。 M.によって指示されて、メッセージはヌルである場合があります(Mの長さが0であることを意味します)。

   Message length  The length of the message M in octets.
                   Denoted by len.
                   The minimum value of the length can be 0.  The
                   maximum value of the length is not specified in
                   this document.

長さを通信させてください。八重奏における、メッセージMの長さ。 lenによって指示されます。 長さの最小値は0であるかもしれません。 長さの最大値は本書では指定されません。

   AES-128(K,M)    AES-128(K,M) is the 128-bit ciphertext of AES-128
                   for a 128-bit key, K, and a 128-bit message, M.

AES-128(K、M)AES-128(K、M)は128ビットのキーのためのAES-128、K、および128ビットのメッセージの128ビットの暗号文、Mです。

   MAC             A 128-bit string that is the output of AES-CMAC.
                   Denoted by T.
                   Validating the MAC provides assurance of the
                   integrity and authenticity of the message from
                   the source.

MAC、AES-CMACの出力であるAの128ビット列。 T.Validatingによって指示されて、MACはソースから保全の保証とメッセージの信憑性を提供します。

   MAC length      By default, the length of the output of AES-CMAC is
                   128 bits.  It is possible to truncate the MAC.
                   The result of the truncation should be taken in most
                   significant bits first order.  The MAC length must be
                   specified before the communication starts, and
                   it must not be changed during the lifetime of the
                   key.

MACの長さのByはデフォルトとして、AES-CMACの出力の長さは128ビットです。 MACに先端を切らせるのは可能です。 トランケーションの結果は中に入れている最上位ビットに最初に注文されるということであるべきです。 コミュニケーションが始まって、キーの生涯それを変えてはいけない前にMACの長さを指定しなければなりません。

2.2.  Overview

2.2. 概観

   AES-CMAC uses the Advanced Encryption Standard [NIST-AES] as a
   building block.  To generate a MAC, AES-CMAC takes a secret key, a
   message of variable length, and the length of the message in octets
   as inputs and returns a fixed-bit string called a MAC.

AES-CMACはブロックとしてエー・イー・エス[NIST-AES]を使用します。 AES-CMACは、Macを発生させるように、入力として秘密鍵、可変長の伝言、および八重奏における、メッセージの長さをみなして、MACと呼ばれる固定ビット列を返します。

   The core of AES-CMAC is the basic CBC-MAC.  For a message, M, to be
   authenticated, the CBC-MAC is applied to M.  There are two cases of
   operation in CMAC.  Figure 2.1 illustrates the operation of CBC-MAC
   in both cases.  If the size of the input message block is equal to a
   positive multiple of the block size (namely, 128 bits), the last
   block shall be exclusive-OR'ed with K1 before processing.  Otherwise,
   the last block shall be padded with 10^i (notation is described in
   section 2.1) and exclusive-OR'ed with K2.  The result of the previous

AES-CMACのコアは基本的なCBC-MACです。 メッセージ、認証されるべきMに関してCBC-MACはM.に適用されます。ThereはCMACの操作に関する2つのケースです。 図2.1はどちらの場合も、CBC-MACの操作を例証します。 入力メッセージブロックのサイズがブロック・サイズ(すなわちと、128ビット)の陽の倍数と等しいなら、最後のブロックは処理の前のK1をもってexclusive-OR'edになるでしょう。 さもなければ、最後のブロックは10^i(記法はセクション2.1で説明される)とexclusive-OR'edと共にケーツーで水増しされるものとします。 前の結果

Song, et al.                 Informational                      [Page 4]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[4ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   process will be the input of the last encryption.  The output of
   AES-CMAC provides data integrity of the whole input message.

過程は最後の暗号化の入力になるでしょう。 AES-CMACの出力は全体の入力メッセージのデータ保全を提供します。

 +-----+     +-----+     +-----+     +-----+     +-----+     +---+----+
 | M_1 |     | M_2 |     | M_n |     | M_1 |     | M_2 |     |M_n|10^i|
 +-----+     +-----+     +-----+     +-----+     +-----+     +---+----+
    |           |           |   +--+    |           |           |   +--+
    |     +--->(+)    +--->(+)<-|K1|    |     +--->(+)    +--->(+)<-|K2|
    |     |     |     |     |   +--+    |     |     |     |     |   +--+
 +-----+  |  +-----+  |  +-----+     +-----+  |  +-----+  |  +-----+
 |AES_K|  |  |AES_K|  |  |AES_K|     |AES_K|  |  |AES_K|  |  |AES_K|
 +-----+  |  +-----+  |  +-----+     +-----+  |  +-----+  |  +-----+
    |     |     |     |     |           |     |     |     |     |
    +-----+     +-----+     |           +-----+     +-----+     |
                            |                                   |
                         +-----+                              +-----+
                         |  T  |                              |  T  |
                         +-----+                              +-----+

+-----+ +-----+ +-----+ +-----+ +-----+ +---+----+ | M_1| | M_2| | M| | M_1| | M_2| |M|10^i| +-----+ +-----+ +-----+ +-----+ +-----+ +---+----+ | | | +--+ | | | +--+ | +--->(+) +--->(+)<、-、|K1| | +--->(+) +--->(+)<、-、|ケーツー| | | | | | +--+ | | | | | +--+ +-----+ | +-----+ | +-----+ +-----+ | +-----+ | +-----+ |AES_K| | |AES_K| | |AES_K| |AES_K| | |AES_K| | |AES_K| +-----+ | +-----+ | +-----+ +-----+ | +-----+ | +-----+ | | | | | | | | | | +-----+ +-----+ | +-----+ +-----+ | | | +-----+ +-----+ | T| | T| +-----+ +-----+

             (a) positive multiple block length         (b) otherwise

(a) 正数複数のブロック長(b)、そうではありませんさ

          Figure 2.1.  Illustration of the two cases of AES-CMAC

図2.1。 2つのケースのAES-CMACのイラスト

   AES_K is AES-128 with key K.
   The message M is divided into blocks M_1,...,M_n,
   where M_i is the i-th message block.
   The length of M_i is 128 bits for i = 1,...,n-1, and
   the length of the last block, M_n, is less than or equal to 128 bits.
   K1 is the subkey for the case (a), and
   K2 is the subkey for the case (b).
   K1 and K2 are generated by the subkey generation algorithm
   described in section 2.3.

AES_KはキーK.があるAES-128です。メッセージMはブロックM_1に分割されます…M_iがそうであるM、i、-、メッセージ第ブロック。 M_iの長さはi=1のための128ビットです…n-1、および最後のブロック、Mの長さは128ビット以下です。 K1はケース(a)のためのサブキーです、そして、ケーツーはケース(b)のためのサブキーです。 K1とケーツーはセクション2.3で説明されたサブキー世代アルゴリズムで発生します。

2.3.  Subkey Generation Algorithm

2.3. サブキー世代アルゴリズム

   The subkey generation algorithm, Generate_Subkey(), takes a secret
   key, K, which is just the key for AES-128.

サブキー世代アルゴリズム(Generate_Subkey())は秘密鍵、Kを取ります。(それは、ただAES-128のためのキーです)。

   The outputs of the subkey generation algorithm are two subkeys, K1
   and K2.  We write (K1,K2) := Generate_Subkey(K).

サブキー世代アルゴリズムの出力は、2個のサブキーと、K1とケーツーです。 私たちは書きます。(K1、ケーツー):=は_Subkey(K)を発生させます。

   Subkeys K1 and K2 are used in both MAC generation and MAC
   verification algorithms.  K1 is used for the case where the length of
   the last block is equal to the block length.  K2 is used for the case
   where the length of the last block is less than the block length.

サブキーK1とケーツーはMAC世代とMAC検証アルゴリズムの両方で使用されます。K1は最後のブロックの長さがブロック長と等しいケースに使用されます。 ケーツーは最後のブロックの長さがブロック長より少ないケースに使用されます。

Song, et al.                 Informational                      [Page 5]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[5ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   Figure 2.2 specifies the subkey generation algorithm.

図2.2はサブキー世代アルゴリズムを指定します。

   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                    Algorithm Generate_Subkey                      +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                                                                   +
   +   Input    : K (128-bit key)                                      +
   +   Output   : K1 (128-bit first subkey)                            +
   +              K2 (128-bit second subkey)                           +
   +-------------------------------------------------------------------+
   +                                                                   +
   +   Constants: const_Zero is 0x00000000000000000000000000000000     +
   +              const_Rb   is 0x00000000000000000000000000000087     +
   +   Variables: L          for output of AES-128 applied to 0^128    +
   +                                                                   +
   +   Step 1.  L := AES-128(K, const_Zero);                           +
   +   Step 2.  if MSB(L) is equal to 0                                +
   +            then    K1 := L << 1;                                  +
   +            else    K1 := (L << 1) XOR const_Rb;                   +
   +   Step 3.  if MSB(K1) is equal to 0                               +
   +            then    K2 := K1 << 1;                                 +
   +            else    K2 := (K1 << 1) XOR const_Rb;                  +
   +   Step 4.  return K1, K2;                                         +
   +                                                                   +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Algorithm Generate_Subkey + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + Input : + +が出力したK(128ビットのキー): K1(128ビットの最初のサブキー)++ケーツー(2番目の128ビットのサブキー)++-------------------------------------------------------------------+ + + + 定数: const_Zeroによる0×00000000000000000000000000000000++const_Rbが0×00000000000000000000000000000087の++変数であるということです: AES-128の出力のためのLは+ + + + ステップ1を0^128に適用しました。 L:=AES-128(K、const_ゼロ)。 + + ステップ2はMSB(L)であるなら0++当時のK1:=L<<1と等しいです。 + + K1のほかの:=(L<<1)XOR const_Rb。 MSB(K1)があるなら、+ + ステップ3は+ + 次に、0ケーツーと:=K1<<1と等しいです。 + + ケーツーのほかの:=(K1<<1)XOR const_Rb。 + + 4リターンK1、Stepケーツー。 + + + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                Figure 2.2.  Algorithm Generate_Subkey

図2.2。 アルゴリズムは_サブキーを発生させます。

   In step 1, AES-128 with key K is applied to an all-zero input block.

ステップ1では、キーKがあるAES-128はオールゼロ入力ブロックに適用されます。

   In step 2, K1 is derived through the following operation:

ステップ2では、K1は以下の操作で引き出されます:

   If the most significant bit of L is equal to 0, K1 is the left-shift
   of L by 1 bit.

Lの最も重要なビットが0と等しいなら、K1はLの1ビットの左シフトです。

   Otherwise, K1 is the exclusive-OR of const_Rb and the left-shift of L
   by 1 bit.

さもなければ、K1はconst_Rbの排他的論理和とLの1ビットの左シフトです。

   In step 3, K2 is derived through the following operation:

ステップ3では、ケーツーは以下の操作で引き出されます:

   If the most significant bit of K1 is equal to 0, K2 is the left-shift
   of K1 by 1 bit.

K1の最も重要なビットが0と等しいなら、ケーツーはK1の1ビットの左シフトです。

   Otherwise, K2 is the exclusive-OR of const_Rb and the left-shift of
   K1 by 1 bit.

さもなければ、ケーツーは、const_Rbの排他的論理和とK1の1ビットの左シフトです。

   In step 4, (K1,K2) := Generate_Subkey(K) is returned.

ステップ4では、(K1、ケーツー):=はSubkey(K)が返される_を発生させます。

Song, et al.                 Informational                      [Page 6]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[6ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   The mathematical meaning of the procedures in steps 2 and 3,
   including const_Rb, can be found in [OMAC1a].

[OMAC1a]でconst_Rbを含むステップ2と3における手順の数学の意味を見つけることができます。

2.4.  MAC Generation Algorithm

2.4. MAC世代アルゴリズム

   The MAC generation algorithm, AES-CMAC(), takes three inputs, a
   secret key, a message, and the length of the message in octets.  The
   secret key, denoted by K, is just the key for AES-128.  The message
   and its length in octets are denoted by M and len, respectively.  The
   message M is denoted by the sequence of M_i, where M_i is the i-th
   message block.  That is, if M consists of n blocks, then M is written
   as

MAC世代アルゴリズム(AES-CMAC())は八重奏における、メッセージの3つの入力、秘密鍵、伝言、および長さを受け取ます。 Kによって指示された秘密鍵はただAES-128のためのキーです。 メッセージと八重奏におけるその長さはMとlenによってそれぞれ指示されます。 メッセージMがM_iの系列によって指示される、i、-、メッセージ第ブロック。そこでは、M_iがそうです。 すなわち、Mがnブロックから成るなら、Mとして書かれます。

    -   M = M_1 || M_2 || ... || M_{n-1} || M_n

- M=M_1|| M_2|| ... || _M n-1|| M

   The length of M_i is 128 bits for i = 1,...,n-1, and the length of
   the last block M_n is less than or equal to 128 bits.

M_iの長さはi=1のための128ビットです…n-1、および最後のブロックMの長さはそうです。128ビット以下。

   The output of the MAC generation algorithm is a 128-bit string,
   called a MAC, which is used to validate the input message.  The MAC
   is denoted by T, and we write T := AES-CMAC(K,M,len).  Validating the
   MAC provides assurance of the integrity and authenticity of the
   message from the source.

MAC世代アルゴリズムの出力は入力メッセージを有効にするのに使用されるMACと呼ばれる128ビット列です。 MACはTによって指示されます、そして、私たちはT:=AES-CMAC(K、M、len)に書きます。 MACを有効にすると、保全の保証とメッセージの信憑性はソースから提供されます。

   It is possible to truncate the MAC.  According to [NIST-CMAC], at
   least a 64-bit MAC should be used as protection against guessing
   attacks.  The result of truncation should be taken in most
   significant bits first order.

MACに先端を切らせるのは可能です。 [NIST-CMAC]に従って、推測に対する保護が攻撃されるとき、少なくとも64ビットのMACは使用されるべきです。 トランケーションの結果は中に入れている最上位ビットに最初に注文されるということであるべきです。

   The block length of AES-128 is 128 bits (16 octets).  There is a
   special treatment if the length of the message is not a positive
   multiple of the block length.  The special treatment is to pad M with
   the bit-string 10^i to adjust the length of the last block up to the
   block length.

AES-128のブロック長は128ビット(16の八重奏)です。 特別な処理がメッセージの長さがブロック長の陽の倍数でないならあります。 特別な処理はブロック長までの最後のブロックの長さを調整するためにビット列10^iでMを水増しすることです。

   For an input string x of r-octets, where 0 <= r < 16, the padding
   function, padding(x), is defined as follows:

r-八重奏の入力ストリングxにおいて、(x)を水増しして、詰め物機能は以下の通り定義されます:(そこでは、0<がr<16と等しいです)。

   -   padding(x) = x || 10^i      where i is 128-8*r-1

- (x)を水増しするのはxと等しいです。|| iが128-8*r-1である10^i

   That is, padding(x) is the concatenation of x and a single '1',
   followed by the minimum number of '0's, so that the total length is
   equal to 128 bits.

すなわち、(x)を水増しするのは、xの連結と単一の''の0最小の数が全長が128ビットと等しいようにあとに続いた1''です。

   Figure 2.3 describes the MAC generation algorithm.

図2.3はMAC世代アルゴリズムを説明します。

Song, et al.                 Informational                      [Page 7]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[7ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                   Algorithm AES-CMAC                              +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                                                                   +
   +   Input    : K    ( 128-bit key )                                 +
   +            : M    ( message to be authenticated )                 +
   +            : len  ( length of the message in octets )             +
   +   Output   : T    ( message authentication code )                 +
   +                                                                   +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +   Constants: const_Zero is 0x00000000000000000000000000000000     +
   +              const_Bsize is 16                                    +
   +                                                                   +
   +   Variables: K1, K2 for 128-bit subkeys                           +
   +              M_i is the i-th block (i=1..ceil(len/const_Bsize))   +
   +              M_last is the last block xor-ed with K1 or K2        +
   +              n      for number of blocks to be processed          +
   +              r      for number of octets of last block            +
   +              flag   for denoting if last block is complete or not +
   +                                                                   +
   +   Step 1.  (K1,K2) := Generate_Subkey(K);                         +
   +   Step 2.  n := ceil(len/const_Bsize);                            +
   +   Step 3.  if n = 0                                               +
   +            then                                                   +
   +                 n := 1;                                           +
   +                 flag := false;                                    +
   +            else                                                   +
   +                 if len mod const_Bsize is 0                       +
   +                 then flag := true;                                +
   +                 else flag := false;                               +
   +                                                                   +
   +   Step 4.  if flag is true                                        +
   +            then M_last := M_n XOR K1;                             +
   +            else M_last := padding(M_n) XOR K2;                    +
   +   Step 5.  X := const_Zero;                                       +
   +   Step 6.  for i := 1 to n-1 do                                   +
   +                begin                                              +
   +                  Y := X XOR M_i;                                  +
   +                  X := AES-128(K,Y);                               +
   +                end                                                +
   +            Y := M_last XOR X;                                     +
   +            T := AES-128(K,Y);                                     +
   +   Step 7.  return T;                                              +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

アルゴリズム..入力 K(128ビットのキー)++: M(認証されるべきメッセージ)++: + +が出力したlen(八重奏における、メッセージの長さ): メッセージ確認コード..定数 const_Zeroによる0×00000000000000000000000000000000++const_Bsizeが16の++++変数であるということです: K1、128ビットのサブキー++M_のためのケーツー、i、-、+ + 最後にブロック(i=1..ceil(len/const_Bsize))+ + M_はK1に伴うxor教育の最後のブロックであるかケーツーがブロックの数が処理されて、最後のブロック++の八重奏の数が指示するのにもかかわらずの、最後のブロックまで弛むので+ + rが完全ですが、+ + + + ステップ1が完全でないということであるn第ブロックです。 (K1、ケーツー) := _サブキー(K)を発生させてください。 + + ステップ2n:=ceil(len/const_Bsize)。 + + ステップ3はnであるなら0++当時の++n:=1と等しいです。 + +は:=に虚偽で旗を揚げさせます。 次に、lenモッズconst_Bsizeであるなら、+ + ++はほかの本当に0++旗:=です。 + +はほかの:=に虚偽で旗を揚げさせます。 ++++ステップ4 旗であるなら、_最後の本当の++ 次に、M:=M XOR K1はそうです。 + + Mほかの_は(M) XOR K2を水増しする:=を持続します。 + + ステップ5。 X:=const_ゼロ。 n-1へのi:=1が+ +をするので、+ + ステップ6は+ + Y:=X XOR M_iを始めます。 + + X:=AES-128(K、Y)。 _最後の++終わりの+ + Y:=M XOR X。 + + T:=AES-128(K、Y)。 + + ステップ7リターンT。 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                      Figure 2.3.  Algorithm AES-CMAC

図2.3。 アルゴリズムAES-CMAC

Song, et al.                 Informational                      [Page 8]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[8ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   In step 1, subkeys K1 and K2 are derived from K through the subkey
   generation algorithm.

ステップ1では、サブキーK1とケーツーはKからサブキー世代アルゴリズムで引き出されます。

   In step 2, the number of blocks, n, is calculated.  The number of
   blocks is the smallest integer value greater than or equal to the
   quotient determined by dividing the length parameter by the block
   length, 16 octets.

ステップ2では、ブロックの数(n)は計算されます。 ブロックの数は最も小さい整数値です。ブロック長(16の八重奏)で商は、長さのパラメタを分割しながら、より自決しました。

   In step 3, the length of the input message is checked.  If the input
   length is 0 (null), the number of blocks to be processed shall be 1,
   and the flag shall be marked as not-complete-block (false).
   Otherwise, if the last block length is 128 bits, the flag is marked
   as complete-block (true); else mark the flag as not-complete-block
   (false).

ステップ3では、入力メッセージの長さはチェックされます。 入力の長さが0(ヌル)であるなら、処理されるべきブロックの数は1になるでしょう、そして、旗はブロックを完成していないとして(誤った)マークされるものとします。 さもなければ、最後のブロック長が128ビットであるなら、旗は同じくらいブロックする(本当の)と完全なマークされます。 ほか、ブロックを完成していないとしての旗が(誤っている)であるとマークしてください。

   In step 4, M_last is calculated by exclusive-OR'ing M_n and one of
   the previously calculated subkeys.  If the last block is a complete
   block (true), then M_last is the exclusive-OR of M_n and K1.
   Otherwise, M_last is the exclusive-OR of padding(M_n) and K2.

ステップ4では、M_は最後にexclusive-OR'ing Mと以前に計算されたサブキーのひとりによって計算されます。 最後のブロックが完全なブロック(本当の)であるなら、M_最終はMとK1の排他的論理和です。 さもなければ、最後にM_は(M)とケーツーを水増しする排他的論理和です。

   In step 5, the variable X is initialized.

ステップ5では、変数Xは初期化されます。

   In step 6, the basic CBC-MAC is applied to M_1,...,M_{n-1},M_last.

ステップ6では、基本的なCBC-MACはM_1に適用されます…M_n-1、M_最終。

   In step 7, the 128-bit MAC, T := AES-CMAC(K,M,len), is returned.

ステップ7では、128ビットのMac(T:=AES-CMAC(K、M、len))を返します。

   If necessary, the MAC is truncated before it is returned.

必要なら、それを返す前にMACは端が欠けています。

2.5.  MAC Verification Algorithm

2.5. MAC検証アルゴリズム

   The verification of the MAC is simply done by a MAC recomputation.
   We use the MAC generation algorithm, which is described in section
   2.4.

MAC recomputationは単にMACの検証を完了しています。 私たちはMAC世代アルゴリズムを使用します。(それは、セクション2.4で説明されます)。

   The MAC verification algorithm, Verify_MAC(), takes four inputs, a
   secret key, a message, the length of the message in octets, and the
   received MAC.  These are denoted by K, M, len, and T', respectively.

MAC検証アルゴリズム(Verify_MAC())は4つの入力、秘密鍵、メッセージ、八重奏における、メッセージの長さ、および容認されたMACを受け取ます。 'これらはK、M、len、およびT'によってそれぞれ指示されます。

   The output of the MAC verification algorithm is either INVALID or
   VALID.

MAC検証アルゴリズムの出力は、INVALIDかVALIDのどちらかです。

   Figure 2.4 describes the MAC verification algorithm.

図2.4はMAC検証アルゴリズムを説明します。

Song, et al.                 Informational                      [Page 9]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[9ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                      Algorithm Verify_MAC                         +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   +                                                                   +
   +   Input    : K    ( 128-bit Key )                                 +
   +            : M    ( message to be verified )                      +
   +            : len  ( length of the message in octets )             +
   +            : T'   ( the received MAC to be verified )             +
   +   Output   : INVALID or VALID                                     +
   +                                                                   +
   +-------------------------------------------------------------------+
   +                                                                   +
   +   Step 1.  T* := AES-CMAC(K,M,len);                               +
   +   Step 2.  if T* is equal to T'                                   +
   +            then                                                   +
   +                 return VALID;                                     +
   +            else                                                   +
   +                 return INVALID;                                   +
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Algorithm Verify_MAC + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + Input : K(128ビットのキー)++: M(確かめられるべきメッセージ)++: len(八重奏における、メッセージの長さ)++: '+ +が出力したT'(確かめられるべき容認されたMAC): 無効の、または、有効な++++-------------------------------------------------------------------+ + + + ステップ1。 T*:=AES-CMAC(K、M、len)。 '+ + ステップ2はT*であるなら+ + + + 次に、T'リターンVALIDと等しいです。 + + ++リターンほかのINVALID。 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                    Figure 2.4.  Algorithm Verify_MAC

図2.4。 アルゴリズムは_MACについて確かめます。

   In step 1, T* is derived from K, M, and len through the MAC
   generation algorithm.

ステップ1では、T*はK、M、およびlenからMAC世代アルゴリズムで引き出されます。

   In step 2, T* and T' are compared.  If T* is equal to T', then return
   VALID; otherwise return INVALID.

'ステップ2では、T*とT'は比較されます。 'T*はTと等しい'なら、VALIDを返してください。 さもなければ、INVALIDを返してください。

   If the output is INVALID, then the message is definitely not
   authentic, i.e., it did not originate from a source that executed the
   generation process on the message to produce the purported MAC.

メッセージが出力がINVALIDであるなら確実に正統でない、すなわち、それは主張されたMACを生産するメッセージで発生経過を実行したソースから発しませんでした。

   If the output is VALID, then the design of the AES-CMAC provides
   assurance that the message is authentic and, hence, was not corrupted
   in transit; however, this assurance, as for any MAC algorithm, is not
   absolute.

出力がVALIDであるなら、AES-CMACのデザインは、メッセージが正統であるという保証を提供して、したがって、トランジットで崩壊しませんでした。 しかしながら、どんなMACアルゴリズムのようにも、この保証は絶対ではありません。

3.  Security Considerations

3. セキュリティ問題

   The security provided by AES-CMAC is built on the strong
   cryptographic algorithm AES.  However, as is true with any
   cryptographic algorithm, part of its strength lies in the secret key,
   K, and the correctness of the implementation in all of the
   participating systems.  If the secret key is compromised or
   inappropriately shared, it guarantees neither authentication nor
   integrity of message at all.  The secret key shall be generated in a
   way that meets the pseudo randomness requirement of RFC 4086
   [RFC4086] and should be kept safe.  If and only if AES-CMAC is used

AES-CMACによって提供されたセキュリティは強い暗号アルゴリズムAESで築き上げられます。 どんな暗号アルゴリズムでも本当です、参加システムのすべての実現の秘密鍵、K、および正当性に強さの一部があります。しかしながら、キーが秘密であるなら妥協するということであるか不適当に共有されるように、それは認証も全くメッセージの保全も保証しません。 秘密鍵は、RFC4086[RFC4086]に関する疑似偶発性必要条件を満たす方法で発生して、安全に保たれるべきです。 AES-CMACは単に使用されています。

Song, et al.                 Informational                     [Page 10]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[10ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   properly it provides the authentication and integrity that meet the
   best current practice of message authentication.

適切に、それは通報認証の最も良い現在の習慣に会う認証と保全を提供します。

4.  Test Vectors

4. テストベクトル

   The following test vectors are the same as those of [NIST-CMAC].  The
   following vectors are also the output of the test program in Appendix
   A.

以下のテストベクトルは[NIST-CMAC]のものと同じです。 また、以下のベクトルはAppendix Aでのテストプログラムの出力です。

   --------------------------------------------------
   Subkey Generation
   K              2b7e1516 28aed2a6 abf71588 09cf4f3c
   AES-128(key,0) 7df76b0c 1ab899b3 3e42f047 b91b546f
   K1             fbeed618 35713366 7c85e08f 7236a8de
   K2             f7ddac30 6ae266cc f90bc11e e46d513b
   --------------------------------------------------

-------------------------------------------------- サブキーGeneration K2b7e1516 28aed2a6 abf71588 09cf4f3c AES-128(キー、0)7df76b0c 1ab899b3 3e42f047 b91b546f K1 fbeed618 35713366 7c85e08f 7236a8deケーツーf7ddac30 6ae266cc f90bc11e e46d513b--------------------------------------------------

   --------------------------------------------------
   Example 1: len = 0
   M              <empty string>
   AES-CMAC       bb1d6929 e9593728 7fa37d12 9b756746
   --------------------------------------------------

-------------------------------------------------- 例1: lenは0Mの<の空のストリング>AES-CMAC bb1d6929 e9593728 7fa37d12 9b756746と等しいです。--------------------------------------------------

   Example 2: len = 16
   M              6bc1bee2 2e409f96 e93d7e11 7393172a
   AES-CMAC       070a16b4 6b4d4144 f79bdd9d d04a287c
   --------------------------------------------------

例2: lenは16Mの6bc1bee2 2e409f96 e93d7e11 7393172a AES-CMAC 070a16b4 6b4d4144 f79bdd9d d04a287cと等しいです。--------------------------------------------------

   Example 3: len = 40
   M              6bc1bee2 2e409f96 e93d7e11 7393172a
                  ae2d8a57 1e03ac9c 9eb76fac 45af8e51
                  30c81c46 a35ce411
   AES-CMAC       dfa66747 de9ae630 30ca3261 1497c827
   --------------------------------------------------

例3: lenは40Mの6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c9eb76fac 45af8e51 30c81c46a35ce411 AES-CMAC dfa66747 de9ae630 30ca3261 1497c827と等しいです。--------------------------------------------------

   Example 4: len = 64
   M              6bc1bee2 2e409f96 e93d7e11 7393172a
                  ae2d8a57 1e03ac9c 9eb76fac 45af8e51
                  30c81c46 a35ce411 e5fbc119 1a0a52ef
                  f69f2445 df4f9b17 ad2b417b e66c3710
   AES-CMAC       51f0bebf 7e3b9d92 fc497417 79363cfe
   --------------------------------------------------

例4: lenは64Mの6bc1bee2 2e409f96 e93d7e11 7393172a ae2d8a57 1e03ac9c9eb76fac 45af8e51 30c81c46 a35ce411 e5fbc119 1a0a52ef f69f2445 df4f9b17 ad2b417b e66c3710AES-CMAC 51f0bebf 7e3b9d92 fc497417 79363cfeと等しいです。--------------------------------------------------

Song, et al.                 Informational                     [Page 11]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[11ページ]のRFC4493AES-CMACアルゴリズム2006年6月

5.  Acknowledgement

5. 承認

   Portions of the text herein are borrowed from [NIST-CMAC].  We
   appreciate the OMAC1 authors, the SP 800-38B author, and Russ Housley
   for his useful comments and guidance, which have been incorporated
   herein.  We also thank Alfred Hoenes for many useful comments.  This
   memo was prepared while Tetsu Iwata was at Ibaraki University, Japan.

[NIST-CMAC]からテキストの部分をここに借ります。 私たちは彼の役に立つコメントと指導のためにOMAC1作者、SP800-38B作者、およびラスHousleyに感謝します。(それは、ここに法人組織でした)。 また、私たちは多くの役に立つコメントについてアルフレッドHoenesに感謝します。 Tetsu磐田が茨木大学、日本にいた間、このメモは準備されました。

   We acknowledge the support from the following grants:  Collaborative
   Technology Alliance (CTA) from US Army Research Laboratory, DAAD19-
   01-2-0011; Presidential Award from Army Research Office, W911NF-05-
   1-0491; NSF CAREER ANI-0093187.  Results do not reflect any position
   of the funding agencies.

私たちは以下の交付金からサポートを承諾します: 米陸軍研究所、DAAD19 01-2-0011からの協力的な技術同盟(CTA)。 陸軍研究オフィスからの大統領の賞、W911NF-05- 1-0491。 NSFキャリア阿仁-0093187。 結果は年金基金積立機関の少しの位置も反映しません。

6.  References

6. 参照

6.1.  Normative References

6.1. 引用規格

   [NIST-CMAC] NIST, Special Publication 800-38B, "Recommendation for
               Block Cipher Modes of Operation: The CMAC Mode for
               Authentication", May 2005.

[NIST-CMAC]NIST、特別な公表800-38B、「ブロックのための推薦は運転モードを解きます」。 「認証のためのCMACモード」は2005がそうするかもしれません。

   [NIST-AES]  NIST, FIPS 197, "Advanced Encryption Standard (AES)",
               November 2001.
               http://csrc.nist.gov/publications/fips/fips197/fips-
               197.pdf

[NIST-AES]NIST、FIPS197、「エー・イー・エス(AES)」11月2001日の http://csrc.nist.gov/publications/fips/fips197/fips- 197.pdf

   [RFC4086]   Eastlake, D., 3rd, Schiller, J., and S. Crocker,
               "Randomness Requirements for Security", BCP 106, RFC
               4086, June 2005.

[RFC4086]イーストレークとD.と3番目、シラー、J.とS.クロッカー、「セキュリティのための偶発性要件」BCP106、2005年6月のRFC4086。

6.2.  Informative References

6.2. 有益な参照

   [RFC-HMAC]  Krawczyk, H., Bellare, M., and R. Canetti, "HMAC:
               Keyed-Hashing for Message Authentication", RFC 2104,
               February 1997.

[RFC-HMAC] Krawczyk、H.、Bellare、M.、およびR.カネッティ、「HMAC:」 「通報認証のための合わせられた論じ尽くす」RFC2104、1997年2月。

   [OMAC1a]    Tetsu Iwata and Kaoru Kurosawa, "OMAC: One-Key CBC MAC",
               Fast Software Encryption, FSE 2003, LNCS 2887, pp. 129-
               153, Springer-Verlag, 2003.

[OMAC1a] Tetsu磐田とKaoru黒沢、「OMAC:」 「1主要なCBC MAC」、Fast Software Encryption、FSE2003、LNCS2887、ページ 129- 153、追出石-Verlag、2003。

   [OMAC1b]    Tetsu Iwata and Kaoru Kurosawa, "OMAC: One-Key CBC MAC",
               Submission to NIST, December 2002.  Available from the
               NIST modes of operation web site at
               http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/
               omac/omac-spec.pdf

[OMAC1b] Tetsu磐田とKaoru黒沢、「OMAC:」 「1主要なCBC MAC」、NIST、2002年12月への服従。 http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/ omac/omac-spec.pdfのNIST運転モードウェブサイトから、利用可能です。

Song, et al.                 Informational                     [Page 12]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[12ページ]のRFC4493AES-CMACアルゴリズム2006年6月

   [XCBCa]     John Black and Phillip Rogaway, "A Suggestion for
               Handling Arbitrary-Length Messages with the CBC MAC",
               NIST Second Modes of Operation Workshop, August 2001.
               Available from the NIST modes of operation web site at
               http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/
               xcbc-mac/xcbc-mac-spec.pdf

操作ワークショップ(2001年8月)の[XCBCa]のジョンBlackとフィリップRogaway、「CBC Macがある取り扱い任意の長さのメッセージのための提案」のNISTの第2モード。 http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/ xcbc-mac/xcbc-mac-spec.pdfのNIST運転モードウェブサイトから、利用可能です。

   [XCBCb]     John Black and Phillip Rogaway, "CBC MACs for Arbitrary-
               Length Messages: The Three-Key Constructions", Journal of
               Cryptology, Vol. 18, No. 2, pp. 111-132, Springer-Verlag,
               Spring 2005.

[XCBCb] ジョンBlackとフィリップRogaway、「任意の長さのためのCBC MACsは通信します」。 「Three主要なConstructions」、Cryptology、Vol.18、No.2、ページのJournal 111-132、追出石-Verlagは2005を跳ばせます。

Song, et al.                 Informational                     [Page 13]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[13ページ]のRFC4493AES-CMACアルゴリズム2006年6月

Appendix A.  Test Code

付録A.テスト・コード

  This C source is designed to generate the test vectors that appear in
  this memo to verify correctness of the algorithm.  The source code is
  not intended for use in commercial products.

このCソースは、アルゴリズムの正当性について確かめるこのメモに現れるテストベクトルを発生させるように設計されています。 ソースコードは商品における使用のために意図しません。

  /****************************************************************/
  /* AES-CMAC with AES-128 bit                                    */
  /* CMAC     Algorithm described in SP800-38B                    */
  /* Author: Junhyuk Song (junhyuk.song@samsung.com)              */
  /*         Jicheol Lee  (jicheol.lee@samsung.com)               */
  /****************************************************************/

ビット..説明..作者 歌..リー

  #include <stdio.h>

#<stdio.h>を含めてください。

  /* For CMAC Calculation */
  unsigned char const_Rb[16] = {
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
  };
  unsigned char const_Zero[16] = {
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  };

0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、CMAC Calculation*/無記名の炭のconst_Rb[16]のための/*=0×87。 0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、0×00、無記名の炭のconst_Zero[16]=0×00。

  /* Basic Functions */

/*基本機能*/

  void xor_128(unsigned char *a, unsigned char *b, unsigned char *out)
  {
      int i;
      for (i=0;i<16; i++)
      {
          out[i] = a[i] ^ b[i];
      }
  }

空のxor_128(無記名の炭*a、無記名の炭*b、無記名の炭*アウト)(i=0; i<16; i++)のためのint i、出かけている[i]=a[i]^b[i]。

  void print_hex(char *str, unsigned char *buf, int len)
  {
      int     i;

空の印刷_十六進法(炭*str、無記名の炭*buf、int len)、int i。

      for ( i=0; i<len; i++ ) {
          if ( (i % 16) == 0 && i != 0 ) printf(str);
          printf("%02x", buf[i]);
          if ( (i % 4) == 3 ) printf(" ");
          if ( (i % 16) == 15 ) printf("\n");
      }
      if ( (i % 16) != 0 ) printf("\n");
  }

for ( i=0; i<len; i++ ) { if ( (i % 16) == 0 && i != 0 ) printf(str); printf("%02x", buf[i]); if ( (i % 4) == 3 ) printf(" "); if ( (i % 16) == 15 ) printf("\n"); } if ( (i % 16) != 0 ) printf("\n"); }

Song, et al.                 Informational                     [Page 14]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[14ページ]のRFC4493AES-CMACアルゴリズム2006年6月

  void print128(unsigned char *bytes)
  {
      int         j;
      for (j=0; j<16;j++) {
          printf("%02x",bytes[j]);
          if ( (j%4) == 3 ) printf(" ");
      }
  }

空のprint128(無記名の炭*バイト)(j=0; j<16; j++)のためのint j、printf、(「%02x」、バイト[j])、((j%4)=3)printfである、(「「)、;、」

  void print96(unsigned char *bytes)
  {
      int         j;
      for (j=0; j<12;j++) {
          printf("%02x",bytes[j]);
          if ( (j%4) == 3 ) printf(" ");
      }
  }

空のprint96(無記名の炭*バイト)(j=0; j<12; j++)のためのint j、printf、(「%02x」、バイト[j])、((j%4)=3)printfである、(「「)、;、」

  /* AES-CMAC Generation Function */

/*AES-CMAC世代機能*/

  void leftshift_onebit(unsigned char *input,unsigned char *output)
  {
      int         i;
      unsigned char overflow = 0;

leftshift_onebit(*が入力した無記名の炭、無記名の炭*出力)を欠如させてください、int i(無記名の炭のオーバーフロー=0)

      for ( i=15; i>=0; i-- ) {
          output[i] = input[i] << 1;
          output[i] |= overflow;
          overflow = (input[i] & 0x80)?1:0;
      }
      return;
  }

出力[i]=入力[i]<<1; 出力[i]| =オーバーフロー; (i=15; i>=0(i))オーバーフロー=(入力[i]と0×80)(1:0)のために、戻ってください。 }

  void generate_subkey(unsigned char *key, unsigned char *K1, unsigned
                       char *K2)
  {
      unsigned char L[16];
      unsigned char Z[16];
      unsigned char tmp[16];
      int i;

空間が_サブキー(無記名の炭*の主要で、無記名の炭*K1、無記名の炭*ケーツー)を発生させる、無記名の炭のL[16]; 無記名の炭のZ[16]; 無記名の炭のtmp[16](int i)

      for ( i=0; i<16; i++ ) Z[i] = 0;

(i=0; i<16; i++)Z[i]=0のために。

      AES_128(key,Z,L);

AES_128(キー、Z、L)。

      if ( (L[0] & 0x80) == 0 ) { /* If MSB(L) = 0, then K1 = L << 1 */
          leftshift_onebit(L,K1);
      } else {    /* Else K1 = ( L << 1 ) (+) Rb */

((L[0]と0×80)=0)である、/は*MSB(L)であるならonebit(L、K1)にLの<の<の1*/leftshiftの0、当時のK1=_と等しいです;、ほか、/*ほかのK1はRb*/と等しいです(L<<1)(+)。

Song, et al.                 Informational                     [Page 15]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[15ページ]のRFC4493AES-CMACアルゴリズム2006年6月

          leftshift_onebit(L,tmp);
          xor_128(tmp,const_Rb,K1);
      }

leftshift_onebit(L、tmp)。 xor_128(tmp、const_Rb、K1)。 }

      if ( (K1[0] & 0x80) == 0 ) {
          leftshift_onebit(K1,K2);
      } else {
          leftshift_onebit(K1,tmp);
          xor_128(tmp,const_Rb,K2);
      }
      return;
  }

((K1[0]と0×80)=0) leftshift_onebit(K1、ケーツー); leftshift_onebit(K1、tmp); xor_128(tmp、Rb、const_ケーツー);ほかのリターン。 }

  void padding ( unsigned char *lastb, unsigned char *pad, int length )
  {
      int         j;

詰め物を欠如させてください、(無記名の炭*lastb、無記名の炭*パッド、intの長さ)int j。

      /* original last block */
      for ( j=0; j<16; j++ ) {
          if ( j < length ) {
              pad[j] = lastb[j];
          } else if ( j == length ) {
              pad[j] = 0x80;
          } else {
              pad[j] = 0x00;
          }
      }
  }

(j=0; j<16; j++)のための最後の/*オリジナルのブロック*/、(j<の長さ)である、パッド[j]=lastb[j];、ほか、(j=長さ)である、パッド[j]=0x80;、ほか、パッド[j]=0x00。

  void AES_CMAC ( unsigned char *key, unsigned char *input, int length,
                  unsigned char *mac )
  {
      unsigned char       X[16],Y[16], M_last[16], padded[16];
      unsigned char       K1[16], K2[16];
      int         n, i, flag;
      generate_subkey(key,K1,K2);

AES_CMAC(主要で、無記名の炭*が入力した無記名の炭*、intの長さ、無記名の炭*のmac)を欠如させてください、無記名の炭のX[16]、Y[16](M_最終[16])は[16]; 無記名の炭のK1[16]、ケーツー[16]; int nを水増ししました、i、旗; _サブキー(キー、K1、ケーツー)を発生させてください。

      n = (length+15) / 16;       /* n is number of rounds */

nは/16と等しいです(長さ+15)。 /*nはラウンド*/の数です。

      if ( n == 0 ) {
          n = 1;
          flag = 0;
      } else {
          if ( (length%16) == 0 ) { /* last block is a complete block */
              flag = 1;
          } else { /* last block is not complete block */
              flag = 0;
          }

ほかの(n=0)n=1(旗の=0)である、((長さの%16)=0)である、*が最後に妨げる/はa完全なブロック*/旗の=1です;、ほか*が最後に妨げる/は完全なブロック*/旗の=0ではありません。

Song, et al.                 Informational                     [Page 16]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[16ページ]のRFC4493AES-CMACアルゴリズム2006年6月

      }

}

      if ( flag ) { /* last block is complete block */
          xor_128(&input[16*(n-1)],K1,M_last);
      } else {
          padding(&input[16*(n-1)],padded,length%16);
          xor_128(padded,K2,M_last);
      }

(旗)である、*が最後に妨げる/は完全なブロック*/xor_128です(入力[16*(n-1)]、K1、M_は持続します);、ほか詰め物([16*(n-1)]長さの%16をそっと歩いて、入力してください)(xor_128(そっと歩いて、ケーツー、M_は持続します))

      for ( i=0; i<16; i++ ) X[i] = 0;
      for ( i=0; i<n-1; i++ ) {
          xor_128(X,&input[16*i],Y); /* Y := Mi (+) X  */
          AES_128(key,Y,X);      /* X := AES-128(KEY, Y); */
      }

(i=0; i<16; i++)X[i]=0のために。 (i=0; i<n-1; i++)のためにxor_128(X、および入力[16*i]、Y); /*Y:=マイル(+)X*/AES_128(キー、Y、X); /*X:=AES-128(キー、Y); */

      xor_128(X,M_last,Y);
      AES_128(key,Y,X);

xor_128(Y、X、M_は持続します)。 AES_128(キー、Y、X)。

      for ( i=0; i<16; i++ ) {
          mac[i] = X[i];
      }
  }

(i=0; i<16; i++)、mac[i]=X[i]。

  int main()
  {
      unsigned char L[16], K1[16], K2[16], T[16], TT[12];
      unsigned char M[64] = {
          0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96,
          0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,
          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c,
          0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,
          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11,
          0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,
          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
          0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10
      };
      unsigned char key[16] = {
          0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
          0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c
      };

無記名の炭のkey16は0x2b、0x7e、0×15、0×16、0×28、0xae、0xd2、0xa6、0xab、0xf7、0×15、0×88、0×09、0xcf、0x4f、0x3cと等しいです。

      printf("--------------------------------------------------\n");
      printf("K              "); print128(key); printf("\n");

printf("--------------------------------------------------\n"); printf(「K」)。 print128(キー)。 printf(「\n」)。

      printf("\nSubkey Generation\n");
      AES_128(key,const_Zero,L);
      printf("AES_128(key,0) "); print128(L); printf("\n");
      generate_subkey(key,K1,K2);

printf(「\nSubkey世代\n」)。 AES_128(キー、const_ゼロ、L)。 printf(「AES_128(キー、0)」)。 print128(L)。 printf(「\n」)。 _サブキー(キー、K1、ケーツー)を発生させてください。

Song, et al.                 Informational                     [Page 17]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[17ページ]のRFC4493AES-CMACアルゴリズム2006年6月

      printf("K1             "); print128(K1); printf("\n");
      printf("K2             "); print128(K2); printf("\n");

printf("K1")。 print128(K1)。 printf(「\n」)。 printf(「ケーツー」)。 print128(ケーツー)。 printf(「\n」)。

      printf("\nExample 1: len = 0\n");
      printf("M              "); printf("<empty string>\n");

printf(「nExample1: \lenは0円のnと等しいです」)。 printf(「M」)。 printf(「<空のストリング>\n」)。

      AES_CMAC(key,M,0,T);
      printf("AES_CMAC       "); print128(T); printf("\n");

AES_CMAC(キー、M、0、T)。 printf(「AES_CMAC」)。 print128(T)。 printf(「\n」)。

      printf("\nExample 2: len = 16\n");
      printf("M              "); print_hex("                ",M,16);
      AES_CMAC(key,M,16,T);
      printf("AES_CMAC       "); print128(T); printf("\n");
      printf("\nExample 3: len = 40\n");
      printf("M              "); print_hex("               ",M,40);
      AES_CMAC(key,M,40,T);
      printf("AES_CMAC       "); print128(T); printf("\n");

printf(「nExample2: \lenは16円のnと等しいです」)。 printf(「M」)。 印刷_十六進法、(「「M、16);、」 AES_CMAC(キー、M、16、T)。 printf(「AES_CMAC」)。 print128(T)。 printf(「\n」)。 printf(「nExample3: \lenは40円のnと等しいです」)。 printf(「M」)。 印刷_十六進法、(「「M、40);、」 AES_CMAC(キー、M、40、T)。 printf(「AES_CMAC」)。 print128(T)。 printf(「\n」)。

      printf("\nExample 4: len = 64\n");
      printf("M              "); print_hex("               ",M,64);
      AES_CMAC(key,M,64,T);
      printf("AES_CMAC       "); print128(T); printf("\n");

printf(「nExample4: \lenは64円のnと等しいです」)。 printf(「M」)。 印刷_十六進法、(「「M、64);、」 AES_CMAC(キー、M、64、T)。 printf(「AES_CMAC」)。 print128(T)。 printf(「\n」)。

      printf("--------------------------------------------------\n");

printf("--------------------------------------------------\n");

      return 0;
  }

リターン0。 }

Song, et al.                 Informational                     [Page 18]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[18ページ]のRFC4493AES-CMACアルゴリズム2006年6月

Authors' Addresses

作者のアドレス

  Junhyuk Song
  University of Washington
  Samsung Electronics

Junhyuk歌のワシントン大学三星電子

  Phone: (206) 853-5843
  EMail: songlee@ee.washington.edu, junhyuk.song@samsung.com

以下に電話をしてください。 (206) 853-5843 メールしてください: songlee@ee.washington.edu 、junhyuk.song@samsung.com

  Jicheol Lee
  Samsung Electronics

Jicheolリー三星電子

  Phone: +82-31-279-3605
  EMail: jicheol.lee@samsung.com

以下に電話をしてください。 +82-31-279-3605 メールしてください: jicheol.lee@samsung.com

  Radha Poovendran
  Network Security Lab
  University of Washington

ラダPoovendranネットワークセキュリティ研究室ワシントン大学

  Phone: (206) 221-6512
  EMail: radha@ee.washington.edu

以下に電話をしてください。 (206) 221-6512 メールしてください: radha@ee.washington.edu

  Tetsu Iwata
  Nagoya University

Tetsu磐田名古屋大学

  EMail: iwata@cse.nagoya-u.ac.jp

メール: iwata@cse.nagoya-u.ac.jp

Song, et al.                 Informational                     [Page 19]

RFC 4493                 The AES-CMAC Algorithm                June 2006

歌、他 情報[19ページ]のRFC4493AES-CMACアルゴリズム2006年6月

Full Copyright Statement

完全な著作権宣言文

   Copyright (C) The Internet Society (2006).

Copyright(C)インターネット協会(2006)。

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

このドキュメントはBCP78に含まれた権利、ライセンス、および制限を受けることがあります、そして、そこに詳しく説明されるのを除いて、作者は彼らのすべての権利を保有します。

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

このドキュメントと「そのままで」という基礎と貢献者、その人が代表する組織で提供するか、または後援されて、インターネット協会とインターネット・エンジニアリング・タスク・フォースはすべての保証を放棄します、と急行ORが含意したということであり、他を含んでいて、ここに含まれて、情報の使用がここに侵害しないどんな保証も少しもまっすぐになるという情報か市場性か特定目的への適合性のどんな黙示的な保証。

Intellectual Property

知的所有権

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

IETFはどんなIntellectual Property Rightsの正当性か範囲、実現に関係すると主張されるかもしれない他の権利、本書では説明された技術の使用またはそのような権利の下におけるどんなライセンスも利用可能であるかもしれない、または利用可能でないかもしれない範囲に関しても立場を全く取りません。 または、それはそれを表しません。どんなそのような権利も特定するためのどんな独立している努力もしました。 BCP78とBCP79でRFCドキュメントの権利に関する手順に関する情報を見つけることができます。

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

IPR公開のコピーが利用可能に作られるべきライセンスの保証、または一般的な免許を取得するのが作られた試みの結果をIETF事務局といずれにもしたか、または http://www.ietf.org/ipr のIETFのオンラインIPR倉庫からこの仕様のimplementersかユーザによるそのような所有権の使用のために許可を得ることができます。

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.

IETFはこの規格を実行するのに必要であるかもしれない技術をカバーするかもしれないどんな著作権もその注目していただくどんな利害関係者、特許、特許出願、または他の所有権も招待します。 ietf-ipr@ietf.org のIETFに情報を記述してください。

Acknowledgement

承認

   Funding for the RFC Editor function is provided by the IETF
   Administrative Support Activity (IASA).

RFC Editor機能のための基金はIETF Administrative Support Activity(IASA)によって提供されます。

Song, et al.                 Informational                     [Page 20]

歌、他 情報[20ページ]

一覧

 RFC 1〜100  RFC 1401〜1500  RFC 2801〜2900  RFC 4201〜4300 
 RFC 101〜200  RFC 1501〜1600  RFC 2901〜3000  RFC 4301〜4400 
 RFC 201〜300  RFC 1601〜1700  RFC 3001〜3100  RFC 4401〜4500 
 RFC 301〜400  RFC 1701〜1800  RFC 3101〜3200  RFC 4501〜4600 
 RFC 401〜500  RFC 1801〜1900  RFC 3201〜3300  RFC 4601〜4700 
 RFC 501〜600  RFC 1901〜2000  RFC 3301〜3400  RFC 4701〜4800 
 RFC 601〜700  RFC 2001〜2100  RFC 3401〜3500  RFC 4801〜4900 
 RFC 701〜800  RFC 2101〜2200  RFC 3501〜3600  RFC 4901〜5000 
 RFC 801〜900  RFC 2201〜2300  RFC 3601〜3700  RFC 5001〜5100 
 RFC 901〜1000  RFC 2301〜2400  RFC 3701〜3800  RFC 5101〜5200 
 RFC 1001〜1100  RFC 2401〜2500  RFC 3801〜3900  RFC 5201〜5300 
 RFC 1101〜1200  RFC 2501〜2600  RFC 3901〜4000  RFC 5301〜5400 
 RFC 1201〜1300  RFC 2601〜2700  RFC 4001〜4100  RFC 5401〜5500 
 RFC 1301〜1400  RFC 2701〜2800  RFC 4101〜4200 

スポンサーリンク

「ID」や「ID_xxxx」という文字列があるCSVファイルをExcelで開くとSYLKエラーが出る

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る