The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MD5 Class Reference

This class represents the implementation of the md5 message digest algorithm. More...

#include <md5.h>

+ Collaboration diagram for MD5:

Public Member Functions

void Reset ()
 Initialization begins an operation, writing a new context.
 
void Input (unsigned char *input, unsigned int inputLen)
 Block update operation. Continues an md5 message-digest operation, processing another message block, and updating the context. More...
 
void Result (unsigned char digest[16])
 Finalization ends the md5 message-digest operation, writing the the message digest and zeroizing the context. More...
 
 MD5 ()
 default constructor
 

Private Member Functions

void MD5Transform (unsigned long int state[4], unsigned char block[64])
 Basic transformation. Transforms state based on block. More...
 
void Encode (unsigned char *output, unsigned long int *input, unsigned int len)
 Encodes input data. More...
 
void Decode (unsigned long int *output, unsigned char *input, unsigned int len)
 Decodes input data into output. More...
 
void MD5_memcpy (POINTER output, POINTER input, unsigned int len)
 internal memory management More...
 
void MD5_memset (POINTER output, int value, unsigned int len)
 internal memory management More...
 

Private Attributes

unsigned long int state [4]
 
unsigned long int count [2]
 
unsigned char buffer [64]
 

Detailed Description

This class represents the implementation of the md5 message digest algorithm.

Basically the class provides three public member-functions to create a hash: Reset(), Input() and Result().

Definition at line 84 of file system/include/pedigree/kernel/utilities/md5/md5.h.

Member Function Documentation

void MD5::Decode ( unsigned long int *  output,
unsigned char *  input,
unsigned int  len 
)
private

Decodes input data into output.

Parameters
outputDecoded data as OUT parameter
inputInput data
lenThe length of the input assuming it is a multiple of 4

Definition at line 266 of file md5.cc.

Referenced by MD5Transform().

+ Here is the caller graph for this function:

void MD5::Encode ( unsigned char *  output,
unsigned long int *  input,
unsigned int  len 
)
private

Encodes input data.

Parameters
outputEncoded data as OUT parameter
inputInput data
lenThe length of the input assuming it is a multiple of 4

Definition at line 245 of file md5.cc.

Referenced by Result().

+ Here is the caller graph for this function:

void MD5::Input ( unsigned char *  input,
unsigned int  inputLen 
)

Block update operation. Continues an md5 message-digest operation, processing another message block, and updating the context.

Parameters
inputThe data to write into the context
inputLenThe length of the input data

Definition at line 326 of file md5.cc.

References buffer, count, MD5_memcpy(), MD5Transform(), and state.

Referenced by Result().

+ Here is the caller graph for this function:

void MD5::MD5_memcpy ( POINTER  output,
POINTER  input,
unsigned int  len 
)
private

internal memory management

Parameters
outputOUT parameter where POINTER is an unsigned char*
inputData to copy where POINTER is a unsigned char*
lenThe length of the data
outputOUT parameter where POINTER is a unsigned char*
inputData to copy where POINTER is a unsigned char*
lenThe length of the data

Definition at line 285 of file md5.cc.

Referenced by Input().

+ Here is the caller graph for this function:

void MD5::MD5_memset ( POINTER  output,
int  value,
unsigned int  len 
)
private

internal memory management

Parameters
outputOUT parameter where POINTER is an unsigned char*
valueValue to fill the memory with
lenThe length of the data

Definition at line 298 of file md5.cc.

Referenced by MD5Transform().

+ Here is the caller graph for this function:

void MD5::MD5Transform ( unsigned long int  state[4],
unsigned char  block[64] 
)
private

Basic transformation. Transforms state based on block.

Parameters
statestate to transform
blockblock to transform

Definition at line 147 of file md5.cc.

References Decode(), and MD5_memset().

Referenced by Input().

+ Here is the caller graph for this function:

void MD5::Result ( unsigned char  digest[16])

Finalization ends the md5 message-digest operation, writing the the message digest and zeroizing the context.

Parameters
digestThis is an OUT parameter which contains the created hash after the method returns

Definition at line 368 of file md5.cc.

References count, Encode(), Input(), and state.

Member Data Documentation

unsigned char MD5::buffer[64]
private

input buffer

Definition at line 140 of file system/include/pedigree/kernel/utilities/md5/md5.h.

Referenced by Input().

unsigned long int MD5::count[2]
private

number of bits, modulo 2^64 (lsb first)

Definition at line 137 of file system/include/pedigree/kernel/utilities/md5/md5.h.

Referenced by Input(), Reset(), and Result().

unsigned long int MD5::state[4]
private

state (ABCD)

Definition at line 134 of file system/include/pedigree/kernel/utilities/md5/md5.h.

Referenced by Input(), Reset(), and Result().


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