示例#1
0
int HashFinishJH(THash *Hash, int Encoding, char **HashStr)
{
int count, len;
char *Tempstr=NULL, *DigestBuff=NULL;

DigestBuff=(char *) calloc(1,1024);

len=JHFinal((hashState *) Hash->Ctx, DigestBuff);
free(Hash->Ctx);

if (Encoding > 0)
{
	 *HashStr=EncodeBytes(*HashStr, DigestBuff, len, Encoding);
	 len=StrLen(*HashStr);
}
else
{
	*HashStr=SetStrLen(*HashStr,len);
	memcpy(*HashStr,DigestBuff,len);
}

DestroyString(DigestBuff);
DestroyString(Tempstr);

return(len);
}
示例#2
0
文件: Hash.c 项目: ColumPaget/Movgrab
int HashFinishJH(HASH *Hash, char **HashStr)
{
int len;
char *DigestBuff=NULL;

DigestBuff=(char *) calloc(1,1024);

len=JHFinal((hashState *) Hash->Ctx, (unsigned char *) DigestBuff);
*HashStr=SetStrLen(*HashStr,len);
memcpy(*HashStr,DigestBuff,len);

DestroyString(DigestBuff);

return(len);
}