cocos2d-x 文件MD5校验(9)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:49 点击:次
p> II (d, a, b, c, X[ 3], MD5_S42, MD5_T54);
p> II (c, d, a, b, X[10], MD5_S43, MD5_T55);
p> II (b, c, d, a, X[ 1], MD5_S44, MD5_T56);
p> II (a, b, c, d, X[ 8], MD5_S41, MD5_T57);
p> II (d, a, b, c, X[15], MD5_S42, MD5_T58);
p> II (c, d, a, b, X[ 6], MD5_S43, MD5_T59);
p> II (b, c, d, a, X[13], MD5_S44, MD5_T60);
p> II (a, b, c, d, X[ 4], MD5_S41, MD5_T61);
p> II (d, a, b, c, X[11], MD5_S42, MD5_T62);
p> II (c, d, a, b, X[ 2], MD5_S43, MD5_T63);
p> II (b, c, d, a, X[ 9], MD5_S44, MD5_T64);
p>
p> //add the transformed values to the current checksum
p> m_lMD5[0] += a;
p> m_lMD5[1] += b;
p> m_lMD5[2] += c;
p> m_lMD5[3] += d;
p>}
p>
p>
p>/*****************************************************************************************
p> CONSTRUCTOR: CMD5Checksum
p> DESCRIPTION: Initialises member data
p> ARGUMENTS: None
p> NOTES: None
p> *****************************************************************************************/
p>CMD5Checksum::CMD5Checksum()
p>{
p> // zero members
p> memset( m_lpszBuffer, 0, 64 );
p> m_nCount[0] = m_nCount[1] = 0;
p>
p> // Load magic state initialization constants
p> m_lMD5[0] = MD5_INIT_STATE_0;
p> m_lMD5[1] = MD5_INIT_STATE_1;
p> m_lMD5[2] = MD5_INIT_STATE_2;
p> m_lMD5[3] = MD5_INIT_STATE_3;
p>}
p>
p>/*****************************************************************************************
p> FUNCTION: CMD5Checksum::DWordToByte
p> DETAILS: private
p> DESCRIPTION: Transfers the data in an 32 bit array to a 8 bit array
p> RETURNS: void
p> ARGUMENTS: BYTE* Output : the 8 bit destination array
p> DWORD* Input : the 32 bit source array
p> UINT nLength : the number of 8 bit data items in the source array
p> NOTES: One DWORD from the input array is transferred into four BYTES
p> in the output array. The first (0-7) bits of the first DWORD are
p> transferred to the first output BYTE, bits bits 8-15 are transferred from
p> the second BYTE etc.
p>
p> The algorithm assumes that the output array is a multiple of 4 bytes long
p> so that there is a perfect fit of 8 bit BYTES into the 32 bit DWORDs.
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>