Go to the documentation of this file.
48 #ifndef HASHES_SHA256_H
49 #define HASHES_SHA256_H
63 #define SHA256_DIGEST_LENGTH 32
68 #define SHA256_INTERNAL_BLOCK_SIZE (64)
136 void *
sha256(
const void *data,
size_t len,
void *digest);
176 const void *
hmac_sha256(
const void *key,
size_t key_length,
177 const void *data,
size_t len,
void *digest);
193 void *
sha256_chain(
const void *seed,
size_t seed_length,
194 size_t elements,
void *tail_element);
225 size_t elements,
void *tail_element,
227 size_t *waypoints_length);
241 size_t element_index,
243 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.
Common definitions for the SHA-224/256 hash functions.
void sha256_init(sha256_context_t *ctx)
SHA-256 initialization.
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...
void sha2xx_update(sha2xx_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
void sha2xx_final(sha2xx_context_t *ctx, void *digest, size_t dig_len)
SHA-2XX finalization.
sha256-chain indexed element
void hmac_sha256_update(hmac_context_t *ctx, const void *data, size_t len)
hmac_sha256_update Add data bytes for HMAC calculation
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.
sha256_context_t c_in
Context for inner hash calculation.
static void sha256_update(sha256_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
const 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
Context for HMAC operations based on sha256.
void hmac_sha256_final(hmac_context_t *ctx, void *digest)
hmac_sha256_final HMAC SHA-256 finalization.
static void sha256_final(sha256_context_t *ctx, void *digest)
SHA-256 finalization.
void hmac_sha256_init(hmac_context_t *ctx, const void *key, size_t key_length)
hmac_sha256_init HMAC SHA-256 calculation.
size_t index
the position of this element in its chain
#define SHA256_DIGEST_LENGTH
Length of SHA256 digests in bytes.
sha256_context_t c_out
Context for outer hash calculation.
sha2xx_context_t sha256_context_t
Context for cipher operations based on sha256.
Adds include for missing inttype definitions.
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.
Structure to hold the SHA-2XX context.