メインページ | アルファベット順一覧 | 構成 | ファイル一覧 | 構成メンバ | ファイルメンバ | 関連ページ

md_misc.h

#include "dkcOSIndependent.h"

md_misc.hのインクルード依存関係図

このグラフは、どのファイルから直接、間接的にインクルードされているかを示しています。

ソースコードを見る。

構成

struct  DKC_MD5
 MD5 and MD4 structure [詳細]

型定義

typedef void(* DKC_MD_TRANSFORM_F_TYPE )(uint32 buf[4], uint32 const in[16])

列挙型

enum  edkcMessageDigestFlag { edkcMD_Finalized = 1, edkcMD_ByteReverse = 2, edkcMD_Optimize = 4 }
 d金魚 md_misc.h Message Digest algorithm misc [詳細]

関数

DKC_INLINE void dkcMD_ByteReverse (uint8 buf[64], uint32 longs)
 Note: this code is harmless on little-endian machines.
DKC_INLINE void dkcMD_Update (DKC_MD5 *p, uint8 const *buf, uint32 len, DKC_MD_TRANSFORM_F_TYPE transform)
 Update context to reflect the concatenation of another buffer full of bytes.
DKC_INLINE void dkcMD_Final (DKC_MD5 *ctx, DKC_MD_TRANSFORM_F_TYPE transform)
 Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first)

変数

typedef DKC_MD4


型定義

typedef void(* DKC_MD_TRANSFORM_F_TYPE)(uint32 buf[4], uint32 const in[16])
 

md_misc.h21 行で定義されています。


列挙型

enum edkcMessageDigestFlag
 

d金魚 md_misc.h Message Digest algorithm misc

列挙型の値:
edkcMD_Finalized  処理終了フラグ
edkcMD_ByteReverse  エンディアンを変える
edkcMD_Optimize  最適なアルゴリズムを選ぶ

md_misc.h12 行で定義されています。

00012                           {
00014     edkcMD_Finalized = 1,
00016     edkcMD_ByteReverse = 2,
00018     edkcMD_Optimize = 4,
00019 };


関数

DKC_INLINE void dkcMD_ByteReverse uint8  buf[64],
uint32  longs
 

Note: this code is harmless on little-endian machines.

md_misc.h40 行で定義されています。

参照先 uint32.

参照元 dkcMD5LoadDouble(), dkcMD_Final(), dkcMD_Update(), と double_md5_update_begin().

00041 {
00042   uint32 t;
00043   do 
00044     {
00045       t = (uint32) ((uint32) buf[3] << 8 | buf[2]) << 16 |
00046           ((uint32) buf[1] << 8 | buf[0]);
00047       *(uint32 *) buf = t;
00048       buf += 4;
00049     } 
00050   while (--longs);
00051 }

DKC_INLINE void dkcMD_Final DKC_MD5 ctx,
DKC_MD_TRANSFORM_F_TYPE  transform
 

Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first)

md_misc.h112 行で定義されています。

参照先 DKC_MD5::a8, DKC_MD5::abcd, DKC_MD5::count, dkcMD_ByteReverse(), edkcMD_ByteReverse, DKC_MD5::flags, uint32, と uint8.

参照元 dkcMD4Final(), と dkcMD5Final().

