md5.c File Reference

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

Classes

struct  md5_ctx

Defines

#define WORDS_BIGENDIAN   1
#define SWAP(n)   (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#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 uint32_t md5_uint32
typedef uintptr_t md5_uintptr

Functions

void md5_init_ctx (struct md5_ctx *ctx) __THROW
void md5_process_block (__const void *buffer, size_t len, struct md5_ctx *ctx) __THROW
void md5_process_bytes (__const void *buffer, size_t len, struct md5_ctx *ctx) __THROW
void * md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW
void * md5_read_ctx (__const struct md5_ctx *ctx, void *resbuf) __THROW
int md5_stream (FILE *stream, void *resblock) __THROW
void * md5_read_ctx (struct md5_ctx *ctx, void *resbuf) const
void md5_process_bytes (void *buffer, size_t len, struct md5_ctx *ctx) const
void md5_process_block (void *buffer, size_t len, struct md5_ctx *ctx) const

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

#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) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))

Referenced by md5_finish_ctx(), and md5_read_ctx().

#define WORDS_BIGENDIAN   1


Typedef Documentation

typedef uint32_t md5_uint32

typedef uintptr_t md5_uintptr


Function Documentation

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

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

Referenced by md5_stream().

void md5_init_ctx ( struct md5_ctx ctx  ) 

Referenced by md5_stream().

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

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

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

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

Referenced by md5_stream().

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

References SWAP.

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

Referenced by md5_finish_ctx().

int md5_stream ( FILE *  stream,
void *  resblock 
)


Variable Documentation

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


Generated on Sat Jun 7 05:16:31 2008 for yast2-printer by  doxygen 1.5.5