md5.cpp File Reference

#include <sys/types.h>
#include <cstdlib>
#include <cstring>
#include <string>
#include "md5.h"
#include "log.h"

Defines

#define SWAP(n)   (n)
#define BLOCKSIZE   4096
#define BLOCKSIZE   4096
#define UNALIGNED_P(p)   (((md5_uintptr) p) % sizeof (uint32_t) != 0)
#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)

Functions

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)
bool md5_filespec (string &filespec, void *resblock)
bool md5_filespec_check (std::string &filespec, std::string &md5)
void * md5_buffer (const char *buffer, size_t len, void *resblock)
void md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
void md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)

Define Documentation

#define BLOCKSIZE   4096
#define BLOCKSIZE   4096

Referenced by md5_filespec(), and md5_stream().

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

Referenced by md5_process_block().

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

Referenced by md5_process_block().

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

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

Referenced by md5_finish_ctx(), and md5_read_ctx().

#define UNALIGNED_P (  )     (((md5_uintptr) p) % sizeof (uint32_t) != 0)

Referenced by md5_process_bytes().


Function Documentation

void* md5_buffer ( const char *  buffer,
size_t  len,
void *  resblock 
)
bool md5_filespec ( string &  filespec,
void *  resblock 
)
bool md5_filespec_check ( std::string &  filespec,
std::string &  md5 
)

References hexify(), MD5_DIGEST_SIZE, and md5_filespec().

Referenced by main().

void* md5_finish_ctx ( struct md5_ctx ctx,
void *  resbuf 
)
void md5_init_ctx ( struct md5_ctx ctx  ) 
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_read_ctx ( const struct md5_ctx ctx,
void *  resbuf 
)

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

Referenced by md5_finish_ctx().

int md5_stream ( FILE *  stream,
void *  resblock 
)

Generated on 15 Apr 2010 for Gnash by  doxygen 1.6.1