- Timestamp:
- May 11, 2007 10:37:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/include/pjlib-util/hmac_sha1.h
r1001 r1265 26 26 27 27 #include <pj/types.h> 28 #include <pjlib-util/sha1.h> 28 29 29 30 PJ_BEGIN_DECL … … 35 36 * 36 37 * This module contains the implementation of HMAC: Keyed-Hashing 37 * for Message Authentication, as described in RFC 2104 38 * for Message Authentication, as described in RFC 2104. 38 39 */ 40 41 /** 42 * The HMAC-SHA1 context used in the incremental HMAC calculation. 43 */ 44 typedef struct pj_hmac_sha1_context 45 { 46 pj_sha1_context context; /**< SHA1 context */ 47 pj_uint8_t k_opad[64]; /**< opad xor-ed with key */ 48 } pj_hmac_sha1_context; 39 49 40 50 41 51 /** 42 * Calculate HMAC SHA1 digest for the specified input and key. 52 * Calculate HMAC-SHA1 digest for the specified input and key with this 53 * single function call. 43 54 * 44 55 * @param input Pointer to the input stream. … … 54 65 55 66 /** 67 * Initiate HMAC-SHA1 context for incremental hashing. 68 * 69 * @param hctx HMAC-SHA1 context. 70 * @param key Pointer to the authentication key. 71 * @param key_len Length of the authentication key. 72 */ 73 PJ_DECL(void) pj_hmac_sha1_init(pj_hmac_sha1_context *hctx, 74 const pj_uint8_t *key, unsigned key_len); 75 76 /** 77 * Append string to the message. 78 * 79 * @param hctx HMAC-SHA1 context. 80 * @param input Pointer to the input stream. 81 * @param input_len Length of input stream in bytes. 82 */ 83 PJ_DECL(void) pj_hmac_sha1_update(pj_hmac_sha1_context *hctx, 84 const pj_uint8_t *input, 85 unsigned input_len); 86 87 /** 88 * Finish the message and return the digest. 89 * 90 * @param hctx HMAC-SHA1 context. 91 * @param digest Buffer to be filled with HMAC SHA1 digest. 92 */ 93 PJ_DECL(void) pj_hmac_sha1_final(pj_hmac_sha1_context *hctx, 94 pj_uint8_t digest[20]); 95 96 97 /** 56 98 * @} 57 99 */
Note: See TracChangeset
for help on using the changeset viewer.