RFC1319 日本語訳

1319 The MD2 Message-Digest Algorithm. B. Kaliski. April 1992. (Format: TXT=25661 bytes) (Status: INFORMATIONAL)
プログラムでの自動翻訳です。
RFC一覧
英語原文

Network Working Group                                         B. Kaliski
Request for Comments: 1319                              RSA Laboratories
Updates: RFC 1115                                             April 1992

Kaliskiがコメントのために要求するワーキンググループB.をネットワークでつないでください: 1319のRSA研究所アップデート: RFC1115 1992年4月

                     The MD2 Message-Digest Algorithm

MD2メッセージダイジェストアルゴリズム

Status of this Memo

このMemoの状態

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

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

Acknowlegements

Acknowlegements

   The description of MD2 is based on material prepared by John Linn and
   Ron Rivest.  Their permission to incorporate that material is greatly
   appreciated.

MD2の記述はジョン・リンとロンRivestによって準備された材料に基づいています。 その材料を組み込むそれらの許可に大いに感謝します。

Table of Contents

目次

   1. Executive Summary                                                1
   2. Terminology and Notation                                         2
   3. MD2 Algorithm Description                                        2
   4. Summary                                                          4
   References                                                          5
   APPENDIX A - Reference Implementation                               5
   Security Considerations                                            17
   Author's Address                                                   17

1. 要約1 2。 用語と記法2 3。 MD2アルゴリズム記述2 4。 概要4参照5付録A--リファレンスインプリメンテーション5セキュリティ問題17作者のアドレス17

1. Executive Summary

1. 要約

   This document describes the MD2 message-digest algorithm. The
   algorithm takes as input a message of arbitrary length and produces
   as output a 128-bit "fingerprint" or "message digest" of the input.
   It is conjectured that it is computationally infeasible to produce
   two messages having the same message digest, or to produce any
   message having a given prespecified target message digest. The MD2
   algorithm is intended for digital signature applications, where a
   large file must be "compressed" in a secure manner before being
   signed with a private (secret) key under a public-key cryptosystem
   such as RSA.

このドキュメントはMD2メッセージダイジェストアルゴリズムを説明します。 アルゴリズムは、任意の長さに関するメッセージを入力するとき取って、入力の128ビットの「指紋」か「メッセージダイジェスト」を出力するとき、作成されます。 同じメッセージダイジェストを持っている2つのメッセージを出すか、または与えられた前指定された目標メッセージダイジェストを持っているどんなメッセージも出すのが計算上実行不可能であると推測されます。 MD2アルゴリズムはデジタル署名アプリケーションのために意図します。そこでは、RSAなどの公開カギ暗号系の下の個人的な(秘密の)キーで署名される前に大きいファイルが安全な方法で「圧縮されなければなりません」。

   License to use MD2 is granted for non-commerical Internet Privacy-
   Enhanced Mail [1-3].

インターネットPrivacyが高めた非商用メール[1-3]のためにMD2を使用するライセンスを与えます。

   This document is an update to the August 1989 RFC 1115 [3], which
   also gives a reference implementation of MD2. The main differences

このドキュメントは1989年1115年8月のRFC[3]への最新版です。(また、[3]はMD2の参照実現を与えます)。 主な違い

Kaliski                                                         [Page 1]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[1ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

   are that a textual description of MD2 is included, and that the
   reference implementation of MD2 is more portable.

それは含まれていたMD2の原文の記述です、そして、参照はそのような記述です。MD2の実現は、より携帯用です。

   For OSI-based applications, MD2's object identifier is

OSIベースのアプリケーションのために、MD2の物の識別子はそうです。

   md2 OBJECT IDENTIFIER ::=
   iso(1) member-body(2) US(840) rsadsi(113549) digestAlgorithm(2) 2}

md2 OBJECT IDENTIFIER:、:= iso(1)は(2) 米国(840)rsadsi(113549) digestAlgorithm(2)2をメンバーと同じくらい具体化させます。

   In the X.509 type AlgorithmIdentifier [4], the parameters for MD2
   should have type NULL.

X.509タイプAlgorithmIdentifier[4]では、MD2のためのパラメタはタイプNULLを持つべきです。

2. Terminology and Notation

2. 用語と記法

   In this document, a "byte" is an eight-bit quantity.

本書では、1「バイト」が8ビットの量です。

   Let x_i denote "x sub i". If the subscript is an expression, we
   surround it in braces, as in x_{i+1}. Similarly, we use ^ for
   superscripts (exponentiation), so that x^i denotes x to the i-th
   power.

「x潜水艦i」を指示させてください。 添字が表現であるなら、私たちはx_i+1のように支柱でそれを囲みます。 同様に、私たちが上付き文字(羃法)のための^、x^私がxを指示するそうを使用する、i、-、第パワー。

   Let X xor Y denote the bit-wise XOR of X and Y.

X xor YにXとYのビット的なXORを指示させてください。

3. MD2 Algorithm Description

3. MD2アルゴリズム記述

   We begin by supposing that we have a b-byte message as input, and
   that we wish to find its message digest. Here b is an arbitrary
   nonnegative integer; b may be zero, and it may be arbitrarily large.
   We imagine the bytes of the message written down as follows:

私たちにはb-バイトメッセージが入力されるようにあって、メッセージダイジェストを見つけたいと思うと思うことによって、私たちは始めます。 ここで、bは任意の非負整数です。 bはゼロであるかもしれません、そして、それは任意に大きいかもしれません。 私たちは以下の通り書き留められたメッセージのバイトを想像します:

                   m_0 m_1 ... m_{b-1}

_1…mのm_0mの_b-1

   The following five steps are performed to compute the message digest
   of the message.

以下の5ステップは、メッセージのメッセージダイジェストを計算するために実行されます。

3.1 Step 1. Append Padding Bytes

3.1 ステップ1。 詰め物バイトを追加してください。

   The message is "padded" (extended) so that its length (in bytes) is
   congruent to 0, modulo 16. That is, the message is extended so that
   it is a multiple of 16 bytes long. Padding is always performed, even
   if the length of the message is already congruent to 0, modulo 16.

