1 /* 2 * free 'simple' hmac_sha*. Public domain, 2015, JimF. 3 * Built for John source to replace other code. 4 * 5 * This software was written by JimF jfoug AT cox dot net 6 * in 2015. No copyright is claimed, and the software is hereby 7 * placed in the public domain. In case this attempt to disclaim 8 * copyright and place the software in the public domain is deemed 9 * null and void, then the software is Copyright (c) 2015 JimF 10 * and it is hereby released to the general public under the following 11 * terms: 12 * 13 * This software may be modified, redistributed, and used for any 14 * purpose, in source and binary forms, with or without modification. 15 */ 16 17 #ifndef _JTR_HMAC_SHA_H 18 19 extern void JTR_hmac_sha1(const unsigned char *key, int key_len, const unsigned char *data, int data_len, unsigned char *digest, int digest_len); 20 #define hmac_sha1(key,keylen,data,datalen,dgst,dgstlen) JTR_hmac_sha1(key,keylen,data,datalen,dgst,dgstlen) 21 22 extern void JTR_hmac_sha256(const unsigned char *key, int key_len, const unsigned char *data, int data_len, unsigned char *digest, int digest_len); 23 #define hmac_sha256(key,keylen,data,datalen,dgst,dgstlen) JTR_hmac_sha256(key,keylen,data,datalen,dgst,dgstlen) 24 25 extern void JTR_hmac_sha512(const unsigned char *key, int key_len, const unsigned char *data, int data_len, unsigned char *digest, int digest_len); 26 #define hmac_sha512(key,keylen,data,datalen,dgst,dgstlen) JTR_hmac_sha512(key,keylen,data,datalen,dgst,dgstlen) 27 28 extern void JTR_hmac_sha224(const unsigned char *key, int key_len, const unsigned char *data, int data_len, unsigned char *digest, int digest_len); 29 #define hmac_sha224(key,keylen,data,datalen,dgst,dgstlen) JTR_hmac_sha224(key,keylen,data,datalen,dgst,dgstlen) 30 31 extern void JTR_hmac_sha384(const unsigned char *key, int key_len, const unsigned char *data, int data_len, unsigned char *digest, int digest_len); 32 #define hmac_sha384(key,keylen,data,datalen,dgst,dgstlen) JTR_hmac_sha384(key,keylen,data,datalen,dgst,dgstlen) 33 34 #endif /* _JTR_HMAC_SHA_H */ 35