cocos2d-x 文件MD5校验(6)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:49 点击:次
p> DWORD T : MD5_TXX Transformation constant
p> NOTES: None
p> *****************************************************************************************/
p>void CMD5Checksum::HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
p>{
p> DWORD H = (B ^ C ^ D);
p> A += H + X + T;
p> A = RotateLeft(A, S);
p> A += B;
p>}
p>
p>
p>/*****************************************************************************************
p> FUNCTION: CMD5Checksum::II
p> DETAILS: protected
p> DESCRIPTION: Implementation of basic MD5 transformation algorithm
p> RETURNS: none
p> ARGUMENTS: DWORD &A, B, C, D : Current (partial) checksum
p> DWORD X : Input data
p> DWORD S : MD5_SXX Transformation constant
p> DWORD T : MD5_TXX Transformation constant
p> NOTES: None
p> *****************************************************************************************/
p>void CMD5Checksum::II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
p>{
p> DWORD I = (C ^ (B | ~D));
p> A += I + X + T;
p> A = RotateLeft(A, S);
p> A += B;
p>}
p>
p>
p>/*****************************************************************************************
p> FUNCTION: CMD5Checksum::ByteToDWord
p> DETAILS: private
p> DESCRIPTION: Transfers the data in an 8 bit array to a 32 bit array
p> RETURNS: void
p> ARGUMENTS: DWORD* Output : the 32 bit (unsigned long) destination array
p> BYTE* Input : the 8 bit (unsigned char) source array
p> UINT nLength : the number of 8 bit data items in the source array
p> NOTES: Four BYTES from the input array are transferred to each DWORD entry
p> of the output array. The first BYTE is transferred to the bits (0-7)
p> of the output DWORD, the second BYTE to bits 8-15 etc.
p> The algorithm assumes that the input array is a multiple of 4 bytes long
p> so that there is a perfect fit into the array of 32 bit words.
p> *****************************************************************************************/
p>void CMD5Checksum::ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength)
p>{
p> //entry invariants
p> ASSERT( nLength % 4 == 0 );
p> //ASSERT( AfxIsValidAddress(Output, nLength/4, TRUE) );
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>