メッセージが「そっと歩いている」ので(拡張)、長さ(バイトによる)は0、法16に一致しています。 すなわち、メッセージが拡張されているので、それは16バイト長の倍数です。 詰め物はメッセージの長さが既に0に一致していてもいつも実行された法16です。

   Padding is performed as follows: "i" bytes of value "i" are appended
   to the message so that the length in bytes of the padded message
   becomes congruent to 0, modulo 16. At least one byte and at most 16
   16 bytes are appended.

詰め物は以下の通り実行されます: そっと歩いているメッセージのバイトで表現される長さは「i」バイトの価値「i」をメッセージに追加するので、0に一致するようになります、法16。 少なくとも1バイトと高々16 16バイトしか追加されません。

   At this point the resulting message (after padding with bytes) has a
   length that is an exact multiple of 16 bytes. Let M[0 ... N-1] denote

ここに、結果として起こるメッセージ(バイトでそっと歩いた後の)には、16バイトの正確な倍数である長さがあります。 [0…N-1]が指示するMをさせてください。

Kaliski                                                         [Page 2]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[2ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

   the bytes of the resulting message, where N is a multiple of 16.

結果として起こるメッセージのバイト。そこでは、Nが16の倍数です。

3.2 Step 2. Append Checksum

3.2 ステップ2。 チェックサムを追加してください。

   A 16-byte checksum of the message is appended to the result of the
   previous step.

メッセージの16バイトのチェックサムを前のステップの結果に追加します。

   This step uses a 256-byte "random" permutation constructed from the
   digits of pi. Let S[i] denote the i-th element of this table. The
   table is given in the appendix.

このステップはパイのケタから構成された256バイトの「無作為」の順列を使用します。 S[i]に指示させる、i、-、このテーブルの第要素。 付録でテーブルを与えます。

   Do the following:

以下をしてください:

      /* Clear checksum. */
      For i = 0 to 15 do:
         Set C[i] to 0.
      end /* of loop on i */

/*明確なチェックサム。 *0〜iのための/=15は以下をします。 i*/に0 輪の終わり/*にC[i]を設定してください。

      Set L to 0.

0にLを設定してください。

      /* Process each 16-word block. */
      For i = 0 to N/16-1 do

/*はそれぞれの16単語のブロックを処理します。 *0〜N/16-1がするi=のための/

         /* Checksum block i. */
         For j = 0 to 15 do
            Set c to M[i*16+j].
            Set C[j] to S[c xor L].
            Set L to C[j].
          end /* of loop on j */
       end /* of loop on i */

/*チェックサムブロックi。 *0〜jのための/=15はM[i*16+j]にSet cをします。 S[c xor L]にC[j]を設定してください。 i*/に輪のj*/終わり/*にC[j]輪の終わり/*にLを設定してください。

   The 16-byte checksum C[0 ... 15] is appended to the message. Let M[0
   with checksum), where N' = N + 16.

16バイトのチェックサムC、[0 .15] メッセージに追加します。 'M[チェックサムがある0)をさせてください。そこでは、N'がN+16と等しいです。

3.3 Step 3. Initialize MD Buffer

3.3 ステップ3。 MDバッファを初期化してください。

   A 48-byte buffer X is used to compute the message digest. The buffer
   is initialized to zero.

48バイトのバッファXは、メッセージダイジェストを計算するのに使用されます。 バッファはゼロに初期化されます。

Kaliski                                                         [Page 3]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[3ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

3.4 Step 4. Process Message in 16-Byte Blocks

3.4 ステップ4。 16バイトのブロックの過程メッセージ

   This step uses the same 256-byte permutation S as step 2 does.

このステップはステップ2としてのSがする同じ256バイトの順列を使用します。

   Do the following:

以下をしてください:

      /* Process each 16-word block. */
      For i = 0 to N'/16-1 do

/*はそれぞれの16単語のブロックを処理します。 *'N'/16-1への0がするi=のための/

         /* Copy block i into X. */
         For j = 0 to 15 do
            Set X[16+j] to M[i*16+j].
            Set X[32+j] to (X[16+j] xor X[j]).
          end /* of loop on j */

0〜jのためのX.*/への/*コピーブロックi=15はM[i*16+j]にSet X[16+j]をします。 X[32+j]を設定する、(X[16+j]xor X[j])j*/の輪の終わり/*

         Set t to 0.

0にtを設定してください。

         /* Do 18 rounds. */
         For j = 0 to 17 do

/*は18ラウンドをします。 *0〜17がするj=のための/

            /* Round j. */
            For k = 0 to 47 do
               Set t and X[k] to (X[k] xor S[t]).
            end /* of loop on k */

/*ラウンドj。 *0〜kのための/=47がSet tとX[k]をする、(X[k] xor S[t])k*/の輪の終わり/*

            Set t to (t+j) modulo 256.
         end /* of loop on j */

j*/に輪の(t+j)法256終わり/*にtを設定してください。

      end /* of loop on i */

i*/の輪の終わり/*

3.5 Step 5. Output

3.5 ステップ5。 出力

   The message digest produced as output is X[0 ... 15]. That is, we
   begin with X[0], and end with X[15].

メッセージダイジェストが出力がXであるので作成された、[0 .15] すなわち、私たちは、X[0]と共に始まって、X[15]と共に終わります。

   This completes the description of MD2. A reference implementation in
   C is given in the appendix.

これはMD2の記述を終了します。 付録でCでの参照実現を与えます。

4. Summary

4. 概要

   The MD2 message-digest algorithm is simple to implement, and provides
   a "fingerprint" or message digest of a message of arbitrary length.
   It is conjectured that the difficulty of coming up with two messages
   having the same message digest is on the order of 2^64 operations,
   and that the difficulty of coming up with any message having a given
   message digest is on the order of 2^128 operations. The MD2 algorithm
   has been carefully scrutinized for weaknesses. It is, however, a
   relatively new algorithm and further security analysis is of course

MD2メッセージダイジェストアルゴリズムは、実行するのが簡単であり、任意の長さに関するメッセージの「指紋」かメッセージダイジェストを提供します。 2つの^64操作の注文には同じメッセージダイジェストを持っている2つのメッセージを思いつくという困難があって、2つの^128操作の注文に与えられたメッセージダイジェストを持っているどんなメッセージも思いつくという困難があると推測されます。 MD2アルゴリズムは弱点のために慎重に精査されました。 しかしながら、それは比較的新しいアルゴリズムです、そして、さらなる証券分析はもちろんそのようなアルゴリズムです。

Kaliski                                                         [Page 4]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[4ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

   justified, as is the case with any new proposal of this sort.

ケースのように、この種類のどんな新規案件でも正当です。

References

参照

   [1] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part
       I -- Message Encipherment and Authentication Procedures", RFC
       1113, DEC,  IAB Privacy Task Force, August 1989.

[1] リン、J.、「インターネット電子メールのためのプライバシー増進:」 「Iを分けてください--暗号文と認証手順を通信させてください」、RFC1113、1989年12月、IABプライバシー特別委員会、8月。

   [2] Kent, S., and J. Linn, "Privacy Enhancement for Internet
       Electronic Mail: Part II -- Certificate-Based Key Management",
       RFC 1114, BBNCC, DEC, IAB Privacy Task Force, August 1989.

[2] ケント、S.、およびJ.リン、「インターネット電子メールのためのプライバシー増進:」 「IIを分けてください--証明書ベースのKey Management」、RFC1114、BBNCC、12月、IABプライバシー特別委員会、8月1989

   [3] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part
       III -- Algorithms, Modes, and Identifiers", RFC 1115 DEC, IAB
       Privacy Task Force, August 1989.

[3] リン、J.、「インターネット電子メールのためのプライバシー増進:」 「IIIを分けてください--アルゴリズム、モード、および識別子」、1115年のRFC12月、IABプライバシー特別委員会、8月1989

   [4] CCITT Recommendation X.509 (1988), "The Directory -
       Authentication Framework".

[4] CCITT推薦X.509(1988)、「ディレクトリ--認証、枠組み、」

APPENDIX A - Reference Implementation

付録A--リファレンスインプリメンテーション

   This appendix contains the following files taken from RSAREF: A
   Cryptographic Toolkit for Privacy-Enhanced Mail:

この付録はRSAREFから取られた以下のファイルを含んでいます: プライバシーで高められたメールのための暗号のツールキット:

     global.h -- global header file

global.h--グローバルなヘッダーファイル

     md2.h -- header file for MD2

md2.h--MD2のためのヘッダーファイル

     md2c.c -- source code for MD2

md2c.c--MD2のためのソースコード

For more information on RSAREF, send email to <rsaref@rsa.com>.

RSAREFの詳しい情報に関しては、メール to <rsaref@rsa.com を送ってください、gt。

The appendix also includes the following file:

また、付録は以下のファイルを含んでいます:

     mddriver.c -- test driver for MD2, MD4 and MD5

mddriver.c--MD2、MD4、およびMD5のためのテスト・ドライバ

The driver compiles for MD5 by default but can compile for MD2 or MD4 if
the symbol MD is defined on the C compiler command line as 2 or 4.

ドライバーは、MD5のためにデフォルトでコンパイルしますが、シンボルMDがCコンパイラコマンドラインで2か4と定義されるなら、MD2かMD4のためにコンパイルできます。

A.1 global.h

A.1 global.h

/* GLOBAL.H - RSAREF types and constants
 */

/*GLOBAL.H--RSAREFタイプと定数*/

/* PROTOTYPES should be set to one if and only if the compiler supports
     function argument prototyping.
   The following makes PROTOTYPES default to 0 if it has not already
     been defined with C compiler flags.

そして、/*PROTOTYPESが1つに用意ができるべきである、コンパイラが機能議論プロトタイピングを支持する場合にだけ。 以下で、それがCコンパイラ旗で既に定義されていないなら、PROTOTYPESは0をデフォルトとします。

Kaliski                                                         [Page 5]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[5ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

 */
#ifndef PROTOTYPES
#define PROTOTYPES 0
#endif

*/#ifndef原型#は原型0#endifを定義します。

/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;

/*POINTERは一般的なポインター型*/typedefの無記名の炭*POINTERを定義します。

/* UINT2 defines a two byte word */
typedef unsigned short int UINT2;

/*UINT2は2バイトの単語*/typedefの無記名の短いint UINT2を定義します。

/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;

/*UINT4は4バイトの単語*/typedefの無記名の長いint UINT4を定義します。

/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
   If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
     returns an empty list.
 */
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif

PROTOTYPESが上でどう定義されるかによって、/*プロト_LISTは定義されます。 PROTOTYPESを使用するなら、プロト_LISTはリストを返します。さもなければ、それは空のリストを返します。 *#PROTOTYPES#がプロト_LISTの(記載します)リスト#のほかの#、を定義するなら、/はプロト_LIST(リスト)()#endifを定義します。

A.2 md2.h

A.2 md2.h

/* MD2.H - header file for MD2C.C
 */

/*MD2.H--MD2C.C*/のためのヘッダーファイル

/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
   rights reserved.

/*著作権(C)1990-2、RSA Data Security Inc.は1990を作成しました。 All rights reserved。

   License to copy and use this software is granted for
   non-commercial Internet Privacy-Enhanced Mail provided that it is
   identified as the "RSA Data Security, Inc. MD2 Message Digest
   Algorithm" in all material mentioning or referencing this software
   or this function.

「RSA Data Security Inc.MD2メッセージダイジェストアルゴリズム」としてそれを特定すれば、非営利的なインターネットPrivacyによって高められたメールのためにこのソフトウェアかこの機能に言及するか、または参照をつけながら、すべての材料の中でこのソフトウェアをコピーして、使用するライセンスを与えます。

   RSA Data Security, Inc. makes no representations concerning either
   the merchantability of this software or the suitability of this
   software for any particular purpose. It is provided "as is"
   without express or implied warranty of any kind.

RSA Data Security Inc.はこのソフトウェアの市場性かどんな特定の目的のためのこのソフトウェアの適合のどちらかに関しても表現を全くしません。 どんな種類の急行も黙示的な保証なしでもそれを「そのままで」提供します。

   These notices must be retained in any copies of any part of this
   documentation and/or software.
 */

このドキュメンテーション、そして/または、ソフトウェアのどんな部分のどんなコピーでもこれらの通知を保有しなければなりません。 */

Kaliski                                                         [Page 6]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[6ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

typedef struct {
  unsigned char state[16];                                 /* state */
  unsigned char checksum[16];                           /* checksum */
  unsigned int count;                 /* number of bytes, modulo 16 */
  unsigned char buffer[16];                         /* input buffer */
} MD2_CTX;

typedef struct無記名の炭の州[16]; /*状態*/無記名の炭のチェックサム[16]; /*チェックサム*/無記名のintカウント; /*バイト数、法の16の*/無記名の炭のバッファ[16];の/*入力バッファ*/MD2_CTX。

void MD2Init PROTO_LIST ((MD2_CTX *));
void MD2Update PROTO_LIST
  ((MD2_CTX *, unsigned char *, unsigned int));
void MD2Final PROTO_LIST ((unsigned char [16], MD2_CTX *));

MD2Initプロト_LIST((MD2_CTX*))を欠如させてください。 MD2Updateプロト_LIST((MD2_CTX*、無記名の炭*、無記名のint))を欠如させてください。 MD2Finalプロト_LIST((無記名の炭[16]、MD2_CTX*))を欠如させてください。

A.3 md2c.c

A.3 md2c.c

/* MD2C.C - RSA Data Security, Inc., MD2 message-digest algorithm
 */

/*MD2C.C--RSA Data Security Inc.、MD2メッセージダイジェストアルゴリズム*/

/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
   rights reserved.

/*著作権(C)1990-2、RSA Data Security Inc.は1990を作成しました。 All rights reserved。

   License to copy and use this software is granted for
   non-commercial Internet Privacy-Enhanced Mail provided that it is
   identified as the "RSA Data Security, Inc. MD2 Message Digest
   Algorithm" in all material mentioning or referencing this software
   or this function.

「RSA Data Security Inc.MD2メッセージダイジェストアルゴリズム」としてそれを特定すれば、非営利的なインターネットPrivacyによって高められたメールのためにこのソフトウェアかこの機能に言及するか、または参照をつけながら、すべての材料の中でこのソフトウェアをコピーして、使用するライセンスを与えます。

   RSA Data Security, Inc. makes no representations concerning either
   the merchantability of this software or the suitability of this
   software for any particular purpose. It is provided "as is"
   without express or implied warranty of any kind.

RSA Data Security Inc.はこのソフトウェアの市場性かどんな特定の目的のためのこのソフトウェアの適合のどちらかに関しても表現を全くしません。 どんな種類の急行も黙示的な保証なしでもそれを「そのままで」提供します。

   These notices must be retained in any copies of any part of this
   documentation and/or software.
 */

このドキュメンテーション、そして/または、ソフトウェアのどんな部分のどんなコピーでもこれらの通知を保有しなければなりません。 */

#include "global.h"
#include "md2.h"

##、が含む"global.h""md2.h"を含めてください。

static void MD2Transform PROTO_LIST
  ((unsigned char [16], unsigned char [16], unsigned char [16]));
static void MD2_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
static void MD2_memset PROTO_LIST ((POINTER, int, unsigned int));

静電気はMD2Transformプロト_LISTを欠如させます。(無記名の炭[16]の、そして、無記名の無記名の炭の[16]は[16]))を炭にします。 静的な空のMD2_memcpyプロト_LIST((POINTER、POINTER、無記名のint))。 静的な空のMD2_memsetプロト_LIST((POINTER、int、無記名のint))。

/* Permutation of 0..255 constructed from the digits of pi. It gives a
   "random" nonlinear byte substitution operation.
 */
static unsigned char PI_SUBST[256] = {
  41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6,

0の/*順列。255 パイのケタから、組み立てられます。 それは「無作為」の非線形のバイト代替操作を与えます。 */静的な無記名の炭のPI_SUBST[256]が等しい、41、46、67、201、162、216、124、1、61、54、84、161、236、240、6

Kaliski                                                         [Page 7]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[7ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

  19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188,
  76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24,
  138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251,
  245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63,
  148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50,
  39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165,
  181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210,
  150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157,
  112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27,
  96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15,
  85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197,
  234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65,
  129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123,
  8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233,
  203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228,
  166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237,
  31, 26, 219, 153, 141, 51, 159, 17, 131, 20
};

19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, 39, 53, 62, 204, 231, 191, 247, 151, 3, 255, 25, 48, 179, 72, 165, 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, 31, 26, 219, 153, 141, 51, 159, 17, 131, 20 };

static unsigned char *PADDING[] = {
  (unsigned char *)"",
  (unsigned char *)"%%BODY%%01",
  (unsigned char *)"%%BODY%%02%%BODY%%02",
  (unsigned char *)"%%BODY%%03%%BODY%%03%%BODY%%03",
  (unsigned char *)"%%BODY%%04%%BODY%%04%%BODY%%04%%BODY%%04",
  (unsigned char *)"%%BODY%%05%%BODY%%05%%BODY%%05%%BODY%%05%%BODY%%05",
  (unsigned char *)"%%BODY%%06%%BODY%%06%%BODY%%06%%BODY%%06%%BODY%%06%%BODY%%06",
  (unsigned char *)"%%BODY%%07%%BODY%%07%%BODY%%07%%BODY%%07%%BODY%%07%%BODY%%07%%BODY%%07",
  (unsigned char *)"%%BODY%%10%%BODY%%10%%BODY%%10%%BODY%%10%%BODY%%10%%BODY%%10%%BODY%%10%%BODY%%10",
  (unsigned char *)"%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11%%BODY%%11",
  (unsigned char *)"%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12%%BODY%%12",
  (unsigned char *)"%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13%%BODY%%13",
  (unsigned char *)"%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14%%BODY%%14",
  (unsigned char *)
    "%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15%%BODY%%15",
  (unsigned char *)
    "%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16%%BODY%%16",
  (unsigned char *)
    "%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17%%BODY%%17",
  (unsigned char *)
    "%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20%%BODY%%20"
};

静的な無記名の炭*PADDING=;

/* MD2 initialization. Begins an MD2 operation, writing a new context.
 */
void MD2Init (context)
MD2_CTX *context;                                        /* context */
{

/*MD2初期化。 新しい関係を書いて、MD2操業を開始します。 */空間MD2Init(文脈)MD2_CTX*文脈。 /*文脈*/

Kaliski                                                         [Page 8]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[8ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

  context->count = 0;
  MD2_memset ((POINTER)context->state, 0, sizeof (context->state));
  MD2_memset
    ((POINTER)context->checksum, 0, sizeof (context->checksum));
}

文脈->が数えられた=0。 MD2_memset(POINTER)、文脈->が述べる、0、sizeof、(文脈->が述べる、)、。 MD2_memset(POINTER)、文脈->、チェックサム、0、sizeof、(文脈->、チェックサム、)、。 }

/* MD2 block update operation. Continues an MD2 message-digest
     operation, processing another message block, and updating the
     context.
 */
void MD2Update (context, input, inputLen)
MD2_CTX *context;                                        /* context */
unsigned char *input;                                /* input block */
unsigned int inputLen;                     /* length of input block */
{
  unsigned int i, index, partLen;

/*MD2はアップデート操作を妨げます。 別のメッセージブロックを処理して、文脈をアップデートして、MD2メッセージダイジェスト操作を続けています。 */空間MD2Update(文脈、入力、inputLen)MD2_CTX*文脈。 *が入力した/*文脈*/無記名の炭。 /*はブロック*/無記名のint inputLenを入力しました。 入力ブロック*/の/*長さ、無記名のint i、インデックス、partLen。

  /* Update number of bytes mod 16 */
  index = context->count;
  context->count = (index + inputLen) & 0xf;

文脈->が数えられた状態で、/*はバイト数モッズ16*/インデックス=をアップデートします。 文脈->が数えられた=(インデックス+inputLen)と0xf。

  partLen = 16 - index;

partLen=16--索引をつけてください。

  /* Transform as many times as possible.
    */
  if (inputLen >= partLen) {
    MD2_memcpy
      ((POINTER)&context->buffer[index], (POINTER)input, partLen);
    MD2Transform (context->state, context->checksum, context->buffer);

可能な同じくらい何回も/*変換。 */、(inputLen>=partLen)である、MD2_memcpy(POINTER)、文脈->がバッファリングする、[インデックス]、(POINTER) 入力、partLen);、MD2Transform、(文脈->が述べる、文脈->、チェックサム、文脈->がバッファリングする、)、。

    for (i = partLen; i + 15 < inputLen; i += 16)
      MD2Transform (context->state, context->checksum, &input[i]);

(i=partLen; i+15<inputLen; i+=16)MD2Transform、(文脈->が述べる、文脈->、チェックサム、[i])を入力してください、。

    index = 0;
  }
  else
    i = 0;

=0に索引をつけてください。 ほかのi=0。

  /* Buffer remaining input */
  MD2_memcpy
    ((POINTER)&context->buffer[index], (POINTER)&input[i],
     inputLen-i);
}

