The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Macros | Typedefs | Functions | Variables
md4.h File Reference

Structures and prototypes for our local MD4 implementation. More...

#include <freeradius-devel/build.h>
#include <freeradius-devel/missing.h>
#include <inttypes.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
+ Include dependency graph for md4.h:

Go to the source code of this file.

Macros

#define MD4_DIGEST_LENGTH   16
 

Typedefs

typedef fr_md4_ctx_t *(* fr_md4_ctx_alloc_t) (void)
 Allocation function for MD4 digest context. More...
 
typedef void(* fr_md4_ctx_copy_t) (fr_md4_ctx_t *dst, fr_md4_ctx_t const *src)
 Copy the contents of a ctx. More...
 
typedef void(* fr_md4_ctx_free_t) (fr_md4_ctx_t **ctx)
 Free function for MD4 digest ctx. More...
 
typedef void(* fr_md4_ctx_reset_t) (fr_md4_ctx_t *ctx)
 Reset the ctx to allow reuse. More...
 
typedef void fr_md4_ctx_t
 
typedef void(* fr_md4_final_t) (uint8_t out[static MD4_DIGEST_LENGTH], fr_md4_ctx_t *ctx)
 Finalise the ctx, producing the digest. More...
 
typedef void(* fr_md4_update_t) (fr_md4_ctx_t *ctx, uint8_t const *in, size_t inlen)
 Ingest plaintext into the digest. More...
 

Functions

void fr_md4_calc (uint8_t out[static MD4_DIGEST_LENGTH], uint8_t const *in, size_t inlen)
 Perform a single digest operation on a single input buffer. More...
 
fr_md4_ctx_tfr_md4_ctx_alloc_from_list (void)
 Allocate an md4 context from a free list. More...
 
void fr_md4_ctx_free_from_list (fr_md4_ctx_t **ctx)
 Release an md4 context back to a free list. More...
 

Variables

fr_md4_ctx_alloc_t fr_md4_ctx_alloc
 
fr_md4_ctx_copy_t fr_md4_ctx_copy
 
fr_md4_ctx_free_t fr_md4_ctx_free
 
fr_md4_ctx_reset_t fr_md4_ctx_reset
 
fr_md4_final_t fr_md4_final
 
fr_md4_update_t fr_md4_update
 

Detailed Description

Structures and prototypes for our local MD4 implementation.

Note
license is LGPL, but largely derived from a public domain source.

Structures and declarations for md4.

Definition in file md4.h.

Macro Definition Documentation

◆ MD4_DIGEST_LENGTH

#define MD4_DIGEST_LENGTH   16

Definition at line 25 of file md4.h.

Typedef Documentation

◆ fr_md4_ctx_alloc_t

typedef fr_md4_ctx_t*(* fr_md4_ctx_alloc_t) (void)

Allocation function for MD4 digest context.

Returns
  • An MD4 ctx.
  • NULL if out of memory.

Definition at line 53 of file md4.h.

◆ fr_md4_ctx_copy_t

typedef void(* fr_md4_ctx_copy_t) (fr_md4_ctx_t *dst, fr_md4_ctx_t const *src)

Copy the contents of a ctx.

Parameters
[in]dstWhere to copy the context to.
[in]srcWhere to copy the context from.

Definition at line 44 of file md4.h.

◆ fr_md4_ctx_free_t

typedef void(* fr_md4_ctx_free_t) (fr_md4_ctx_t **ctx)

Free function for MD4 digest ctx.

Parameters
[in]ctxMD4 ctx to free. If the shared ctx is passed in then the ctx is reset but not freed.

Definition at line 61 of file md4.h.

◆ fr_md4_ctx_reset_t

typedef void(* fr_md4_ctx_reset_t) (fr_md4_ctx_t *ctx)

Reset the ctx to allow reuse.

Parameters
[in]ctxTo reuse.

Definition at line 36 of file md4.h.

◆ fr_md4_ctx_t

typedef void fr_md4_ctx_t

Definition at line 28 of file md4.h.

◆ fr_md4_final_t

typedef void(* fr_md4_final_t) (uint8_t out[static MD4_DIGEST_LENGTH], fr_md4_ctx_t *ctx)

Finalise the ctx, producing the digest.

Parameters
[out]outThe MD4 digest.
[in]ctxTo finalise.

Definition at line 79 of file md4.h.

◆ fr_md4_update_t

typedef void(* fr_md4_update_t) (fr_md4_ctx_t *ctx, uint8_t const *in, size_t inlen)

Ingest plaintext into the digest.

Parameters
[in]ctxTo ingest data into.
[in]inData to ingest.
[in]inlenLength of data to ingest.

Definition at line 71 of file md4.h.

Function Documentation

◆ fr_md4_calc()

void fr_md4_calc ( uint8_t  out[static MD4_DIGEST_LENGTH],
uint8_t const *  in,
size_t  inlen 
)

Perform a single digest operation on a single input buffer.

Perform a single digest operation on a single input buffer.

Parameters
[out]outWhere to write the MD4 digest. Must be a minimum of MD4_DIGEST_LENGTH.
[in]inData to hash.
[in]inlenLength of the data.

Definition at line 482 of file md4.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_md4_ctx_alloc_from_list()

fr_md4_ctx_t* fr_md4_ctx_alloc_from_list ( void  )

Allocate an md4 context from a free list.

Allocate an md4 context from a free list.

Definition at line 508 of file md4.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fr_md4_ctx_free_from_list()

void fr_md4_ctx_free_from_list ( fr_md4_ctx_t **  ctx)

Release an md4 context back to a free list.

Release an md4 context back to a free list.

Definition at line 553 of file md4.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ fr_md4_ctx_alloc

fr_md4_ctx_alloc_t fr_md4_ctx_alloc
extern

Definition at line 471 of file md4.c.

◆ fr_md4_ctx_copy

fr_md4_ctx_copy_t fr_md4_ctx_copy
extern

Definition at line 470 of file md4.c.

◆ fr_md4_ctx_free

fr_md4_ctx_free_t fr_md4_ctx_free
extern

Definition at line 472 of file md4.c.

◆ fr_md4_ctx_reset

fr_md4_ctx_reset_t fr_md4_ctx_reset
extern

Definition at line 469 of file md4.c.

◆ fr_md4_final

fr_md4_final_t fr_md4_final
extern

Definition at line 474 of file md4.c.

◆ fr_md4_update

fr_md4_update_t fr_md4_update
extern

Definition at line 473 of file md4.c.