The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
A local MD5 implementation. More...
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/strerror.h>
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/md5.h>
Go to the source code of this file.
Data Structures | |
struct | fr_md5_ctx_local_t |
struct | fr_md5_free_list_t |
Macros | |
#define | ARRAY_SIZE (8) |
The thread local free list. More... | |
#define | MD5_BLOCK_LENGTH 64 |
#define | MD5_F1(x, y, z) (z ^ (x & (y ^ z))) |
#define | MD5_F2(x, y, z) MD5_F1(z, x, y) |
#define | MD5_F3(x, y, z) (x ^ y ^ z) |
#define | MD5_F4(x, y, z) (y ^ (x | ~z)) |
#define | MD5STEP(f, w, x, y, z, data, s) (w += f(x, y, z) + data, w = w << s | w >> (32 - s), w += x) |
#define | PUT_32BIT_LE(cp, value) |
#define | PUT_64BIT_LE(cp, value) |
Functions | |
static int | _md5_ctx_free_on_exit (void *arg) |
void | fr_md5_calc (uint8_t out[static MD5_DIGEST_LENGTH], uint8_t const *in, size_t inlen) |
Calculate the MD5 hash of the contents of a buffer. More... | |
fr_md5_ctx_t * | fr_md5_ctx_alloc_from_list (void) |
void | fr_md5_ctx_free_from_list (fr_md5_ctx_t **ctx) |
static fr_md5_ctx_t * | fr_md5_local_ctx_alloc (void) |
static void | fr_md5_local_ctx_copy (fr_md5_ctx_t *dst, fr_md5_ctx_t const *src) |
static void | fr_md5_local_ctx_free (fr_md5_ctx_t **ctx) |
static void | fr_md5_local_ctx_reset (fr_md5_ctx_t *ctx) |
static void | fr_md5_local_final (uint8_t out[static MD5_DIGEST_LENGTH], fr_md5_ctx_t *ctx) |
static void | fr_md5_local_transform (uint32_t state[static 4], uint8_t const block[static MD5_BLOCK_LENGTH]) |
The core of the MD5 algorithm. More... | |
static void | fr_md5_local_update (fr_md5_ctx_t *ctx, uint8_t const *in, size_t inlen) |
Variables | |
fr_md5_ctx_alloc_t | fr_md5_ctx_alloc = fr_md5_local_ctx_alloc |
fr_md5_ctx_copy_t | fr_md5_ctx_copy = fr_md5_local_ctx_copy |
fr_md5_ctx_free_t | fr_md5_ctx_free = fr_md5_local_ctx_free |
fr_md5_ctx_reset_t | fr_md5_ctx_reset = fr_md5_local_ctx_reset |
fr_md5_final_t | fr_md5_final = fr_md5_local_final |
fr_md5_update_t | fr_md5_update = fr_md5_local_update |
static _Thread_local fr_md5_free_list_t * | md5_array |
static const uint8_t | PADDING [MD5_BLOCK_LENGTH] |
static const uint8_t * | zero = (uint8_t[]){ 0x00 } |
A local MD5 implementation.
Definition in file md5.c.
struct fr_md5_ctx_local_t |
struct fr_md5_free_list_t |
Data Fields | ||
---|---|---|
fr_md5_ctx_t * | md_ctx | |
bool | used |
#define ARRAY_SIZE (8) |
|
static |
Calculate the MD5 hash of the contents of a buffer.
Perform a single digest operation on a single input buffer.
[out] | out | Where to write the MD5 digest. Must be a minimum of MD5_DIGEST_LENGTH. |
[in] | in | Data to hash. |
[in] | inlen | Length of the data. |
Definition at line 451 of file md5.c.
fr_md5_ctx_t* fr_md5_ctx_alloc_from_list | ( | void | ) |
void fr_md5_ctx_free_from_list | ( | fr_md5_ctx_t ** | ctx | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
The core of the MD5 algorithm.
This alters an existing MD5 hash to reflect the addition of 16 longwords of new data. fr_md5_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 | MD5 digest block to update. |
Definition at line 183 of file md5.c.
|
static |
fr_md5_ctx_alloc_t fr_md5_ctx_alloc = fr_md5_local_ctx_alloc |
fr_md5_ctx_copy_t fr_md5_ctx_copy = fr_md5_local_ctx_copy |
fr_md5_ctx_free_t fr_md5_ctx_free = fr_md5_local_ctx_free |
fr_md5_ctx_reset_t fr_md5_ctx_reset = fr_md5_local_ctx_reset |
fr_md5_final_t fr_md5_final = fr_md5_local_final |
fr_md5_update_t fr_md5_update = fr_md5_local_update |
|
static |
|
static |