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); }
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); }