void hb_hmac_sha224_final(hmac_sha224_ctx *ctx, unsigned char *mac, unsigned int mac_size) { unsigned char digest_inside[SHA224_DIGEST_SIZE]; unsigned char mac_temp[SHA224_DIGEST_SIZE]; hb_sha224_final(&ctx->ctx_inside, digest_inside); hb_sha224_update(&ctx->ctx_outside, digest_inside, SHA224_DIGEST_SIZE); hb_sha224_final(&ctx->ctx_outside, mac_temp); memcpy(mac, mac_temp, mac_size); }
void hb_sha224( const void * message, unsigned int len, unsigned char * digest ) { sha224_ctx ctx; hb_sha224_init( &ctx ); hb_sha224_update( &ctx, message, len ); hb_sha224_final( &ctx, digest ); }