HMAC¶
This is a one-shot and incremental interface to computing HMAC with any hash function.
(Note: HMAC with SHA3 is possible, but is probably not a sensible thing to want.)
Types¶
Functions¶
-
void
cf_hmac_init
(cf_hmac_ctx *ctx, const cf_chash *hash, const uint8_t *key, size_t nkey)¶ Set up ctx for computing a HMAC using the given hash and key.
-
void
cf_hmac_update
(cf_hmac_ctx *ctx, const void *data, size_t ndata)¶ Input data.
-
void
cf_hmac_finish
(cf_hmac_ctx *ctx, uint8_t *out)¶ Finish and compute HMAC. ctx->hash->hashsz bytes are written to out.