LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_md5.c File Reference
#include "c_md5.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <getopt.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <endian.h>
#include <unistd.h>
#include <fcntl.h>

Go to the source code of this file.

Data Structures

struct  md5_ctx
 

Macros

#define SWAP(n)   (n)
 
#define FF(b, c, d)   (d ^ (b & (c ^ d)))
 
#define FG(b, c, d)   FF (d, b, c)
 
#define FH(b, c, d)   (b ^ c ^ d)
 
#define FI(b, c, d)   (c ^ (b | ~d))
 
#define OPENOPTS(BINARY)   "r"
 
#define OP(a, b, c, d, s, T)
 
#define CYCLIC(w, s)   (w = (w << s) | (w >> (32 - s)))
 
#define OP(f, a, b, c, d, k, s, T)
 
#define BLOCKSIZE   4096
 

Typedefs

typedef u_int32_t md5_uint32
 

Functions

void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
 
void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
 
void md5_init_ctx (struct md5_ctx *ctx)
 
void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
 
void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
 
int md5_stream (FILE *stream, void *resblock)
 
int md5_file (char *filename, int binary, unsigned char *md5_result)
 

Macro Definition Documentation

#define BLOCKSIZE   4096
#define CYCLIC (   w,
 
)    (w = (w << s) | (w >> (32 - s)))
#define FF (   b,
  c,
 
)    (d ^ (b & (c ^ d)))

Definition at line 60 of file c_md5.c.

#define FG (   b,
  c,
 
)    FF (d, b, c)

Definition at line 61 of file c_md5.c.

#define FH (   b,
  c,
 
)    (b ^ c ^ d)

Definition at line 62 of file c_md5.c.

#define FI (   b,
  c,
 
)    (c ^ (b | ~d))

Definition at line 63 of file c_md5.c.

#define OP (   a,
  b,
  c,
  d,
  s,
 
)
Value:
do \
{ \
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
++words; \
CYCLIC (a, s); \
a += b; \
} \
while (0)
#define CYCLIC(w, s)
#define SWAP(n)
Definition: c_md5.c:50
#define FF(b, c, d)
Definition: c_md5.c:60
#define OP (   f,
  a,
  b,
  c,
  d,
  k,
  s,
 
)
Value:
do \
{ \
a += f (b, c, d) + correct_words[k] + T; \
CYCLIC (a, s); \
a += b; \
} \
while (0)
#define CYCLIC(w, s)
#define OPENOPTS (   BINARY)    "r"

Definition at line 66 of file c_md5.c.

#define SWAP (   n)    (n)

Definition at line 50 of file c_md5.c.

Typedef Documentation

typedef u_int32_t md5_uint32

Definition at line 35 of file c_md5.c.

Function Documentation

int md5_file ( char *  filename,
int  binary,
unsigned char *  md5_result 
)

Definition at line 400 of file c_md5.c.

void* md5_finish_ctx ( struct md5_ctx ctx,
void *  resbuf 
)

Definition at line 308 of file c_md5.c.

void md5_init_ctx ( struct md5_ctx ctx)

Definition at line 275 of file c_md5.c.

void md5_process_block ( const void *  buffer,
size_t  len,
struct md5_ctx ctx 
)

Definition at line 71 of file c_md5.c.

void md5_process_bytes ( const void *  buffer,
size_t  len,
struct md5_ctx ctx 
)

Definition at line 230 of file c_md5.c.

void* md5_read_ctx ( const struct md5_ctx ctx,
void *  resbuf 
)

Definition at line 292 of file c_md5.c.

int md5_stream ( FILE *  stream,
void *  resblock 
)

Definition at line 338 of file c_md5.c.