[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
value is always different
From: |
Ali Khalfan |
Subject: |
value is always different |
Date: |
Mon, 26 Apr 2010 03:17:22 -0400 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Hi,
I've been trying to use gcrypt to calculate a MAC using sha256.
It surprises me however, that everytime I run the script a different
value comes int even though I'm using the same key and plain text.
Is there somethigng i'm missing here?
err = gcry_md_open(&ctx,GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC);
gcry_md_setkey (ctx, key, 32);
gcry_md_write(ctx, &plain_text,sizeof plain_text);
unsigned char *digest = gcry_md_read (ctx, GCRY_MD_SHA256);
- value is always different,
Ali Khalfan <=