00113 {
00114   uint32 count;
00115   uint8 *p;
00116 
00117   /* Compute number of bytes mod 64 */
00118   count = (ctx->count[0] >> 3) & 0x3F;
00119 
00120   /* Set the first char of padding to 0x80.  This is safe since there is
00121      always at least one byte free */
00122   p = ctx->a8 + count;
00123   *p++ = 0x80;
00124 
00125   /* Bytes of padding needed to make 64 bytes */
00126   count = 64 - 1 - count;
00127 
00128   /* Pad out to 56 mod 64 */
00129   if (count < 8) 
00130     {
00131     /* Two lots of padding:  Pad the first block to 64 bytes */
00132       memset(p, 0, count);
00133       if ((ctx->flags) & edkcMD_ByteReverse)
00134         dkcMD_ByteReverse(ctx->a8, 16);
00135       //MD5Transform(ctx->abcd, (uint32 *) ctx->a8);
00136             transform(ctx->abcd,(uint32 *) ctx->a8);
00137       /* Now fill the next block with 56 bytes */
00138       memset(ctx->a8, 0, 56);
00139     } 
00140   else 
00141     {
00142       /* Pad block to 56 bytes */
00143       memset(p, 0, count - 8);
00144     }
00145   if ((ctx->flags) & edkcMD_ByteReverse)
00146     dkcMD_ByteReverse(ctx->a8, 14);
00147 
00148   /* Append length in bits and transform */
00149   ((uint32 *) ctx->a8)[14] = ctx->count[0];
00150   ((uint32 *) ctx->a8)[15] = ctx->count[1];
00151 
00152   //MD5Transform(ctx->abcd, (uint32 *) ctx->a8);
00153     transform(ctx->abcd,(uint32 *) ctx->a8);
00154   if ((ctx->flags) & edkcMD_ByteReverse)
00155     dkcMD_ByteReverse((uint8 *) ctx->abcd, 4);
00156   //memmove(digest, ctx->abcd, 16);
00157   //memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
00158 }

DKC_INLINE void dkcMD_Update DKC_MD5 p,
uint8 const *  buf,
uint32  len,
DKC_MD_TRANSFORM_F_TYPE  transform
 

Update context to reflect the concatenation of another buffer full of bytes.

md_misc.h57 行で定義されています。

参照先 DKC_MD5::a8, DKC_MD5::abcd, DKC_MD5::count, dkcMD_ByteReverse(), edkcMD_ByteReverse, DKC_MD5::flags, uint32, と uint8.

参照元 dkcMD4Load(), と dkcMD5Load().

00058 {
00059   uint32 t;
00060 
00061   /* Update bitcount */
00062 
00063   t = p->count[0];
00064   if ((p->count[0] = t + ((uint32) len << 3)) < t)
00065     p->count[1]++;      /* Carry from low to high */
00066   p->count[1] += len >> 29;
00067 
00068   t = (t >> 3) & 0x3f;  /* Bytes already in shsInfo->data */
00069 
00070   /* Handle any leading odd-sized chunks */
00071 
00072   if (t) 
00073     {
00074       //uint8 *p = (uint8 *) p->a8 + t;
00075             uint8 *pc = (uint8 *)&(p->a8[t]);
00076       t = 64 - t;
00077       if (len < t) 
00078         {
00079           memmove(pc, buf, len);
00080           return;
00081     }
00082       memmove(pc, buf, t);
00083       if ((p->flags) & edkcMD_ByteReverse)
00084         dkcMD_ByteReverse(p->a8, 16);
00085       //MD5Transform(p->abcd, (uint32 *) p->a8);
00086             transform(p->abcd,(uint32 *) p->a8);
00087       buf += t;
00088       len -= t;
00089     }
00090   /* Process data in 64-byte chunks */
00091 
00092   while (len >= 64) 
00093     {
00094       memmove(p->a8, buf, 64);
00095       if ((p->flags) & edkcMD_ByteReverse)
00096         dkcMD_ByteReverse(p->a8, 16);
00097       //MD5Transform(p->abcd, (uint32 *) p->a8);
00098             transform(p->abcd,(uint32 *) p->a8);
00099       buf += 64;
00100       len -= 64;
00101     }
00102 
00103   /* Handle any remaining bytes of data. */
00104 
00105   memmove(p->a8, buf, len);
00106 }


変数

typedef DKC_MD4
 

参照元 dkcAllocMD4(), と dkcFreeSHO().


dkutil_cに対してMon Jan 16 00:47:13 2006に生成されました。  doxygen 1.4.4