22#ifndef PROTOCORE_HMAC_SHA256_H
23#define PROTOCORE_HMAC_SHA256_H
30#define PC_HMAC_SHA256_LEN 32
42void pc_hmac_sha256(
const uint8_t *key,
size_t key_len,
const uint8_t *data,
size_t len,
void pc_hmac_sha256(const uint8_t *key, size_t key_len, const uint8_t *data, size_t len, uint8_t mac[PC_HMAC_SHA256_LEN])
Compute HMAC-SHA2-256 over a single contiguous buffer.
#define PC_HMAC_SHA256_LEN
HMAC-SHA2-256 output length in bytes.
void pc_hmac_sha256_update(pc_hmac_sha256_ctx *ctx, const uint8_t *data, size_t len)
Feed len bytes into the running HMAC.
void pc_hmac_sha256_init(pc_hmac_sha256_ctx *ctx, const uint8_t *key, size_t key_len)
Initialize a streaming HMAC-SHA2-256 context.
void pc_hmac_sha256_final(pc_hmac_sha256_ctx *ctx, uint8_t mac[PC_HMAC_SHA256_LEN])
Finalize and write the 32-byte MAC.
SHA-256 (FIPS 180-4) - streaming context and one-shot API.
Streaming HMAC-SHA2-256 context.
pc_sha256_ctx inner
Inner hash context (key XOR ipad prepended).
Streaming SHA-256 context.