/*よりもみ皮製の残りが*/MD2_memcpy(POINTER)を入力した、文脈->がバッファリングする、[インデックス]、(POINTER)と入力[i]、inputLen-i)、。 }

/* MD2 finalization. Ends an MD2 message-digest operation, writing the
     message digest and zeroizing the context.
 */
void MD2Final (digest, context)

/*MD2決定。 MD2メッセージダイジェスト操作を終わらせて、メッセージダイジェストを書いて、文脈をゼロ化します。 */空のMD2Final(ダイジェスト、文脈)

Kaliski                                                         [Page 9]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[9ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

unsigned char digest[16];                         /* message digest */
MD2_CTX *context;                                        /* context */
{
  unsigned int index, padLen;

無記名の炭のダイジェスト[16]。 /*メッセージダイジェスト*/MD2_CTX*文脈。 /*文脈*/、無記名のintインデックス、padLen。

  /* Pad out to multiple of 16.
   */
  index = context->count;
  padLen = 16 - index;
  MD2Update (context, PADDING[padLen], padLen);

16の倍数への/*パッド。 *文脈->が数えられた状態で、/は=に索引をつけます。 padLen=16--索引をつけてください。 MD2Update([padLen]、padLenを水増しする文脈)。

  /* Extend with checksum */
  MD2Update (context, context->checksum, 16);

/*がチェックサム*/MD2Updateと共に広がっている、(文脈、文脈->、チェックサム、16)。

  /* Store state in digest */
  MD2_memcpy ((POINTER)digest, (POINTER)context->state, 16);

ダイジェスト*/MD2の_のmemcpy(POINTER)ダイジェストの/*ストア状態、(POINTER)、文脈->が述べる、16)。

  /* Zeroize sensitive information.
   */
  MD2_memset ((POINTER)context, 0, sizeof (*context));
}

/*は機密情報をゼロ化します。 */MD2_memset(POINTER)文脈、0、sizeof(*文脈)。 }

