47#ifndef HASHES_SHA256_H
48#define HASHES_SHA256_H
62#define SHA256_DIGEST_LENGTH 32
67#define SHA256_INTERNAL_BLOCK_SIZE (64)
134void sha256(
const void *data,
size_t len,
void *digest);
170 const void *data,
size_t len,
void *digest);
187 size_t elements,
void *tail_element);
218 size_t elements,
void *tail_element,
220 size_t *waypoints_length);
234 size_t element_index,
236 size_t chain_length);
int sha256_chain_verify_element(void *element, size_t element_index, void *tail_element, size_t chain_length)
function to verify if a given chain element is part of the chain.
void hmac_sha256(const void *key, size_t key_length, const void *data, size_t len, void *digest)
function to compute a hmac-sha256 from a given message
static void sha256_update(sha256_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
void * sha256_chain_with_waypoints(const void *seed, size_t seed_length, size_t elements, void *tail_element, sha256_chain_idx_elm_t *waypoints, size_t *waypoints_length)
function to produce a hash chain starting with a given seed element.
static void sha256_final(sha256_context_t *ctx, void *digest)
SHA-256 finalization.
void hmac_sha256_final(hmac_context_t *ctx, void *digest)
hmac_sha256_final HMAC SHA-256 finalization.
void hmac_sha256_update(hmac_context_t *ctx, const void *data, size_t len)
hmac_sha256_update Add data bytes for HMAC calculation
void hmac_sha256_init(hmac_context_t *ctx, const void *key, size_t key_length)
hmac_sha256_init HMAC SHA-256 calculation.
void sha256_init(sha256_context_t *ctx)
SHA-256 initialization.
#define SHA256_DIGEST_LENGTH
Length of SHA256 digests in bytes.
void * sha256_chain(const void *seed, size_t seed_length, size_t elements, void *tail_element)
function to produce a hash chain starting with a given seed element.
void sha256(const void *data, size_t len, void *digest)
A wrapper function to simplify the generation of a hash, this is useful for generating sha256 for one...
sha2xx_context_t sha256_context_t
Context for cipher operations based on sha256.
void sha2xx_final(sha2xx_context_t *ctx, void *digest, size_t dig_len)
SHA-2XX finalization.
void sha2xx_update(sha2xx_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
Adds include for missing inttype definitions.
Common definitions for the SHA-224/256 hash functions.
Context for HMAC operations based on sha256.
sha256_context_t c_out
Context for outer hash calculation.
sha256_context_t c_in
Context for inner hash calculation.
sha256-chain indexed element
size_t index
the position of this element in its chain
Structure to hold the SHA-2XX context.