GNU libmicrohttpd 1.0.1
Loading...
Searching...
No Matches
md5_ext.h File Reference

Wrapper declarations for MD5 calculation performed by TLS library. More...

#include "mhd_options.h"
#include <stdint.h>
Include dependency graph for md5_ext.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Md5CtxExt
 

Macros

#define MD5_DIGEST_SIZE   (16)
 
#define MHD_MD5_HAS_EXT_ERROR   1
 
#define MHD_MD5_HAS_INIT_ONE_TIME   1
 
#define MHD_MD5_HAS_FINISH_RESET   1
 
#define MHD_MD5_HAS_DEINIT   1
 

Functions

void MHD_MD5_init_one_time (struct Md5CtxExt *ctx)
 
void MHD_MD5_update (struct Md5CtxExt *ctx, const uint8_t *data, size_t length)
 
void MHD_MD5_finish_reset (struct Md5CtxExt *ctx, uint8_t digest[MD5_DIGEST_SIZE])
 
void MHD_MD5_deinit (struct Md5CtxExt *ctx)
 

Detailed Description

Wrapper declarations for MD5 calculation performed by TLS library.

Author
Karlson2k (Evgeny Grin)

Definition in file md5_ext.h.

Macro Definition Documentation

◆ MD5_DIGEST_SIZE

#define MD5_DIGEST_SIZE   (16)

Size of MD5 resulting digest in bytes This is the final digest size, not intermediate hash.

Definition at line 37 of file md5_ext.h.

◆ MHD_MD5_HAS_DEINIT

#define MHD_MD5_HAS_DEINIT   1

Indicates that MHD_MD5_deinit() function is present

Definition at line 103 of file md5_ext.h.

◆ MHD_MD5_HAS_EXT_ERROR

#define MHD_MD5_HAS_EXT_ERROR   1

Indicates that struct Md5CtxExt has 'ext_error'

Definition at line 45 of file md5_ext.h.

◆ MHD_MD5_HAS_FINISH_RESET

#define MHD_MD5_HAS_FINISH_RESET   1

Indicates that MHD_MD5_finish_reset() function is available

Definition at line 88 of file md5_ext.h.

◆ MHD_MD5_HAS_INIT_ONE_TIME

#define MHD_MD5_HAS_INIT_ONE_TIME   1

Indicates that MHD_MD5_init_one_time() function is present.

Definition at line 59 of file md5_ext.h.

Function Documentation

◆ MHD_MD5_deinit()

void MHD_MD5_deinit ( struct Md5CtxExt * ctx)

Free allocated resources.

Parameters
ctxthe calculation context

Definition at line 98 of file md5_ext.c.

References Md5CtxExt::handle, and NULL.

◆ MHD_MD5_finish_reset()

void MHD_MD5_finish_reset ( struct Md5CtxExt * ctx,
uint8_t digest[MD5_DIGEST_SIZE] )

Finalise MD5 calculation, return digest, reset hash calculation.

Parameters
ctxthe calculation context
[out]digestset to the hash, must be MD5_DIGEST_SIZE bytes

Definition at line 84 of file md5_ext.c.

References Md5CtxExt::ext_error, Md5CtxExt::handle, and MD5_DIGEST_SIZE.

◆ MHD_MD5_init_one_time()

void MHD_MD5_init_one_time ( struct Md5CtxExt * ctx)

Initialise structure for MD5 calculation, allocate resources.

This function must not be called more than one time for ctx.

Parameters
ctxthe calculation context

Definition at line 39 of file md5_ext.c.

References Md5CtxExt::ext_error, Md5CtxExt::handle, mhd_assert, and NULL.

◆ MHD_MD5_update()

void MHD_MD5_update ( struct Md5CtxExt * ctx,
const uint8_t * data,
size_t length )

MD5 process portion of bytes.

Parameters
ctxthe calculation context
databytes to add to hash
lengthnumber of bytes in data

Process portion of bytes.

Parameters
ctxthe calculation context
databytes to add to hash
lengthnumber of bytes in data

Definition at line 68 of file md5_ext.c.

References data, Md5CtxExt::ext_error, and Md5CtxExt::handle.