Freeciv-3.2: /fast/freeciv/nightly/S3_2/utility/md5.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
md5.c File Reference
`#include <stdio.h>`
`#include <string.h>`
`#include "md5.h"`

Go to the source code of this file.

## Data Structures

struct | MD5_CTX

## Macros

#define | F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
#define | G(x, y, z) ((y) ^ ((z) & ((x) ^ (y))))
#define | H(x, y, z) (((x) ^ (y)) ^ (z))
#define | H2(x, y, z) ((x) ^ ((y) ^ (z)))
#define | I(x, y, z) ((y) ^ ((x) | ~(z)))
#define | STEP(f, a, b, c, d, x, t, s)
#define | SET(n)
#define | GET(n) (ctx->block[(n)])
#define | OUT(dst, src)

## Typedefs

typedef unsigned int | MD5_u32plus

## Functions

static const void * | body (MD5_CTX *ctx, const void *data, unsigned long size)
static void | MD5_Init (MD5_CTX *ctx)
static void | MD5_Update (MD5_CTX *ctx, const void *data, unsigned long size)
static void | MD5_Final (unsigned char *result, MD5_CTX *ctx)
static void | md5_buffer (const unsigned char *buffer, size_t len, unsigned char *resblock)
void | create_md5sum (const unsigned char *input, int len, char output[MD5_HEX_BYTES+1])

## Macro Definition Documentation

## ◆ F

#define F | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | ((z) ^ ((x) & ((y) ^ (z))))

Definition at line 90 of file md5.c.

## ◆ G

#define G | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | ((y) ^ ((z) & ((x) ^ (y))))

Definition at line 91 of file md5.c.

## ◆ GET

#define GET | ( |  | n | ) | (ctx->block[(n)])

Definition at line 114 of file md5.c.

## ◆ H

#define H | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | (((x) ^ (y)) ^ (z))

Definition at line 92 of file md5.c.

## ◆ H2

#define H2 | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | ((x) ^ ((y) ^ (z)))

Definition at line 93 of file md5.c.

## ◆ I

#define I | ( |  | x,
|  |  | y,
|  |  | z
| ) |  | ((y) ^ ((x) | ~(z)))

Definition at line 94 of file md5.c.

## ◆ OUT

#define OUT | ( |  | dst,
|  |  | src
| ) |  |

Value:
(dst)[0] = (unsigned char)(src); \
(dst)[1] = (unsigned char)((src) >> 8); \
(dst)[2] = (unsigned char)((src) >> 16); \
(dst)[3] = (unsigned char)((src) >> 24);

Definition at line 273 of file md5.c.

## ◆ SET

#define SET | ( |  | n | ) |

Value:
(ctx->block[(n)] = \
(MD5_u32plus)ptr[(n) * 4] | \
((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \
((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \
((MD5_u32plus)ptr[(n) * 4 + 3] << 24))
n
#define n
Definition astring.c:77
incite_cost
char * incite_cost
Definition comments.c:74
MD5_u32plus
unsigned int MD5_u32plus
Definition md5.c:74

Definition at line 108 of file md5.c.

## ◆ STEP

#define STEP | ( |  | f,
|  |  | a,
|  |  | b,
|  |  | c,
|  |  | d,
|  |  | x,
|  |  | t,
|  |  | s
| ) |  |

Value:
(a) += f((b), (c), (d)) + (x) + (t); \
(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \
(a) += (b);
x
struct sprite int x
Definition sprite_g.h:31

Definition at line 99 of file md5.c.

## Typedef Documentation

## ◆ MD5_u32plus

typedef unsigned int MD5_u32plus

Definition at line 74 of file md5.c.

## Function Documentation

## ◆ body()

static const void * body | ( | MD5_CTX * | ctx,
|  | const void * | data,
|  | unsigned long | size
| ) |  |

static

Definition at line 121 of file md5.c.

Referenced by MD5_Final(), MD5_Update(), and popup_act_confirmation_dialog().

## ◆ create_md5sum()

void create_md5sum | ( | const unsigned char * | input,
|  | int | len,
|  | char | output[MD5_HEX_BYTES+1]
| ) |  |

Definition at line 335 of file md5.c.

## ◆ md5_buffer()

static void md5_buffer | ( | const unsigned char * | buffer,
|  | size_t | len,
|  | unsigned char * | resblock
| ) |  |

static

Definition at line 317 of file md5.c.

Referenced by create_md5sum().

## ◆ MD5_Final()

static void MD5_Final | ( | unsigned char * | result,
|  | MD5_CTX * | ctx
| ) |  |

static

Definition at line 279 of file md5.c.

Referenced by md5_buffer().

## ◆ MD5_Init()

static void MD5_Init | ( | MD5_CTX * | ctx | ) |

static

Definition at line 228 of file md5.c.

Referenced by md5_buffer().

## ◆ MD5_Update()

static void MD5_Update | ( | MD5_CTX * | ctx,
|  | const void * | data,
|  | unsigned long | size
| ) |  |

static

Definition at line 239 of file md5.c.

Referenced by md5_buffer().