/* MD2 basic transformation. Transforms state and updates checksum
     based on block.
 */
static void MD2Transform (state, checksum, block)
unsigned char state[16];
unsigned char checksum[16];
unsigned char block[16];
{
  unsigned int i, j, t;
  unsigned char x[48];

/*MD2基本的な変化。 状態を変えて、ブロックに基づくチェックサムをアップデートします。 */静的な空のMD2Transform(状態、チェックサム、ブロック)無記名の炭状態[16]。 無記名の炭のチェックサム[16]。 無記名の炭のブロック[16]。 無記名のint i、j、t(無記名の炭のx[48])

  /* Form encryption block from state, block, state ^ block.
   */
  MD2_memcpy ((POINTER)x, (POINTER)state, 16);
  MD2_memcpy ((POINTER)x+16, (POINTER)block, 16);
  for (i = 0; i < 16; i++)
    x[i+32] = state[i] ^ block[i];

状態からの/*フォーム暗号化ブロック、ブロックは^ブロックを述べます。 */MD2_memcpy((ポインタ)x、(ポインタ)状態、16)。 MD2_memcpy((ポインタ)x+16、(ポインタ)ブロック、16)。 (i=0; i<16; i++)に関しては、x[i+32]は状態[i]^ブロック[i]と等しいです。

  /* Encrypt block (18 rounds).
   */
  t = 0;
  for (i = 0; i < 18; i++) {
    for (j = 0; j < 48; j++)
      t = x[j] ^= PI_SUBST[t];
    t = (t + i) & 0xff;
  }

/*はブロック(18ラウンド)をコード化します。 */t=0。 (i=0; i<18; i++)のために(j=0; j<48; j++)に関して、tはx[j]^=PI_SUBST[t]と等しいです; t=(t+i)と0xff

Kaliski                                                        [Page 10]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[10ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

  /* Save new state */
  MD2_memcpy ((POINTER)state, (POINTER)x, 16);

/*は_新しい州*/MD2のmemcpy((POINTER)状態、(POINTER)x、16)を取っておきます。

  /* Update checksum.
   */
  t = checksum[15];
  for (i = 0; i < 16; i++)
    t = checksum[i] ^= PI_SUBST[block[i] ^ t];

/*アップデートチェックサム。 */tはチェックサム[15]と等しいです。 (i=0; i<16; i++)に関しては、t=チェックサム[i]^はPI_SUBSTと等しいです[ブロック[i]^t]。

  /* Zeroize sensitive information.
   */
  MD2_memset ((POINTER)x, 0, sizeof (x));
}

/*は機密情報をゼロ化します。 */MD2_memset(POINTER)x、0、sizeof(x))。 }

