Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

md5.c File Reference

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>

Go to the source code of this file.

Classes

struct  md5_ctx

Defines

#define UINT_MAX_32_BITS   0xFFFFFFFF
#define UINT_MAX   UINT_MAX_32_BITS
#define SWAP(n)   (n)
#define BLOCKSIZE   4096
#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 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)

Typedefs

typedef unsigned int md5_uint32

Functions

static void md5_init_ctx (struct md5_ctx *ctx)
static void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
static void * md5_read_ctx (const struct md5_ctx *ctx, void *resbuf)
int md5_stream (FILE *stream, void *resblock)
void * md5_buffer (const char *buffer, size_t len, void *resblock)

Variables

static const unsigned char fillbuf [64] = { 0x80, 0 }

Define Documentation

#define BLOCKSIZE   4096

Referenced by md5_stream().

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

Definition at line 260 of file md5.c.

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

Definition at line 261 of file md5.c.

Referenced by md5_process_block().

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

Definition at line 262 of file md5.c.

Referenced by md5_process_block().

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

Definition at line 263 of file md5.c.

Referenced by md5_process_block().

#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)

Referenced by md5_process_block().

#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 SWAP (   n)    (n)

Definition at line 105 of file md5.c.

Referenced by md5_buffer(), md5_read_ctx(), and md5_stream().

#define UINT_MAX   UINT_MAX_32_BITS

Definition at line 52 of file md5.c.

Referenced by edge_store_from_mface_tri(), and SG_TreeFactory::MakeTreeUp().

#define UINT_MAX_32_BITS   0xFFFFFFFF

Definition at line 43 of file md5.c.


Typedef Documentation

typedef unsigned int md5_uint32

Definition at line 56 of file md5.c.


Function Documentation

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

Definition at line 219 of file md5.c.

References fillbuf, md5_init_ctx(), md5_process_block(), md5_read_ctx(), and SWAP.

Referenced by thumbname_from_uri().

static void md5_init_ctx ( struct md5_ctx ctx) [static]

Definition at line 116 of file md5.c.

References md5_ctx::A, md5_ctx::B, md5_ctx::C, and md5_ctx::D.

Referenced by md5_buffer(), and md5_stream().

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

Definition at line 268 of file md5.c.

References md5_ctx::A, B, md5_ctx::B, C, md5_ctx::C, md5_ctx::D, D(), FG, FH, FI, and OP.

Referenced by md5_buffer(), and md5_stream().

static void * md5_read_ctx ( const struct md5_ctx ctx,
void *  resbuf 
) [static]

Definition at line 126 of file md5.c.

References md5_ctx::A, md5_ctx::B, md5_ctx::C, md5_ctx::D, and SWAP.

Referenced by md5_buffer(), and md5_stream().

int md5_stream ( FILE *  stream,
void *  resblock 
)

Definition at line 139 of file md5.c.

References BLOCKSIZE, fillbuf, len(), md5_init_ctx(), md5_process_block(), md5_read_ctx(), sum(), and SWAP.


Variable Documentation

const unsigned char fillbuf[64] = { 0x80, 0 } [static]

Definition at line 111 of file md5.c.

Referenced by md5_buffer(), and md5_stream().