libusual  0.1
Data Structures | Functions
usual/crypto/digest.h File Reference

Common API for cryptographic digests. More...

Data Structures

struct  DigestInfo
 Algoright info. More...

Functions

struct DigestContext * digest_new (const struct DigestInfo *impl, CxMem *cx)
 Allocate and initialize new algorithm instance.
void digest_update (struct DigestContext *ctx, const void *data, size_t len)
 Hash more data.
void digest_final (struct DigestContext *ctx, uint8_t *res)
 Get final result.
void digest_reset (struct DigestContext *ctx)
 Prepares instance for new data.
void digest_free (struct DigestContext *ctx)
 Free instance.
unsigned digest_block_len (struct DigestContext *ctx)
 Hash function block length in bytes.
unsigned digest_result_len (struct DigestContext *ctx)
 Hash function result length in bytes.
struct DigestInfodigest_MD5 (void)
 MD5 message digest.
struct DigestInfodigest_SHA1 (void)
 SHA1 message digest.
struct DigestInfodigest_SHA224 (void)
 SHA224 message digest.
struct DigestInfodigest_SHA256 (void)
 SHA256 message digest.
struct DigestInfodigest_SHA384 (void)
 SHA384 message digest.
struct DigestInfodigest_SHA512 (void)
 SHA512 message digest.
struct DigestInfodigest_SHA3_224 (void)
 SHA3-224 message digest.
struct DigestInfodigest_SHA3_256 (void)
 SHA3-256 message digest.
struct DigestInfodigest_SHA3_384 (void)
 SHA3-384 message digest.
struct DigestInfodigest_SHA3_512 (void)
 SHA3-512 message digest.
struct DigestInfodigest_SHAKE128 (void)
 SHAKE128 in regular digest mode.
struct DigestInfodigest_SHAKE256 (void)
 SHAKE256 in regular digest mode.

Detailed Description

Common API for cryptographic digests.


Function Documentation

struct DigestContext* digest_new ( const struct DigestInfo impl,
CxMem cx 
) [read]

Allocate and initialize new algorithm instance.

void digest_update ( struct DigestContext *  ctx,
const void *  data,
size_t  len 
)

Hash more data.

void digest_final ( struct DigestContext *  ctx,
uint8_t *  res 
)

Get final result.

To re-use same instance, digest_reset() must be called first.

void digest_reset ( struct DigestContext *  ctx)

Prepares instance for new data.

void digest_free ( struct DigestContext *  ctx)

Free instance.

unsigned digest_block_len ( struct DigestContext *  ctx)

Hash function block length in bytes.

unsigned digest_result_len ( struct DigestContext *  ctx)

Hash function result length in bytes.

struct DigestInfo* digest_MD5 ( void  ) [read]

MD5 message digest.

struct DigestInfo* digest_SHA1 ( void  ) [read]

SHA1 message digest.

struct DigestInfo* digest_SHA224 ( void  ) [read]

SHA224 message digest.

struct DigestInfo* digest_SHA256 ( void  ) [read]

SHA256 message digest.

struct DigestInfo* digest_SHA384 ( void  ) [read]

SHA384 message digest.

struct DigestInfo* digest_SHA512 ( void  ) [read]

SHA512 message digest.

struct DigestInfo* digest_SHA3_224 ( void  ) [read]

SHA3-224 message digest.

struct DigestInfo* digest_SHA3_256 ( void  ) [read]

SHA3-256 message digest.

struct DigestInfo* digest_SHA3_384 ( void  ) [read]

SHA3-384 message digest.

struct DigestInfo* digest_SHA3_512 ( void  ) [read]

SHA3-512 message digest.

struct DigestInfo* digest_SHAKE128 ( void  ) [read]

SHAKE128 in regular digest mode.

struct DigestInfo* digest_SHAKE256 ( void  ) [read]

SHAKE256 in regular digest mode.