/* Note: Replace "for loop" with standard memcpy if possible.
 */
static void MD2_memcpy (output, input, len)
POINTER output;
POINTER input;
unsigned int len;
{
  unsigned int i;

/*注意: できれば、「輪」を標準のmemcpyに取り替えてください。 */静的な空のMD2_memcpy(出力、入力、len)POINTER出力。 POINTER入力。 無記名のint len。 無記名のint i。

  for (i = 0; i < len; i++)
    output[i] = input[i];
}

(i=0; i<len; i++)に関しては、出力[i]は入力[i]と等しいです。 }

/* Note: Replace "for loop" with standard memset if possible.
 */
static void MD2_memset (output, value, len)
POINTER output;
int value;
unsigned int len;
{
  unsigned int i;

/*注意: できれば、「輪」を標準のmemsetに取り替えてください。 */静的な空のMD2_memset(出力、値、len)POINTER出力。 int値。 無記名のint len。 無記名のint i。

  for (i = 0; i < len; i++)
    ((char *)output)[i] = (char)value;
}

(i++) (炭*)が出力したi=0(i<len))のために、[i]は(炭)値と等しいです。 }

A.4 mddriver.c

A.4 mddriver.c

/* MDDRIVER.C - test driver for MD2, MD4 and MD5
 */

