Hi Tilak, #include <openssl/hmac.h> macLen will be set to the length of the obtained MAC.
Have a look at doc/crypto/hmac.pod. It might alreay be installed on your system in case you're having dev manpages. Try "man hmac" - otherwise convert it with "pod2man hmac.pod > hmac.man" and view it with "man ./hmac.man". Best regards, Martin On Dec 7, 2007 9:05 AM, Tilak Adhya <[EMAIL PROTECTED]> wrote: > Hi Martin, > > If I want to use HMAC in one of my application, then what are the > libraries, I have to take? Or, simply what are the files, that I have > to include in my program ? > In your code snippet, what is macLen? Is it the length in bits for > SHA1 hash digest, i.e. 160bits? > > Thanks for your kind help... > > Best Regards > Tilak > > > > On Dec 7, 2007 1:08 PM, Martin Peylo <[EMAIL PROTECTED]> wrote: > > Hi, > > > > size_t keyLen, msgLen, macLen; > > unsigned char *key; > > const unsigned char* msg; > > unsigned char *mac > > [... init ...] > > HMAC(EVP_sha1(), key, keyLen, msg, msgLen, mac, &macLen); > > > > should do it. > > > > Best regards, > > Martin > > > > > > > > On Dec 7, 2007 8:13 AM, Tilak Adhya <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I am new to the use of openSSL APIs. I need to use HMAC with SHA1. > > > But in the source code, I have seen that HMAC is written to work only > > > with MD5. How to use HMAC with SHA1. Is it possible to use HMAC > > > with SHA1 hash algorithm, in the existing code of openSSL-HMAC ? > > > If yes then how...? Do I need to change the source code...? > > > I am confused, please help me out... > > > > > > Awaiting for your reply... > > > > > > Thanks in advance. > > > > > > Thanks and Regards > > > Tila > > > ______________________________________________________________________ > > > OpenSSL Project http://www.openssl.org > > > User Support Mailing List openssl-users@openssl.org > > > Automated List Manager [EMAIL PROTECTED] > > > > > ______________________________________________________________________ > > OpenSSL Project http://www.openssl.org > > User Support Mailing List openssl-users@openssl.org > > Automated List Manager [EMAIL PROTECTED] > > > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]