首页
社区
课程
招聘
MD5中的一个函数的问题
发表于: 2007-7-23 17:59 3627

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

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//