/* output = HMAC-MD2( hmac key, input buffer ) */ void md2_hmac(uchar *key, int keylen, uchar *input, int ilen, uchar output[16]) { md2_context ctx; md2_hmac_starts(&ctx, key, keylen); md2_hmac_update(&ctx, input, ilen); md2_hmac_finish(&ctx, output); memset(&ctx, 0, sizeof(md2_context)); }
/* * output = HMAC-MD2( hmac key, input buffer ) */ void md2_hmac( const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[16] ) { md2_context ctx; md2_hmac_starts( &ctx, key, keylen ); md2_hmac_update( &ctx, input, ilen ); md2_hmac_finish( &ctx, output ); memset( &ctx, 0, sizeof( md2_context ) ); }
static void md2_hmac_starts_wrap( void *ctx, const unsigned char *key, size_t keylen ) { md2_hmac_starts( (md2_context *) ctx, key, keylen ); }