- Added reset functionality for HMAC context. Speed-up for some use-cases.

This commit is contained in:
Paul Bakker 2010-03-21 16:23:13 +00:00
parent 27caa8a17e
commit 7d3b661bfe
13 changed files with 100 additions and 2 deletions

View file

@ -417,6 +417,15 @@ void sha2_hmac_finish( sha2_context *ctx, unsigned char output[32] )
memset( tmpbuf, 0, sizeof( tmpbuf ) );
}
/*
* SHA-256 HMAC context reset
*/
void sha2_hmac_reset( sha2_context *ctx )
{
sha2_starts( ctx, ctx->is224 );
sha2_update( ctx, ctx->ipad, 64 );
}
/*
* output = HMAC-SHA-256( hmac key, input buffer )
*/