Mir 1.0
Mir application programming interface
SHA1 routines

Data Structures

struct  mirkl_sha1_ctx_t_
 SHA1 context. More...
 

Typedefs

typedef struct mirkl_sha1_ctx_t_ mirkl_sha1_ctx_t
 SHA1 context.
 

Functions

void mirkl_sha1_init (mirkl_sha1_ctx_t *context)
 Initialize new context. More...
 
void mirkl_sha1_update (const unsigned char *data, uint32_t len, mirkl_sha1_ctx_t *context)
 Update context by feeding data. More...
 
void mirkl_sha1_final (unsigned char digest[20], mirkl_sha1_ctx_t *context)
 Finalize calculating SHA1 digest. More...
 
void mirkl_sha1 (unsigned char *hash_out, const unsigned char *str, uint32_t len)
 Compact variant of SHA1 digest calculation in case of single data piece. More...
 

Detailed Description

Function Documentation

◆ mirkl_sha1()

void mirkl_sha1 ( unsigned char *  hash_out,
const unsigned char *  str,
uint32_t  len 
)

Compact variant of SHA1 digest calculation in case of single data piece.

Parameters
[out]hash_outPointer to 21-byte-long array for the calculated digest.
[in]strPointer to a string for which SHA1 digest will be calculated.
[in]lenLength of the input string.

◆ mirkl_sha1_final()

void mirkl_sha1_final ( unsigned char  digest[20],
mirkl_sha1_ctx_t context 
)

Finalize calculating SHA1 digest.

Parameters
[out]digestArray for the calculated digest.
[in]contextPointer to SHA1 context structure.

◆ mirkl_sha1_init()

void mirkl_sha1_init ( mirkl_sha1_ctx_t context)

Initialize new context.

Parameters
[in]contextPointer to SHA1 context structure.

◆ mirkl_sha1_update()

void mirkl_sha1_update ( const unsigned char *  data,
uint32_t  len,
mirkl_sha1_ctx_t context 
)

Update context by feeding data.

Parameters
[in]dataPointer to the data.
[in]lenLength of the data.
[in]contextPointer to SHA1 context structure.