hashwrap.h File Reference

Decleration of hash wrap function. More...

Data Structures

union  sha_digest
 Sha Digest Element. More...
 
struct  tiny_sha
 Tiny Sha wrapper Element. More...
 

Functions

void tinysha_init (HashAlg sha_type, tiny_sha *s)
 Initializes the hash state. More...
 
void tinysha_update (tiny_sha *s, void const *data, size_t data_length)
 Hashes data into state using a chosen hash algorithm. More...
 
void tinysha_final (unsigned char *digest, tiny_sha *s)
 Computes the hash algorithm in the digest buffer. More...
 
size_t tinysha_digest_size (tiny_sha *s)
 Returns size of digest depending on hash algorithm. More...
 

Detailed Description

Decleration of hash wrap function.

Function Documentation

◆ tinysha_digest_size()

size_t tinysha_digest_size ( tiny_sha s)

Returns size of digest depending on hash algorithm.

Parameters
[in]sThe hash state. Must be non-null or behavior is undefined.
Returns
Size of digest

◆ tinysha_final()

void tinysha_final ( unsigned char *  digest,
tiny_sha s 
)

Computes the hash algorithm in the digest buffer.

Parameters
[out]digestThe computed digest. Must be non-null or behavior is undefined.
[in]sThe hash state. Must be non-null or behavior is undefined.

◆ tinysha_init()

void tinysha_init ( HashAlg  sha_type,
tiny_sha s 
)

Initializes the hash state.

Parameters
[in]sha_typeType of hash algorithm
[in,out]sThe hash state to initialize.

◆ tinysha_update()

void tinysha_update ( tiny_sha s,
void const *  data,
size_t  data_length 
)

Hashes data into state using a chosen hash algorithm.

Parameters
[in,out]sThe hash state. Must be non-null or behavior is undefined.
[in]dataThe data to hash into s.
[in]data_lengthThe size of data in bytes.