/*MDDRIVER.C--MD2、MD4、およびMD5*/のためのテスト・ドライバ

/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
   rights reserved.

/*著作権(C)1990-2、RSA Data Security Inc.は1990を作成しました。 All rights reserved。

Kaliski                                                        [Page 11]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[11ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

   RSA Data Security, Inc. makes no representations concerning either
   the merchantability of this software or the suitability of this
   software for any particular purpose. It is provided "as is"
   without express or implied warranty of any kind.

RSA Data Security Inc.はこのソフトウェアの市場性かどんな特定の目的のためのこのソフトウェアの適合のどちらかに関しても表現を全くしません。 どんな種類の急行も黙示的な保証なしでもそれを「そのままで」提供します。

   These notices must be retained in any copies of any part of this
   documentation and/or software.
 */

このドキュメンテーション、そして/または、ソフトウェアのどんな部分のどんなコピーでもこれらの通知を保有しなければなりません。 */

/* The following makes MD default to MD5 if it has not already been
     defined with C compiler flags.
 */
#ifndef MD
#define MD MD5
#endif

それがCコンパイラで既に定義されていないなら、以下がMD5へのMDデフォルトをする/*は弛みます。 */#ifndef MD#はMD MD5#endifを定義します。

#include <stdio.h>
#include <time.h>
#include <string.h>
#include "global.h"
#if MD == 2
#include "md2.h"
#endif
#if MD == 4
#include "md4.h"
#endif
#if MD == 5
#include "md5.h"
#endif

####MD=5#インクルード"md5.h"#がendifするならMD=4#インクルード"md4.h"#がendifするならMD=2#インクルード"md2.h"#がendifするなら、<stdio.h>#インクルード<time.h>#インクルード<string.h>#インクルード"global.h"を含めてください。

/* Length of test block, number of test blocks.
 */
#define TEST_BLOCK_LEN 1000
#define TEST_BLOCK_COUNT 1000

テストブロックの/*長さ、テストブロックの数。 */#が定義する、テスト_ブロック_LEN1000#、はテスト_ブロック_カウント1000を定義します。

static void MDString PROTO_LIST ((char *));
static void MDTimeTrial PROTO_LIST ((void));
static void MDTestSuite PROTO_LIST ((void));
static void MDFile PROTO_LIST ((char *));
static void MDFilter PROTO_LIST ((void));
static void MDPrint PROTO_LIST ((unsigned char [16]));

静的な空のMDStringプロト_LIST((炭*))。 静的な空のMDTimeTrialプロト_LIST((空間))。 静的な空のMDTestSuiteプロト_LIST((空間))。 静的な空のMDFileプロト_LIST((炭*))。 静的な空のMDFilterプロト_LIST((空間))。 静的な空のMDPrintプロト_LIST、(無記名の炭[16]))。

#if MD == 2
#define MD_CTX MD2_CTX
#define MDInit MD2Init
#define MDUpdate MD2Update
#define MDFinal MD2Final
#endif

#MD=2#、がCTX#が定義するMD_CTX MD2_を定義するならMDInit MD2Init#がMDUpdate MD2Update#を定義する、MDFinal MD2Final#endifを定義してください。

