LibGCrypt Examples
Timo Schulz
twoaday@freakmail.de
Wed, 17 Apr 2002 23:59:53 +0200
On Wed Apr 17 2002; 23:40, kingruedi wrote:
> gcry_md_write(md5,buffer,len); /*<-- this should create the checksum*/
> printf("%s\n",buffer);
> gcry_md_close(md5);
No, you can't use it like this, try this instead:
gcry_md_write( md5, buffer, len );
gcry_md_final( md5 );
{
byte *digest = gcry_md_read( md5, GCRY_MD_MD5 );
int i = 0;
for ( i=0; i<gcry_md_get_algo_dlen( GCRY_MD_MD5 ); i++ )
printf("%02X", digest[i]);
}
Timo