Mbed OS Reference
Loading...
Searching...
No Matches
Message Digest (MD)

Data Structures

struct  mbedtls_md_context_t
 The generic message-digest context. More...
 

Macros

#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE   -0x5080
 The selected feature is not available. More...
 
#define MBEDTLS_ERR_MD_BAD_INPUT_DATA   -0x5100
 Bad input parameters to function. More...
 
#define MBEDTLS_ERR_MD_ALLOC_FAILED   -0x5180
 Failed to allocate memory. More...
 
#define MBEDTLS_ERR_MD_FILE_IO_ERROR   -0x5200
 Opening or reading of file failed. More...
 
#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED   -0x5280
 MD hardware accelerator failed. More...
 

Typedefs

typedef struct mbedtls_md_info_t mbedtls_md_info_t
 Opaque struct defined in md_internal.h. More...
 
typedef struct mbedtls_md_context_t mbedtls_md_context_t
 The generic message-digest context. More...
 

Enumerations

enum  mbedtls_md_type_t {
  MBEDTLS_MD_NONE =0 , MBEDTLS_MD_MD2 , MBEDTLS_MD_MD4 , MBEDTLS_MD_MD5 ,
  MBEDTLS_MD_SHA1 , MBEDTLS_MD_SHA224 , MBEDTLS_MD_SHA256 , MBEDTLS_MD_SHA384 ,
  MBEDTLS_MD_SHA512 , MBEDTLS_MD_RIPEMD160
}
 Supported message digests. More...
 

Functions

const int * mbedtls_md_list (void)
 This function returns the list of digests supported by the generic digest module. More...
 
const mbedtls_md_info_tmbedtls_md_info_from_string (const char *md_name)
 This function returns the message-digest information associated with the given digest name. More...
 
const mbedtls_md_info_tmbedtls_md_info_from_type (mbedtls_md_type_t md_type)
 This function returns the message-digest information associated with the given digest type. More...
 
void mbedtls_md_init (mbedtls_md_context_t *ctx)
 This function initializes a message-digest context without binding it to a particular message-digest algorithm. More...
 
void mbedtls_md_free (mbedtls_md_context_t *ctx)
 This function clears the internal structure of ctx and frees any embedded internal structure, but does not free ctx itself. More...
 
int mbedtls_md_init_ctx (mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info)
 This function selects the message digest algorithm to use, and allocates internal structures. More...
 
int mbedtls_md_setup (mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac)
 This function selects the message digest algorithm to use, and allocates internal structures. More...
 
int mbedtls_md_clone (mbedtls_md_context_t *dst, const mbedtls_md_context_t *src)
 This function clones the state of an message-digest context. More...
 
unsigned char mbedtls_md_get_size (const mbedtls_md_info_t *md_info)
 This function extracts the message-digest size from the message-digest information structure. More...
 
mbedtls_md_type_t mbedtls_md_get_type (const mbedtls_md_info_t *md_info)
 This function extracts the message-digest type from the message-digest information structure. More...
 
const char * mbedtls_md_get_name (const mbedtls_md_info_t *md_info)
 This function extracts the message-digest name from the message-digest information structure. More...
 
int mbedtls_md_starts (mbedtls_md_context_t *ctx)
 This function starts a message-digest computation. More...
 
int mbedtls_md_update (mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen)
 This function feeds an input buffer into an ongoing message-digest computation. More...
 
int mbedtls_md_finish (mbedtls_md_context_t *ctx, unsigned char *output)
 This function finishes the digest operation, and writes the result to the output buffer. More...
 
int mbedtls_md (const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, unsigned char *output)
 This function calculates the message-digest of a buffer, with respect to a configurable message-digest algorithm in a single call. More...
 
int mbedtls_md_hmac_starts (mbedtls_md_context_t *ctx, const unsigned char *key, size_t keylen)
 This function sets the HMAC key and prepares to authenticate a new message. More...
 
int mbedtls_md_hmac_update (mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen)
 This function feeds an input buffer into an ongoing HMAC computation. More...
 
int mbedtls_md_hmac_finish (mbedtls_md_context_t *ctx, unsigned char *output)
 This function finishes the HMAC operation, and writes the result to the output buffer. More...
 
