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.
 
void Result (unsigned char digest[16])
 Finalization ends the md5 message-digest operation, writing the the message digest and zeroizing the context.
 
 MD5 ()
 default constructor
 

Private Member Functions

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

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.

Constructor & Destructor Documentation

◆ MD5()

MD5::MD5 ( )
inline

default constructor

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

References Reset().

Member Function Documentation

◆ Decode()

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 261 of file md5.cc.

Referenced by MD5Transform().

+ Here is the caller graph for this function:

◆ Encode()

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 243 of file md5.cc.

Referenced by Result().

+ Here is the caller graph for this function:

◆ Input()

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 315 of file md5.cc.

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

Referenced by Result().

+ Here is the caller graph for this function:

◆ MD5_memcpy()

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 277 of file md5.cc.

Referenced by Input().

+ Here is the caller graph for this function:

◆ MD5_memset()

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 289 of file md5.cc.

Referenced by MD5Transform().

+ Here is the caller graph for this function:

◆ MD5Transform()

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(), MD5_memset(), and state.

Referenced by Input().

+ Here is the caller graph for this function:

◆ Reset()

void MD5::Reset ( )

Initialization begins an operation, writing a new context.

Definition at line 300 of file md5.cc.

References count, and state.

Referenced by MD5().

+ Here is the caller graph for this function:

◆ Result()

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 353 of file md5.cc.

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

Member Data Documentation

◆ buffer

unsigned char MD5::buffer[64]
private

input buffer

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

Referenced by Input().

◆ count

unsigned long int MD5::count[2]
private

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

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

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

◆ state

unsigned long int MD5::state[4]
private

state (ABCD)

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

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


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