GCC Wikia
Advertisement

このページを編集する際は,編集に関する方針に従ってください.[]

概要[]

  • gcc-4.1.0/libiberty/md5.cにて定義
  • 求めたハッシュをrestbufに代入
    • ビッグエンディアンかリトルエンディアンかに注意

引数[]

実装[]

49: #ifdef WORDS_BIGENDIAN
50: # define SWAP(n)                                                        \
51:     (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
52: #else
53: # define SWAP(n) (n)
54: #endif

~
~

   76: /* Put result from CTX in first 16 bytes following RESBUF.  The result
   77:    must be in little endian byte order.
   78: 
   79:    IMPORTANT: On some systems it is required that RESBUF is correctly
   80:    aligned for a 32 bits value.  */
81: void *
82: md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
83: {
84:   ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A);
85:   ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B);
86:   ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C);
87:   ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D);
88: 
89:   return resbuf;
90: }


リンク元

Advertisement