Kaliski                                                        [Page 12]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[12ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

#if MD == 4
#define MD_CTX MD4_CTX
#define MDInit MD4Init
#define MDUpdate MD4Update
#define MDFinal MD4Final
#endif
#if MD == 5
#define MD_CTX MD5_CTX
#define MDInit MD5Init
#define MDUpdate MD5Update
#define MDFinal MD5Final
#endif

#MD=4#、がCTX#が定義するMD_CTX MD4_を定義するならMDInit MD4Init#がMDUpdate MD4Update#を定義する、MDFinal MD4Finalを定義してください、##MD=5#、がCTX#が定義するMD_CTX MD5_を定義するならendifに、MDInit MD5Init#がMDUpdate MD5Update#を定義する、MDFinal MD5Final#endifを定義してください。

/* Main driver.

/*主なドライバー。

   Arguments (may be any combination):
     -sstring - digests string
     -t       - runs time trial
     -x       - runs test script
     filename - digests file
     (none)   - digests standard input
 */
int main (argc, argv)
int argc;
char *argv[];
{
  int i;

主張(どんな組み合わせであるかもしれません): -ダイジェストが-tを結ぶというsstringはタイムトライアル-xを走らせます--走行はスクリプトファイル名をテストします--ダイジェストは(なにも)をファイルします--標準の入力*/intの主な(argc、argv)int argcを読みこなします。 *argv[]を炭にしてください。 int i。

  if (argc > 1)
    for (i = 1; i < argc; i++)
      if (argv[i][0] == '-' && argv[i][1] == 's')
        MDString (argv[i] + 2);
      else if (strcmp (argv[i], "-t") == 0)
        MDTimeTrial ();
      else if (strcmp (argv[i], "-x") == 0)
        MDTestSuite ();
      else
        MDFile (argv[i]);
  else
    MDFilter ();

(i=1; i<argc; i++)のための(argc>1)である、(argv[i][0]=、'--'argv[i][1]='s') MDString(argv[i]+2)。 ほか、(strcmp(argv[i]、"-t")=0)MDTimeTrial()であるなら。 ほか、(strcmp(argv[i]、"-x")=0)MDTestSuite()であるなら。 ほかのMDFile、(argv[i])。 ほかのMDFilter()。

  return (0);
}

リターン(0)。 }

/* Digests a string and prints the result.
 */
static void MDString (string)
char *string;

/*は、ストリングを消化して、結果を印刷します。 */静的な空のMDString(ストリング)は*ストリングを炭にします。

Kaliski                                                        [Page 13]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[13ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

{
  MD_CTX context;
  unsigned char digest[16];
  unsigned int len = strlen (string);

MD_CTX文脈; 無記名の炭のダイジェスト[16]; 無記名のint lenはstrlen(ストリング)と等しいです。

  MDInit (&context);
  MDUpdate (&context, string, len);
  MDFinal (digest, &context);

MDInit(文脈)。 MDUpdate(文脈、ストリング、len)。 MDFinal(ダイジェスト、および文脈)。

  printf ("MD%d (\"%s\") = ", MD, string);
  MDPrint (digest);
  printf ("\n");
}

「printf、(「MD%d、(\、」 %s、\、」、)、等しさ、」、MD、ストリング)、。 MDPrint(ダイジェスト)。 printf(「\n」)。 }

/* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte
     blocks.
 */
static void MDTimeTrial ()
{
  MD_CTX context;
  time_t endTime, startTime;
  unsigned char block[TEST_BLOCK_LEN], digest[16];
  unsigned int i;

/*はCOUNT TEST_BLOCK_LEN-バイトが妨げるTEST_BLOCK_を読みこなす時間を測定します。 */静的な空のMDTimeTrial()、MD_CTX文脈endTime、startTime; 無記名の炭のブロック[TEST_BLOCK_LEN]、ダイジェスト[16]; (時間_t無記名のint i)

  printf
    ("MD%d time trial. Digesting %d %d-byte blocks ...", MD,
     TEST_BLOCK_LEN, TEST_BLOCK_COUNT);

printf(「MD%dはトライアルを調節します。」 「%dバイトが妨げる%dを読みこなします」…, MD、_ブロック_レンをテストしてください、そして、テスト_ブロック_は数えます。);

  /* Initialize block */
  for (i = 0; i < TEST_BLOCK_LEN; i++)
    block[i] = (unsigned char)(i & 0xff);

/*は(i=0; i<TEST_BLOCK_LEN; i++)ブロック[i]=(無記名の炭)(iと0xff)のためのブロック*/を初期化します。

  /* Start timer */
  time (&startTime);

/*スタートタイマ*/時間(startTime)。

  /* Digest blocks */
  MDInit (&context);
  for (i = 0; i < TEST_BLOCK_COUNT; i++)
    MDUpdate (&context, block, TEST_BLOCK_LEN);
  MDFinal (digest, &context);

/*ダイジェストブロック*/MDInit(文脈)。 (i=0; i<TEST_BLOCK_COUNT; i++)MDUpdate(文脈、ブロック、TEST_BLOCK_LEN)のために。 MDFinal(ダイジェスト、および文脈)。

  /* Stop timer */
  time (&endTime);

/*停止タイマ*/時間(endTime)。

  printf (" done\n");
  printf ("Digest = ");
  MDPrint (digest);
  printf ("\nTime = %ld seconds\n", (long)(endTime-startTime));

printf(「\nをします」)。 printf(「ダイジェスト=」)。 MDPrint(ダイジェスト)。 printf((長い間、)(endTime-startTime)「\nTime=%ldは\nを後援します」)。

Kaliski                                                        [Page 14]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[14ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

  printf
    ("Speed = %ld bytes/second\n",
     (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime));
}
/* Digests a reference suite of strings and prints the results.
 */
static void MDTestSuite ()
{
  printf ("MD%d test suite:\n", MD);

printf(「速度は%ldバイト/第2\nと等しい」(長い)のTEST_BLOCK LEN*(長い)のTEST_BLOCK__COUNT/(endTime-startTime))。 } /*は、ストリングの参照スイートを読みこなして、結果を印刷します。 */静的な空のMDTestSuite()、printf(「MD%dはスイート: \nをテストする」MD)。

  MDString ("");
  MDString ("a");
  MDString ("abc");
  MDString ("message digest");
  MDString ("abcdefghijklmnopqrstuvwxyz");
  MDString
    ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
  MDString
    ("1234567890123456789012345678901234567890\
1234567890123456789012345678901234567890");
}

