SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration

Detailed Description

MD5 cryptographic hash.

Data Structures

struct  SharkSslMd5Ctx
 MD5. More...
 

Typedefs

typedef struct SharkSslMd5Ctx SharkSslMd5Ctx
 MD5. More...
 

Functions

SHARKSSL_API void SharkSslMd5Ctx_constructor (SharkSslMd5Ctx *ctx)
 Initialize. More...
 
SHARKSSL_API void SharkSslMd5Ctx_append (SharkSslMd5Ctx *ctx, const U8 *data, U32 len)
 append More...
 
SHARKSSL_API void SharkSslMd5Ctx_finish (SharkSslMd5Ctx *ctx, U8 digest[SHARKSSL_MD5_HASH_LEN])
 finish More...
 
SHARKSSL_API int sharkssl_md5 (const U8 *, U32, U8 *)
 md5 More...
 

Typedef Documentation

◆ SharkSslMd5Ctx

MD5.

Function Documentation

◆ sharkssl_md5()

int sharkssl_md5 ( const U8 *  data,
U32  len,
U8 *  digest 
)

md5

Parameters
dataconst U8 *; bytes to hash, borrowed for this call. May be NULL when len is zero.
lenU32; input length in bytes.
digestU8 *; required caller-owned output buffer of at least 16 bytes.
Returns
int: 0 on success; -1 on temporary allocation failure in a heap-based native build.

◆ SharkSslMd5Ctx_append()

void SharkSslMd5Ctx_append ( SharkSslMd5Ctx *  ctx,
const U8 *  data,
U32  len 
)

append

Parameters
ctxSharkSslMd5Ctx *; required initialized, unfinished context; updated in place.
dataconst U8 *; input bytes, borrowed for this call. Supply a valid buffer when len is nonzero.
lenU32; input length in bytes, including zero.

◆ SharkSslMd5Ctx_constructor()

SHARKSSL_API void SharkSslMd5Ctx_constructor ( SharkSslMd5Ctx *  ctx)

Initialize.

Parameters
ctxUninitialized data of size sizeof(SharkSslMd5Ctx).

◆ SharkSslMd5Ctx_finish()

void SharkSslMd5Ctx_finish ( SharkSslMd5Ctx *  ctx,
U8  digest[SHARKSSL_MD5_HASH_LEN] 
)

finish

Parameters
ctxSharkSslMd5Ctx *; required initialized context; finalized by this call. Reinitialize before hashing another message.
digestU8 *; required caller-owned output buffer of at least 16 bytes.