18#ifndef PROTOCORE_SHA256_H
19#define PROTOCORE_SHA256_H
25#define PC_SHA256_DIGEST_LEN 32
28#define PC_SHA256_BLOCK_LEN 64
38#include <mbedtls/sha256.h>
41 mbedtls_sha256_context
mbed;
void pc_sha256_final(pc_sha256_ctx *ctx, uint8_t digest[PC_SHA256_DIGEST_LEN])
Finalize the hash and write the 32-byte digest. The context is undefined afterwards; call init() agai...
void pc_sha256_update(pc_sha256_ctx *ctx, const uint8_t *data, size_t len)
Feed len bytes of data into the running hash.
#define PC_SHA256_DIGEST_LEN
SHA-256 digest length in bytes.
void pc_sha256(const uint8_t *data, size_t len, uint8_t digest[PC_SHA256_DIGEST_LEN])
One-shot SHA-256: hash len bytes of data into digest (32 bytes).
void pc_sha256_init(pc_sha256_ctx *ctx)
Initialize a streaming SHA-256 context (ctx must not be NULL).
Streaming SHA-256 context.
mbedtls_sha256_context mbed
HW-accelerated SHA-256 state (ESP32 mbedtls).