MDString、(「「)、;、」 MDString(“a")。 MDString("abc")。 MDString(「メッセージダイジェスト」)。 MDString("abcdefghijklmnopqrstuvwxyz")。 MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")。 MDString(「1234567890123456789012345678901234567890円の1234567890123456789012345678901234567890」)。 }

/* Digests a file and prints the result.
 */
static void MDFile (filename)
char *filename;
{
  FILE *file;
  MD_CTX context;
  int len;
  unsigned char buffer[1024], digest[16];

/*は、ファイルを読みこなして、結果を印刷します。 */静的な空のMDFile(ファイル名)は*ファイル名を炭にします。 FILE*はファイルします; MD_CTX文脈; int len; 無記名の炭のバッファ[1024]、ダイジェスト[16]

  if ((file = fopen (filename, "rb")) == NULL)
    printf ("%s can't be opened\n", filename);

((ファイル=fopen(ファイル名、"rb"))=NULL)printf(「%sは開かれた\nであるはずがない」、ファイル名)であるなら。

  else {
    MDInit (&context);
    while (len = fread (buffer, 1, 1024, file))
      MDUpdate (&context, buffer, len);
    MDFinal (digest, &context);

ほか、MDInit(文脈); MDUpdate(よりもみ皮製の、そして、lenな関係)をゆったり過ごしてください(len=fread(バッファ、1、1024、ファイル)); MDFinal(ダイジェスト、および文脈)

    fclose (file);

fclose(ファイル)。

    printf ("MD%d (%s) = ", MD, filename);
    MDPrint (digest);
    printf ("\n");
  }
}

printf(「MD%d(%s)=」、MD、ファイル名)。 MDPrint(ダイジェスト)。 printf(「\n」)。 } }

Kaliski                                                        [Page 15]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[15ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

/* Digests the standard input and prints the result.
 */
static void MDFilter ()
{
  MD_CTX context;
  int len;
  unsigned char buffer[16], digest[16];

/*は、標準の入力を読みこなして、結果を印刷します。 */静的な空のMDFilter()、MD_CTX文脈; int len; 無記名の炭のバッファ[16]、ダイジェスト[16]。

  MDInit (&context);
  while (len = fread (buffer, 1, 16, stdin))
    MDUpdate (&context, buffer, len);
  MDFinal (digest, &context);

MDInit(文脈)。 (lenはfread(バッファ、1、16、stdin)と等しいです)MDUpdate(文脈、バッファ、len)である間。 MDFinal(ダイジェスト、および文脈)。

  MDPrint (digest);
  printf ("\n");
}

MDPrint(ダイジェスト)。 printf(「\n」)。 }

/* Prints a message digest in hexadecimal.
 */
static void MDPrint (digest)
unsigned char digest[16];
{
  unsigned int i;

/*は16進でメッセージダイジェストを印刷します。 */静的な空のMDPrint(読みこなす)未署名の炭ダイジェスト[16]。 未署名のint i。

  for (i = 0; i < 16; i++)
    printf ("%02x", digest[i]);
}

(i=0; i<16; i++)はprintfされます。(「%02x」は[i])を読みこなします。 }

A.5 Test suite

A.5テストスイート

   The MD2 test suite (driver option "-x") should print the following
   results:

MD2テストスイート(ドライバーオプション"-x")は以下の結果を印刷するはずです:

MD2 test suite:
MD2 ("") = 8350e5a3e24c153df2275c9f80692773
MD2 ("a") = 32ec01ec4a6dac72c0ab96fb34c0b5d1
MD2 ("abc") = da853b0d3f88d99b30283a69e6ded6bb
MD2 ("message digest") = ab4f496bfb2a530b219ff33031fe06b0
MD2 ("abcdefghijklmnopqrstuvwxyz") = 4e8ddff3650292ab5a4108c3aa47940b
MD2 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =
da33def2a42df13975352846c30338cd
MD2 ("123456789012345678901234567890123456789012345678901234567890123456
78901234567890") = d5976f79d83d3a0dc9806c3c66f3efd8

MD2はスイートをテストします: MD2、(「「)、= da853b0d3f88d99b30283a69e6ded6bb MD2(「メッセージダイジェスト」)=8350e5a3e24c153df2275c9f80692773 MD2(“a")=32ec01ec4a6dac72c0ab96fb34c0b5d1 MD2("abc")=ab4f496bfb2a530b219ff33031fe06b0 MD2("abcdefghijklmnopqrstuvwxyz")=4e8ddff3650292ab5a4108c3aa47940b MD2("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")=da33def2a42df13975352846c30338cd MD2(「123456789012345678901234567890123456789012345678901234567890123456 78901234567890」)がd5976f79d83d3a0dc9806c3c66f3efd8と等しい、」

Kaliski                                                        [Page 16]

RFC 1319              MD2 Message-Digest Algorithm            April 1992

Kaliski[16ページ]RFC1319MD2メッセージダイジェストアルゴリズム1992年4月

Security Considerations

セキュリティ問題

   The level of security discussed in this memo is considered to be
   sufficient for implementing very high security hybrid digital
   signature schemes based on MD2 and a public-key cryptosystem.

セキュリティの非常に高いハイブリッドデジタル署名がMD2に基づく体系と公開鍵暗号系であると実装するのにこのメモで議論したセキュリティのレベルが十分であると考えられます。

Author's Address

作者のアドレス

   Burton S. Kaliski Jr.
   RSA Laboratories (a division of RSA Data Security, Inc.)
   10 Twin Dolphin Drive
   Redwood City, CA  94065

バートンS.Kaliski Jr.RSA研究所(RSA Data Security Inc.の師団) 10 Driveレッドウッドシティー、双子のDolphinカリフォルニア 94065

   Phone: (415) 595-8782
   FAX: (415) 595-4126
   EMail: burt@rsa.com

以下に電話をしてください。 (415) 595-8782 Fax: (415) 595-4126 メールしてください: burt@rsa.com

Kaliski                                                        [Page 17]

Kaliski[17ページ]

一覧

 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 

スポンサーリンク

ディスプレイドライバで問題が発生したため、GPU拡張機能が一時的に無効になりました。』の対処法

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

上に戻る