Ejemplo n.º 1
0
Archivo: md2.c Proyecto: sunfirefox/est
/*
    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));
}
Ejemplo n.º 2
0
/*
 * 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 ) );
}
Ejemplo n.º 3
0
static void md2_hmac_starts_wrap( void *ctx, const unsigned char *key,
                                  size_t keylen )
{
    md2_hmac_starts( (md2_context *) ctx, key, keylen );
}