[摘要]~D)); A += I + X + T; A = RotateLeft(A, S); A += B;/***********************************************...
~D));
A += I + X + T;
A = RotateLeft(A, S);
A += B;
}
/*****************************************************************************************
FUNCTION: CMD5Checksum::ByteToDWord
DETAILS: private
DESCRIPTION: Transfers the data in an 8 bit array to a 32 bit array
RETURNS: void
ARGUMENTS: DWORD* Output : the 32 bit (unsigned long) destination array
BYTE* Input : the 8 bit (unsigned char) source array
UINT nLength : the number of 8 bit data items in the source array
NOTES: Four BYTES from the input array are transferred to each DWORD entry
of the output array. The first BYTE is transferred to the bits (0-7)
of the output DWORD, the second BYTE to bits 8-15 etc.
The algorithm assumes that the input array is a multiple of 4 bytes long
so that there is a perfect fit into the array of 32 bit words.
*****************************************************************************************/
void CMD5Checksum::ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength)
{
//entry invariants
ASSERT( nLength % 4 == 0 );
ASSERT( AfxIsValidAddress(Output, nLength/4, TRUE) );
ASSERT( AfxIsValidAddress(Input, nLength, FALSE) );
//initialisations
UINT i=0; //index to Output array
UINT j=0; //index to Input array
//transfer the data by shifting and copying
for ( ; j < nLength; i++, j += 4)
{
Output[i] = (ULONG)Input[j]
关键词:运用md5校验与算法保护文件