int mbedtls_md_hmac_reset (mbedtls_md_context_t *ctx)
 This function prepares to authenticate a new message with the same key as the previous HMAC operation. More...
 
int mbedtls_md_hmac (const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)
 This function calculates the full generic HMAC on the input buffer with the provided key. More...
 
typedef struct mbedtls_md4_context mbedtls_md4_context
 MD4 context structure. More...
 
void mbedtls_md4_init (mbedtls_md4_context *ctx)
 Initialize MD4 context. More...
 
void mbedtls_md4_free (mbedtls_md4_context *ctx)
 Clear MD4 context. More...
 
void mbedtls_md4_clone (mbedtls_md4_context *dst, const mbedtls_md4_context *src)
 Clone (the state of) an MD4 context. More...
 
int mbedtls_md4_starts_ret (mbedtls_md4_context *ctx)
 MD4 context setup. More...
 
int mbedtls_md4_update_ret (mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
 MD4 process buffer. More...
 
int mbedtls_md4_finish_ret (mbedtls_md4_context *ctx, unsigned char output[16])
 MD4 final digest. More...
 
int mbedtls_internal_md4_process (mbedtls_md4_context *ctx, const unsigned char data[64])
 MD4 process data block (internal use only) More...
 
void mbedtls_md4_starts (mbedtls_md4_context *ctx)
 MD4 context setup. More...
 
void mbedtls_md4_update (mbedtls_md4_context *ctx, const unsigned char *input, size_t ilen)
 MD4 process buffer. More...
 
void mbedtls_md4_finish (mbedtls_md4_context *ctx, unsigned char output[16])
 MD4 final digest. More...
 
void mbedtls_md4_process (mbedtls_md4_context *ctx, const unsigned char data[64])
 MD4 process data block (internal use only) More...
 
int mbedtls_md4_ret (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD4( input buffer ) More...
 
void mbedtls_md4 (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD4( input buffer ) More...
 
#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED   -0x002D
 MD4 hardware accelerator failed. More...
 
typedef struct mbedtls_md5_context mbedtls_md5_context
 MD5 context structure. More...
 
void mbedtls_md5_init (mbedtls_md5_context *ctx)
 Initialize MD5 context. More...
 
void mbedtls_md5_free (mbedtls_md5_context *ctx)
 Clear MD5 context. More...
 
void mbedtls_md5_clone (mbedtls_md5_context *dst, const mbedtls_md5_context *src)
 Clone (the state of) an MD5 context. More...
 
int mbedtls_md5_starts_ret (mbedtls_md5_context *ctx)
 MD5 context setup. More...
 
int mbedtls_md5_update_ret (mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen)
 MD5 process buffer. More...
 
int mbedtls_md5_finish_ret (mbedtls_md5_context *ctx, unsigned char output[16])
 MD5 final digest. More...
 
int mbedtls_internal_md5_process (mbedtls_md5_context *ctx, const unsigned char data[64])
 MD5 process data block (internal use only) More...
 
void mbedtls_md5_starts (mbedtls_md5_context *ctx)
 MD5 context setup. More...
 
void mbedtls_md5_update (mbedtls_md5_context *ctx, const unsigned char *input, size_t ilen)
 MD5 process buffer. More...
 
void mbedtls_md5_finish (mbedtls_md5_context *ctx, unsigned char output[16])
 MD5 final digest. More...
 
void mbedtls_md5_process (mbedtls_md5_context *ctx, const unsigned char data[64])
 MD5 process data block (internal use only) More...
 
int mbedtls_md5_ret (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD5( input buffer ) More...
 
void mbedtls_md5 (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD5( input buffer ) More...
 
#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED   -0x002F
 MD5 hardware accelerator failed. More...
 
typedef struct mbedtls_md2_context mbedtls_md2_context
 MD2 context structure. More...
 
void mbedtls_md2_init (mbedtls_md2_context *ctx)
 Initialize MD2 context. More...
 
void mbedtls_md2_free (mbedtls_md2_context *ctx)
 Clear MD2 context. More...
 
void mbedtls_md2_clone (mbedtls_md2_context *dst, const mbedtls_md2_context *src)
 Clone (the state of) an MD2 context. More...
 
int mbedtls_md2_starts_ret (mbedtls_md2_context *ctx)
 MD2 context setup. More...
 
int mbedtls_md2_update_ret (mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
 MD2 process buffer. More...
 
int mbedtls_md2_finish_ret (mbedtls_md2_context *ctx, unsigned char output[16])
 MD2 final digest. More...
 
int mbedtls_internal_md2_process (mbedtls_md2_context *ctx)
 MD2 process data block (internal use only) More...
 
void mbedtls_md2_starts (mbedtls_md2_context *ctx)
 MD2 context setup. More...
 
void mbedtls_md2_update (mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
 MD2 process buffer. More...
 
void mbedtls_md2_finish (mbedtls_md2_context *ctx, unsigned char output[16])
 MD2 final digest. More...
 
void mbedtls_md2_process (mbedtls_md2_context *ctx)
 MD2 process data block (internal use only) More...
 
int mbedtls_md2_ret (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD2( input buffer ) More...
 
void mbedtls_md2 (const unsigned char *input, size_t ilen, unsigned char output[16])
 Output = MD2( input buffer ) More...
 
#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED   -0x002B
 MD2 hardware accelerator failed. More...
 

Detailed Description

Macro Definition Documentation

◆ MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE   -0x5080

The selected feature is not available.

Definition at line 44 of file md.h.

◆ MBEDTLS_ERR_MD_BAD_INPUT_DATA

#define MBEDTLS_ERR_MD_BAD_INPUT_DATA   -0x5100

Bad input parameters to function.

Definition at line 45 of file md.h.

◆ MBEDTLS_ERR_MD_ALLOC_FAILED

#define MBEDTLS_ERR_MD_ALLOC_FAILED   -0x5180

Failed to allocate memory.

Definition at line 46 of file md.h.

◆ MBEDTLS_ERR_MD_FILE_IO_ERROR

#define MBEDTLS_ERR_MD_FILE_IO_ERROR   -0x5200

Opening or reading of file failed.

Definition at line 47 of file md.h.

◆ MBEDTLS_ERR_MD_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED   -0x5280

MD hardware accelerator failed.

Definition at line 50 of file md.h.

◆ MBEDTLS_ERR_MD2_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED   -0x002B

MD2 hardware accelerator failed.

Definition at line 44 of file md2.h.

◆ MBEDTLS_ERR_MD4_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED   -0x002D

MD4 hardware accelerator failed.

Definition at line 45 of file mbedtls/include/mbedtls/md4.h.

◆ MBEDTLS_ERR_MD5_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED   -0x002F

MD5 hardware accelerator failed.

Definition at line 44 of file mbedtls/include/mbedtls/md5.h.

Typedef Documentation

◆ mbedtls_md_info_t

Opaque struct defined in md_internal.h.

Definition at line 92 of file md.h.

◆ mbedtls_md_context_t

The generic message-digest context.

◆ mbedtls_md4_context

MD4 context structure.

Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_context

MD5 context structure.

Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_context

MD2 context structure.

Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

Enumeration Type Documentation

◆ mbedtls_md_type_t

Supported message digests.

Warning
MD2, MD4, MD5 and SHA-1 are considered weak message digests and their use constitutes a security risk. We recommend considering stronger message digests instead.
Enumerator
MBEDTLS_MD_NONE 

None.

MBEDTLS_MD_MD2 

The MD2 message digest.

MBEDTLS_MD_MD4 

The MD4 message digest.

MBEDTLS_MD_MD5 

The MD5 message digest.

MBEDTLS_MD_SHA1 

The SHA-1 message digest.

MBEDTLS_MD_SHA224 

The SHA-224 message digest.

MBEDTLS_MD_SHA256 

The SHA-256 message digest.

MBEDTLS_MD_SHA384 

The SHA-384 message digest.

MBEDTLS_MD_SHA512 

The SHA-512 message digest.

MBEDTLS_MD_RIPEMD160 

The RIPEMD-160 message digest.

Definition at line 64 of file md.h.

Function Documentation

◆ mbedtls_md_list()

const int * mbedtls_md_list ( void  )

This function returns the list of digests supported by the generic digest module.

Note
The list starts with the strongest available hashes.
Returns
A statically allocated array of digests. Each element in the returned list is an integer belonging to the message-digest enumeration mbedtls_md_type_t. The last entry is 0.

◆ mbedtls_md_info_from_string()

const mbedtls_md_info_t * mbedtls_md_info_from_string ( const char *  md_name)

This function returns the message-digest information associated with the given digest name.

Parameters
md_nameThe name of the digest to search for.
Returns
The message-digest information associated with md_name.
NULL if the associated message-digest information is not found.

◆ mbedtls_md_info_from_type()

const mbedtls_md_info_t * mbedtls_md_info_from_type ( mbedtls_md_type_t  md_type)

This function returns the message-digest information associated with the given digest type.

Parameters
md_typeThe type of digest to search for.
Returns
The message-digest information associated with md_type.
NULL if the associated message-digest information is not found.

◆ mbedtls_md_init()

void mbedtls_md_init ( mbedtls_md_context_t ctx)

This function initializes a message-digest context without binding it to a particular message-digest algorithm.

This function should always be called first. It prepares the context for mbedtls_md_setup() for binding it to a message-digest algorithm.

◆ mbedtls_md_free()

void mbedtls_md_free ( mbedtls_md_context_t ctx)

This function clears the internal structure of ctx and frees any embedded internal structure, but does not free ctx itself.

If you have called mbedtls_md_setup() on ctx, you must call mbedtls_md_free() when you are no longer using the context. Calling this function if you have previously called mbedtls_md_init() and nothing else is optional. You must not call this function if you have not called mbedtls_md_init().

◆ mbedtls_md_init_ctx()

int mbedtls_md_init_ctx ( mbedtls_md_context_t ctx,
const mbedtls_md_info_t md_info 
)

This function selects the message digest algorithm to use, and allocates internal structures.

It should be called after mbedtls_md_init() or mbedtls_md_free(). Makes it necessary to call mbedtls_md_free() later.

Deprecated:
Superseded by mbedtls_md_setup() in 2.0.0
Parameters
ctxThe context to set up.
md_infoThe information structure of the message-digest algorithm to use.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.
MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.

◆ mbedtls_md_setup()

int mbedtls_md_setup ( mbedtls_md_context_t ctx,
const mbedtls_md_info_t md_info,
int  hmac 
)

This function selects the message digest algorithm to use, and allocates internal structures.

It should be called after mbedtls_md_init() or mbedtls_md_free(). Makes it necessary to call mbedtls_md_free() later.

Parameters
ctxThe context to set up.
md_infoThe information structure of the message-digest algorithm to use.
hmacDefines if HMAC is used. 0: HMAC is not used (saves some memory), or non-zero: HMAC is used with this context.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.
MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.

◆ mbedtls_md_clone()

int mbedtls_md_clone ( mbedtls_md_context_t dst,
const mbedtls_md_context_t src 
)

This function clones the state of an message-digest context.

Note
You must call mbedtls_md_setup() on dst before calling this function.
The two contexts must have the same type, for example, both are SHA-256.
Warning
This function clones the message-digest state, not the HMAC state.
Parameters
dstThe destination context.
srcThe context to be cloned.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_get_size()

unsigned char mbedtls_md_get_size ( const mbedtls_md_info_t md_info)

This function extracts the message-digest size from the message-digest information structure.

Parameters
md_infoThe information structure of the message-digest algorithm to use.
Returns
The size of the message-digest output in Bytes.

◆ mbedtls_md_get_type()

mbedtls_md_type_t mbedtls_md_get_type ( const mbedtls_md_info_t md_info)

This function extracts the message-digest type from the message-digest information structure.

Parameters
md_infoThe information structure of the message-digest algorithm to use.
Returns
The type of the message digest.

◆ mbedtls_md_get_name()

const char * mbedtls_md_get_name ( const mbedtls_md_info_t md_info)

This function extracts the message-digest name from the message-digest information structure.

Parameters
md_infoThe information structure of the message-digest algorithm to use.
Returns
The name of the message digest.

◆ mbedtls_md_starts()

int mbedtls_md_starts ( mbedtls_md_context_t ctx)

This function starts a message-digest computation.

             You must call this function after setting up the context
             with mbedtls_md_setup(), and before passing data with
             mbedtls_md_update().
Parameters
ctxThe generic message-digest context.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_update()

int mbedtls_md_update ( mbedtls_md_context_t ctx,
const unsigned char *  input,
size_t  ilen 
)

This function feeds an input buffer into an ongoing message-digest computation.

You must call mbedtls_md_starts() before calling this function. You may call this function multiple times. Afterwards, call mbedtls_md_finish().

Parameters
ctxThe generic message-digest context.
inputThe buffer holding the input data.
ilenThe length of the input data.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_finish()

int mbedtls_md_finish ( mbedtls_md_context_t ctx,
unsigned char *  output 
)

This function finishes the digest operation, and writes the result to the output buffer.

Call this function after a call to mbedtls_md_starts(), followed by any number of calls to mbedtls_md_update(). Afterwards, you may either clear the context with mbedtls_md_free(), or call mbedtls_md_starts() to reuse the context for another digest operation with the same algorithm.

Parameters
ctxThe generic message-digest context.
outputThe buffer for the generic message-digest checksum result.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md()

int mbedtls_md ( const mbedtls_md_info_t md_info,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
)

This function calculates the message-digest of a buffer, with respect to a configurable message-digest algorithm in a single call.

The result is calculated as Output = message_digest(input buffer).

Parameters
md_infoThe information structure of the message-digest algorithm to use.
inputThe buffer holding the data.
ilenThe length of the input data.
outputThe generic message-digest checksum result.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_hmac_starts()

int mbedtls_md_hmac_starts ( mbedtls_md_context_t ctx,
const unsigned char *  key,
size_t  keylen 
)

This function sets the HMAC key and prepares to authenticate a new message.

Call this function after mbedtls_md_setup(), to use the MD context for an HMAC calculation, then call mbedtls_md_hmac_update() to provide the input data, and mbedtls_md_hmac_finish() to get the HMAC value.

Parameters
ctxThe message digest context containing an embedded HMAC context.
keyThe HMAC secret key.
keylenThe length of the HMAC key in Bytes.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_hmac_update()

int mbedtls_md_hmac_update ( mbedtls_md_context_t ctx,
const unsigned char *  input,
size_t  ilen 
)

This function feeds an input buffer into an ongoing HMAC computation.

Call mbedtls_md_hmac_starts() or mbedtls_md_hmac_reset() before calling this function. You may call this function multiple times to pass the input piecewise. Afterwards, call mbedtls_md_hmac_finish().

Parameters
ctxThe message digest context containing an embedded HMAC context.
inputThe buffer holding the input data.
ilenThe length of the input data.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_hmac_finish()

int mbedtls_md_hmac_finish ( mbedtls_md_context_t ctx,
unsigned char *  output 
)

This function finishes the HMAC operation, and writes the result to the output buffer.

Call this function after mbedtls_md_hmac_starts() and mbedtls_md_hmac_update() to get the HMAC value. Afterwards you may either call mbedtls_md_free() to clear the context, or call mbedtls_md_hmac_reset() to reuse the context with the same HMAC key.

Parameters
ctxThe message digest context containing an embedded HMAC context.
outputThe generic HMAC checksum result.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_hmac_reset()

int mbedtls_md_hmac_reset ( mbedtls_md_context_t ctx)

This function prepares to authenticate a new message with the same key as the previous HMAC operation.

You may call this function after mbedtls_md_hmac_finish(). Afterwards call mbedtls_md_hmac_update() to pass the new input.

Parameters
ctxThe message digest context containing an embedded HMAC context.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md_hmac()

int mbedtls_md_hmac ( const mbedtls_md_info_t md_info,
const unsigned char *  key,
size_t  keylen,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output 
)

This function calculates the full generic HMAC on the input buffer with the provided key.

The function allocates the context, performs the calculation, and frees the context.

The HMAC result is calculated as output = generic HMAC(hmac key, input buffer).

Parameters
md_infoThe information structure of the message-digest algorithm to use.
keyThe HMAC secret key.
keylenThe length of the HMAC secret key in Bytes.
inputThe buffer holding the input data.
ilenThe length of the input data.
outputThe generic HMAC result.
Returns
0 on success.
MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.

◆ mbedtls_md4_init()

void mbedtls_md4_init ( mbedtls_md4_context ctx)

Initialize MD4 context.

Parameters
ctxMD4 context to be initialized
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_free()

void mbedtls_md4_free ( mbedtls_md4_context ctx)

Clear MD4 context.

Parameters
ctxMD4 context to be cleared
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_clone()

void mbedtls_md4_clone ( mbedtls_md4_context dst,
const mbedtls_md4_context src 
)

Clone (the state of) an MD4 context.

Parameters
dstThe destination context
srcThe context to be cloned
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_starts_ret()

int mbedtls_md4_starts_ret ( mbedtls_md4_context ctx)

MD4 context setup.

Parameters
ctxcontext to be initialized
Returns
0 if successful
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_update_ret()

int mbedtls_md4_update_ret ( mbedtls_md4_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD4 process buffer.

Parameters
ctxMD4 context
inputbuffer holding the data
ilenlength of the input data
Returns
0 if successful
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_finish_ret()

int mbedtls_md4_finish_ret ( mbedtls_md4_context ctx,
unsigned char  output[16] 
)

MD4 final digest.

Parameters
ctxMD4 context
outputMD4 checksum result
Returns
0 if successful
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_internal_md4_process()

int mbedtls_internal_md4_process ( mbedtls_md4_context ctx,
const unsigned char  data[64] 
)

MD4 process data block (internal use only)

Parameters
ctxMD4 context
databuffer holding one block of data
Returns
0 if successful
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_starts()

void mbedtls_md4_starts ( mbedtls_md4_context ctx)

MD4 context setup.

Deprecated:
Superseded by mbedtls_md4_starts_ret() in 2.7.0
Parameters
ctxcontext to be initialized
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_update()

void mbedtls_md4_update ( mbedtls_md4_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD4 process buffer.

Deprecated:
Superseded by mbedtls_md4_update_ret() in 2.7.0
Parameters
ctxMD4 context
inputbuffer holding the data
ilenlength of the input data
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_finish()

void mbedtls_md4_finish ( mbedtls_md4_context ctx,
unsigned char  output[16] 
)

MD4 final digest.

Deprecated:
Superseded by mbedtls_md4_finish_ret() in 2.7.0
Parameters
ctxMD4 context
outputMD4 checksum result
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_process()

void mbedtls_md4_process ( mbedtls_md4_context ctx,
const unsigned char  data[64] 
)

MD4 process data block (internal use only)

Deprecated:
Superseded by mbedtls_internal_md4_process() in 2.7.0
Parameters
ctxMD4 context
databuffer holding one block of data
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4_ret()

int mbedtls_md4_ret ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD4( input buffer )

Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD4 checksum result
Returns
0 if successful
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md4()

void mbedtls_md4 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD4( input buffer )

Deprecated:
Superseded by mbedtls_md4_ret() in 2.7.0
Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD4 checksum result
Warning
MD4 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_init()

void mbedtls_md5_init ( mbedtls_md5_context ctx)

Initialize MD5 context.

Parameters
ctxMD5 context to be initialized
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_free()

void mbedtls_md5_free ( mbedtls_md5_context ctx)

Clear MD5 context.

Parameters
ctxMD5 context to be cleared
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_clone()

void mbedtls_md5_clone ( mbedtls_md5_context dst,
const mbedtls_md5_context src 
)

Clone (the state of) an MD5 context.

Parameters
dstThe destination context
srcThe context to be cloned
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_starts_ret()

int mbedtls_md5_starts_ret ( mbedtls_md5_context ctx)

MD5 context setup.

Parameters
ctxcontext to be initialized
Returns
0 if successful
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_update_ret()

int mbedtls_md5_update_ret ( mbedtls_md5_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD5 process buffer.

Parameters
ctxMD5 context
inputbuffer holding the data
ilenlength of the input data
Returns
0 if successful
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_finish_ret()

int mbedtls_md5_finish_ret ( mbedtls_md5_context ctx,
unsigned char  output[16] 
)

MD5 final digest.

Parameters
ctxMD5 context
outputMD5 checksum result
Returns
0 if successful
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_internal_md5_process()

int mbedtls_internal_md5_process ( mbedtls_md5_context ctx,
const unsigned char  data[64] 
)

MD5 process data block (internal use only)

Parameters
ctxMD5 context
databuffer holding one block of data
Returns
0 if successful
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_starts()

void mbedtls_md5_starts ( mbedtls_md5_context ctx)

MD5 context setup.

Deprecated:
Superseded by mbedtls_md5_starts_ret() in 2.7.0
Parameters
ctxcontext to be initialized
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_update()

void mbedtls_md5_update ( mbedtls_md5_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD5 process buffer.

Deprecated:
Superseded by mbedtls_md5_update_ret() in 2.7.0
Parameters
ctxMD5 context
inputbuffer holding the data
ilenlength of the input data
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_finish()

void mbedtls_md5_finish ( mbedtls_md5_context ctx,
unsigned char  output[16] 
)

MD5 final digest.

Deprecated:
Superseded by mbedtls_md5_finish_ret() in 2.7.0
Parameters
ctxMD5 context
outputMD5 checksum result
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_process()

void mbedtls_md5_process ( mbedtls_md5_context ctx,
const unsigned char  data[64] 
)

MD5 process data block (internal use only)

Deprecated:
Superseded by mbedtls_internal_md5_process() in 2.7.0
Parameters
ctxMD5 context
databuffer holding one block of data
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5_ret()

int mbedtls_md5_ret ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD5( input buffer )

Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD5 checksum result
Returns
0 if successful
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md5()

void mbedtls_md5 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD5( input buffer )

Deprecated:
Superseded by mbedtls_md5_ret() in 2.7.0
Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD5 checksum result
Warning
MD5 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_init()

void mbedtls_md2_init ( mbedtls_md2_context ctx)

Initialize MD2 context.

Parameters
ctxMD2 context to be initialized
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_free()

void mbedtls_md2_free ( mbedtls_md2_context ctx)

Clear MD2 context.

Parameters
ctxMD2 context to be cleared
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_clone()

void mbedtls_md2_clone ( mbedtls_md2_context dst,
const mbedtls_md2_context src 
)

Clone (the state of) an MD2 context.

Parameters
dstThe destination context
srcThe context to be cloned
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_starts_ret()

int mbedtls_md2_starts_ret ( mbedtls_md2_context ctx)

MD2 context setup.

Parameters
ctxcontext to be initialized
Returns
0 if successful
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_update_ret()

int mbedtls_md2_update_ret ( mbedtls_md2_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD2 process buffer.

Parameters
ctxMD2 context
inputbuffer holding the data
ilenlength of the input data
Returns
0 if successful
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_finish_ret()

int mbedtls_md2_finish_ret ( mbedtls_md2_context ctx,
unsigned char  output[16] 
)

MD2 final digest.

Parameters
ctxMD2 context
outputMD2 checksum result
Returns
0 if successful
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_internal_md2_process()

int mbedtls_internal_md2_process ( mbedtls_md2_context ctx)

MD2 process data block (internal use only)

Parameters
ctxMD2 context
Returns
0 if successful
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_starts()

void mbedtls_md2_starts ( mbedtls_md2_context ctx)

MD2 context setup.

Deprecated:
Superseded by mbedtls_md2_starts_ret() in 2.7.0
Parameters
ctxcontext to be initialized
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_update()

void mbedtls_md2_update ( mbedtls_md2_context ctx,
const unsigned char *  input,
size_t  ilen 
)

MD2 process buffer.

Deprecated:
Superseded by mbedtls_md2_update_ret() in 2.7.0
Parameters
ctxMD2 context
inputbuffer holding the data
ilenlength of the input data
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_finish()

void mbedtls_md2_finish ( mbedtls_md2_context ctx,
unsigned char  output[16] 
)

MD2 final digest.

Deprecated:
Superseded by mbedtls_md2_finish_ret() in 2.7.0
Parameters
ctxMD2 context
outputMD2 checksum result
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_process()

void mbedtls_md2_process ( mbedtls_md2_context ctx)

MD2 process data block (internal use only)

Deprecated:
Superseded by mbedtls_internal_md2_process() in 2.7.0
Parameters
ctxMD2 context
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2_ret()

int mbedtls_md2_ret ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD2( input buffer )

Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD2 checksum result
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.

◆ mbedtls_md2()

void mbedtls_md2 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[16] 
)

Output = MD2( input buffer )

Deprecated:
Superseded by mbedtls_md2_ret() in 2.7.0
Parameters
inputbuffer holding the data
ilenlength of the input data
outputMD2 checksum result
Warning
MD2 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead.