-
-
MD5中的一个函数的问题
-
发表于: 2007-7-23 17:59 3627
-
下面这个函数不知道作用是什么?
void MD5Update (context, input, inputLen)
MD5_CTX *context;
unsigned char *input;
unsigned int inputLen;
{
unsigned int i, index, partLen;
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
if (inputLen >= partLen) {
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)&input[i],
inputLen-i);
}
还有这一句
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
含义是什么?好像开始context->count[0] 就是0
void MD5Update (context, input, inputLen)
MD5_CTX *context;
unsigned char *input;
unsigned int inputLen;
{
unsigned int i, index, partLen;
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);
partLen = 64 - index;
if (inputLen >= partLen) {
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD5Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
MD5Transform (context->state, &input[i]);
index = 0;
}
else
i = 0;
MD5_memcpy
((POINTER)&context->buffer[index], (POINTER)&input[i],
inputLen-i);
}
还有这一句
index = (unsigned int)((context->count[0] >> 3) & 0x3F);
含义是什么?好像开始context->count[0] 就是0
赞赏
他的文章
- [讨论]Immuntity Debugger 3927
- MD5中的一个函数的问题 3628
- EncryptPE V2 3933
看原图
赞赏
雪币:
留言: