2
Copyright (C) 2010- The University of Notre Dame
3
This software is distributed under the GNU General Public License.
4
See the file COPYING for details.
11
Routines for computing Hash-based Message Authentication Codes.
19
@param buffer Pointer to a memory buffer.
20
@param buffer_length Length of the buffer in bytes.
21
@param key Pointer to a buffer containing the key for hashing.
22
@param key_length The length of the key in bytes.
23
@param digest Pointer to a buffer to store the digest.
24
@param digest_len The length of the digest buffer.
25
@param block_size The size of the block used by the hash function in bytes.
26
@param hash_func A function pointer to the hash function to be used.
28
int hmac( const char* buffer, int buffer_length, const char* key, int key_length, unsigned char *digest, int digest_len, int block_size, void (*hash_func)(const char*, int, unsigned char*));
30
/** Generate HMAC using md5 hash function
31
Note that this function produces a digest in binary form which must be converted to a human readable form with md5_string.
32
@param buffer Pointer to a memory buffer.
33
@param buffer_length Length of the buffer in bytes.
34
@param key Pointer to a buffer containing the key for hashing.
35
@param key_length The length of the key in bytes.
36
@param digest Pointer to a buffer of size MD5_DIGEST_LENGTH to store the digest.
38
int hmac_md5( const char* buffer, int buffer_length, const char* key, int key_length, unsigned char digest[MD5_DIGEST_LENGTH]);
40
/** Generate HMAC using sha1 hash function
41
Note that this function produces a digest in binary form which must be converted to a human readable form with sha1_string.
42
@param buffer Pointer to a memory buffer.
43
@param buffer_length Length of the buffer in bytes.
44
@param key Pointer to a buffer containing the key for hashing.
45
@param key_length The length of the key in bytes.
46
@param digest Pointer to a buffer of size SHA1_DIGEST_LENGTH to store the digest.
48
int hmac_sha1( const char* buffer, int buffer_length, const char* key, int key_length, unsigned char digest[SHA1_DIGEST_LENGTH]);