Group PJLIB_UTIL_HMAC_MD5

group PJLIB_UTIL_HMAC_MD5

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

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])

Calculate HMAC MD5 digest for the specified input and key.

Parameters:
  • input – Pointer to the input stream.

  • input_len – Length of input stream in bytes.

  • key – Pointer to the authentication key.

  • key_len – Length of the authentication key.

  • digest – Buffer 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:
  • hctx – HMAC-MD5 context.

  • key – Pointer to the authentication key.

  • key_len – Length 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:
  • hctx – HMAC-MD5 context.

  • input – Pointer to the input stream.

  • input_len – Length of input stream in bytes.

void pj_hmac_md5_final(pj_hmac_md5_context *hctx, pj_uint8_t digest[16])

Finish the message and return the digest.

Parameters:
  • hctx – HMAC-MD5 context.

  • digest – Buffer to be filled with HMAC MD5 digest.

struct pj_hmac_md5_context
#include <hmac_md5.h>

The HMAC-MD5 context used in the incremental HMAC calculation.

Public Members

pj_md5_context context

MD5 context

pj_uint8_t k_opad[64]

opad xor-ed with key