BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB-UTIL Reference

HMAC MD5 Message Authentication

Data Structures

struct  pj_hmac_md5_context
 

Functions

void pj_hmac_md5 (const pj_uint8_t *input, unsigned input_len, const pj_uint8_t *key, unsigned key_len, pj_uint8_t digest[16])
 
void pj_hmac_md5_init (pj_hmac_md5_context *hctx, const pj_uint8_t *key, unsigned key_len)
 
void pj_hmac_md5_update (pj_hmac_md5_context *hctx, const pj_uint8_t *input, unsigned input_len)
 
void pj_hmac_md5_final (pj_hmac_md5_context *hctx, pj_uint8_t digest[16])
 

Detailed Description

This module contains the implementation of HMAC: Keyed-Hashing for Message Authentication, as described in RFC 2104

Function Documentation

void pj_hmac_md5 ( const pj_uint8_t input,
unsigned  input_len,
const pj_uint8_t key,
unsigned  key_len,
pj_uint8_t  digest[16] 
)

Calculate HMAC MD5 digest for the specified input and key.

Parameters
inputPointer to the input stream.
input_lenLength of input stream in bytes.
keyPointer to the authentication key.
key_lenLength of the authentication key.
digestBuffer to be filled with HMAC MD5 digest.
void pj_hmac_md5_final ( pj_hmac_md5_context hctx,
pj_uint8_t  digest[16] 
)

Finish the message and return the digest.

Parameters
hctxHMAC-MD5 context.
digestBuffer to be filled with HMAC MD5 digest.
void pj_hmac_md5_init ( pj_hmac_md5_context hctx,
const pj_uint8_t key,
unsigned  key_len 
)

Initiate HMAC-MD5 context for incremental hashing.

Parameters
hctxHMAC-MD5 context.
keyPointer to the authentication key.
key_lenLength of the authentication key.
void pj_hmac_md5_update ( pj_hmac_md5_context hctx,
const pj_uint8_t input,
unsigned  input_len 
)

Append string to the message.

Parameters
hctxHMAC-MD5 context.
inputPointer to the input stream.
input_lenLength of input stream in bytes.

 


PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.