Header definitions for the SHA256 hash function. More...

Detailed Description

Header definitions for the SHA256 hash function.

Author
Colin Percival
Christian Mehlis
Rene Kijewski
Hermann Lelong

Definition in file sha256.h.

#include <inttypes.h>
#include <stddef.h>
#include "hashes/sha2xx_common.h"
+ Include dependency graph for sha256.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hmac_context_t
 Context for HMAC operations based on sha256. More...
 
struct  sha256_chain_idx_elm_t
 sha256-chain indexed element More...
 

Macros

#define SHA256_DIGEST_LENGTH   32
 Length of SHA256 digests in bytes.
 
#define SHA256_INTERNAL_BLOCK_SIZE   (64)
 512 Bit (64 Byte) internally used block size for sha256
 

Typedefs

typedef sha2xx_context_t sha256_context_t
 Context for cipher operations based on sha256.
 

Functions

void sha256_init (sha256_context_t *ctx)
 SHA-256 initialization. More...
 
static void sha256_update (sha256_context_t *ctx, const void *data, size_t len)
 Add bytes into the hash. More...
 
static void sha256_final (sha256_context_t *ctx, void *digest)
 SHA-256 finalization. More...
 
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 buffer. More...
 
void hmac_sha256_init (hmac_context_t *ctx, const void *key, size_t key_length)
 hmac_sha256_init HMAC SHA-256 calculation. More...
 
void hmac_sha256_update (hmac_context_t *ctx, const void *data, size_t len)
 hmac_sha256_update Add data bytes for HMAC calculation More...
 
void hmac_sha256_final (hmac_context_t *ctx, void *digest)
 hmac_sha256_final HMAC SHA-256 finalization. More...
 
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 More...
 
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. More...
 
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. More...
 
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. More...