Logo Search packages:      
Sourcecode: u3-tool version File versions  Download package

void md5_hmac_starts ( md5_context ctx,
unsigned char *  key,
int  keylen 
)

MD5 HMAC context setup.

Parameters:
ctx HMAC context to be initialized
key HMAC secret key
keylen length of the HMAC key

Definition at line 325 of file md5.c.

References md5_context::ipad, and md5_context::opad.

{
    int i;

    memset( ctx->ipad, 0x36, 64 );
    memset( ctx->opad, 0x5C, 64 );

    for( i = 0; i < keylen; i++ )
    {
        if( i >= 64 ) break;

        ctx->ipad[i] ^= key[i];
        ctx->opad[i] ^= key[i];
    }

    md5_starts( ctx );
    md5_update( ctx, ctx->ipad, 64 );
}


Generated by  Doxygen 1.6.0   Back to index