Sirikata
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
Sirikata::MD5 Class Reference

#include <Md5.hpp>

Collaboration diagram for Sirikata::MD5:

List of all members.

Public Member Functions

 MD5 ()
void update (unsigned char *input, unsigned int input_length)
void update (std::istream &stream)
void update (std::ifstream &stream)
void finalize ()
 MD5 (unsigned char *string)
 MD5 (unsigned char *string, unsigned int input_length)
 MD5 (std::istream &stream)
 MD5 (std::ifstream &stream)
unsigned char * raw_digest ()
char * hex_digest ()

Private Types

typedef unsigned int uint4
typedef unsigned short int uint2
typedef unsigned char uint1

Private Member Functions

void init ()
void transform (uint1 *buffer)

Static Private Member Functions

static void encode (uint1 *dest, uint4 *src, uint4 length)
static void decode (uint4 *dest, uint1 *src, uint4 length)
static void memcpy (uint1 *dest, uint1 *src, uint4 length)
static void memset (uint1 *start, uint1 val, uint4 length)
static uint4 rotate_left (uint4 x, uint4 n)
static uint4 F (uint4 x, uint4 y, uint4 z)
static uint4 G (uint4 x, uint4 y, uint4 z)
static uint4 H (uint4 x, uint4 y, uint4 z)
static uint4 I (uint4 x, uint4 y, uint4 z)
static void FF (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
static void GG (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
static void HH (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)
static void II (uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac)

Private Attributes

uint4 state [4]
uint4 count [2]
uint1 buffer [64]
uint1 digest [16]
uint1 finalized
char _hex_digest [33]

Friends

std::ostream & operator<< (std::ostream &, MD5 context)

Member Typedef Documentation

typedef unsigned char Sirikata::MD5::uint1 [private]
typedef unsigned short int Sirikata::MD5::uint2 [private]
typedef unsigned int Sirikata::MD5::uint4 [private]

Constructor & Destructor Documentation

Sirikata::MD5::MD5 ( )

References init().

Sirikata::MD5::MD5 ( unsigned char *  string)

References finalize(), init(), and update().

Sirikata::MD5::MD5 ( unsigned char *  string,
unsigned int  input_length 
)

References finalize(), init(), and update().

Sirikata::MD5::MD5 ( std::istream &  stream)

References finalize(), init(), and update().

Sirikata::MD5::MD5 ( std::ifstream &  stream)

References finalize(), init(), and update().


Member Function Documentation

void Sirikata::MD5::decode ( uint4 dest,
uint1 src,
uint4  length 
) [static, private]

Referenced by transform().

void Sirikata::MD5::encode ( uint1 dest,
uint4 src,
uint4  length 
) [static, private]

Referenced by finalize().

unsigned int Sirikata::MD5::F ( uint4  x,
uint4  y,
uint4  z 
) [inline, static, private]

Referenced by FF().

void Sirikata::MD5::FF ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
) [inline, static, private]

References F(), and rotate_left().

Referenced by transform().

void Sirikata::MD5::finalize ( )

References buffer, count, digest, encode(), finalized, memset(), state, and update().

Referenced by MD5().

unsigned int Sirikata::MD5::G ( uint4  x,
uint4  y,
uint4  z 
) [inline, static, private]

Referenced by GG().

void Sirikata::MD5::GG ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
) [inline, static, private]

References G(), and rotate_left().

Referenced by transform().

unsigned int Sirikata::MD5::H ( uint4  x,
uint4  y,
uint4  z 
) [inline, static, private]

Referenced by HH().

char * Sirikata::MD5::hex_digest ( )

References _hex_digest, digest, and finalized.

Referenced by Sirikata::operator<<().

void Sirikata::MD5::HH ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
) [inline, static, private]

References H(), and rotate_left().

Referenced by transform().

unsigned int Sirikata::MD5::I ( uint4  x,
uint4  y,
uint4  z 
) [inline, static, private]

Referenced by II().

void Sirikata::MD5::II ( uint4 a,
uint4  b,
uint4  c,
uint4  d,
uint4  x,
uint4  s,
uint4  ac 
) [inline, static, private]

References I(), and rotate_left().

Referenced by transform().

void Sirikata::MD5::init ( ) [private]

References count, finalized, and state.

Referenced by MD5().

void Sirikata::MD5::memcpy ( uint1 dest,
uint1 src,
uint4  length 
) [static, private]

Referenced by update().

void Sirikata::MD5::memset ( uint1 start,
uint1  val,
uint4  length 
) [static, private]

Referenced by finalize(), and transform().

unsigned char * Sirikata::MD5::raw_digest ( )

References digest, and finalized.

unsigned int Sirikata::MD5::rotate_left ( uint4  x,
uint4  n 
) [inline, static, private]

Referenced by FF(), GG(), HH(), and II().

void Sirikata::MD5::transform ( uint1 buffer) [private]

References decode(), FF(), finalized, GG(), HH(), II(), memset(), S11, S12, S13, S14, S21, S22, S23, S24, S31, S32, S33, S34, S41, S42, S43, S44, and state.

Referenced by update().

void Sirikata::MD5::update ( unsigned char *  input,
unsigned int  input_length 
)

References buffer, count, finalized, memcpy(), and transform().

Referenced by finalize(), MD5(), and update().

void Sirikata::MD5::update ( std::istream &  stream)

References buffer, and update().

void Sirikata::MD5::update ( std::ifstream &  stream)

References buffer, and update().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
MD5  context 
) [friend]

Member Data Documentation

char Sirikata::MD5::_hex_digest[33] [private]

Referenced by hex_digest().

Referenced by finalize(), and update().

Referenced by finalize(), init(), and update().

Referenced by finalize(), hex_digest(), and raw_digest().

Referenced by finalize(), init(), and transform().


The documentation for this class was generated from the following files: