The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
A local MD4 implementation. More...
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/strerror.h>
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/md4.h>
Go to the source code of this file.
Data Structures | |
struct | fr_md4_ctx_local_t |
struct | fr_md4_free_list_t |
Macros | |
#define | ARRAY_SIZE (8) |
The thread local free list. | |
#define | htole32_14(buf) /* Nothing */ |
#define | htole32_16(buf) /* Nothing */ |
#define | htole32_4(buf) /* Nothing */ |
#define | MD4_BLOCK_LENGTH 64 |
#define | MD4_F1(x, y, z) (z ^ (x & (y ^ z))) |
#define | MD4_F2(x, y, z) ((x & y) | (x & z) | (y & z)) |
#define | MD4_F3(x, y, z) (x ^ y ^ z) |
#define | MD4STEP(f, w, x, y, z, data, s) (w += f(x, y, z) + data, w = w << s | w >> (32 - s)) |
Functions | |
static int | _md4_ctx_free_on_exit (void *arg) |
void | fr_md4_calc (uint8_t out[static MD4_DIGEST_LENGTH], uint8_t const *in, size_t inlen) |
Calculate the MD4 hash of the contents of a buffer. | |
fr_md4_ctx_t * | fr_md4_ctx_alloc_from_list (void) |
void | fr_md4_ctx_free_from_list (fr_md4_ctx_t **ctx) |
static fr_md4_ctx_t * | fr_md4_local_ctx_alloc (void) |
static void | fr_md4_local_ctx_copy (fr_md4_ctx_t *dst, fr_md4_ctx_t const *src) |
static void | fr_md4_local_ctx_free (fr_md4_ctx_t **ctx) |
static void | fr_md4_local_ctx_reset (fr_md4_ctx_t *ctx) |
static void | fr_md4_local_final (uint8_t out[static MD4_DIGEST_LENGTH], fr_md4_ctx_t *ctx) |
static void | fr_md4_local_transform (uint32_t state[static 4], uint8_t const block[static MD4_BLOCK_LENGTH]) |
The core of the MD4 algorithm. | |
static void | fr_md4_local_update (fr_md4_ctx_t *ctx, uint8_t const *in, size_t inlen) |
Variables | |
fr_md4_ctx_alloc_t | fr_md4_ctx_alloc = fr_md4_local_ctx_alloc |
fr_md4_ctx_copy_t | fr_md4_ctx_copy = fr_md4_local_ctx_copy |
fr_md4_ctx_free_t | fr_md4_ctx_free = fr_md4_local_ctx_free |
fr_md4_ctx_reset_t | fr_md4_ctx_reset = fr_md4_local_ctx_reset |
fr_md4_final_t | fr_md4_final = fr_md4_local_final |
fr_md4_update_t | fr_md4_update = fr_md4_local_update |
static _Thread_local fr_md4_free_list_t * | md4_array |
static const uint8_t * | zero = (uint8_t[]){ 0x00 } |
A local MD4 implementation.
Definition in file md4.c.
struct fr_md4_ctx_local_t |
struct fr_md4_free_list_t |
Data Fields | ||
---|---|---|
fr_md4_ctx_t * | md_ctx | |
bool | used |
#define ARRAY_SIZE (8) |
|
static |
Calculate the MD4 hash of the contents of a buffer.
Perform a single digest operation on a single input buffer.
[out] | out | Where to write the MD4 digest. Must be a minimum of MD4_DIGEST_LENGTH. |
[in] | in | Data to hash. |
[in] | inlen | Length of the data. |
Definition at line 482 of file md4.c.
fr_md4_ctx_t * fr_md4_ctx_alloc_from_list | ( | void | ) |
void fr_md4_ctx_free_from_list | ( | fr_md4_ctx_t ** | ctx | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
The core of the MD4 algorithm.
This alters an existing MD4 hash to reflect the addition of 16 longwords of new data. fr_md4_update blocks the data and converts bytes into longwords for this routine.
[in] | state | 16 bytes of data to feed into the hashing function. |
[in,out] | block | MD4 digest block to update. |
Definition at line 209 of file md4.c.
|
static |
fr_md4_ctx_alloc_t fr_md4_ctx_alloc = fr_md4_local_ctx_alloc |
fr_md4_ctx_copy_t fr_md4_ctx_copy = fr_md4_local_ctx_copy |
fr_md4_ctx_free_t fr_md4_ctx_free = fr_md4_local_ctx_free |
fr_md4_ctx_reset_t fr_md4_ctx_reset = fr_md4_local_ctx_reset |
fr_md4_final_t fr_md4_final = fr_md4_local_final |
fr_md4_update_t fr_md4_update = fr_md4_local_update |
|
static |