Classes | Public Member Functions | Protected Member Functions | Static Protected Attributes

zeus::TAbstractMDHash Class Reference

#include <AbstractMDHash.h>

Inheritance diagram for zeus::TAbstractMDHash:
zeus::TAbstractHash zeus::TMD4Hash zeus::TMD5Hash

List of all members.

Classes

struct  TypeMD_CTX

Public Member Functions

 TAbstractMDHash ()
virtual Retval getHMAC (const IByteArray &rKey, const IByteArray &rInput, IByteArray &rOutput)

Protected Member Functions

void finishCTX (TypeMD_CTX &rCtx, IByteArray &rOutput)
void freeCTX (TypeMD_CTX &rCTX)
void processBytes (TypeMD_CTX &rCtx, const IByteArray &rInput)
void processBytes (TypeMD_CTX &rCtx, const Uint8 *pucBuffer, Int iSize)
virtual Int getBlockSize () const =0
virtual void initCTX (TypeMD_CTX &rCTX)=0
virtual void processBlock (TypeMD_CTX &rCtx, const Uint8 *pucBuffer, Int iBlockNum)=0
virtual Retval generate (const IByteArray &rInput, IByteArray &rOutput)

Static Protected Attributes

static const Uint8 m_ucFillBuffer [64]
 Fill buffer.

Detailed Description

The abstract MDx hash implements the basic methods of the message digest hash algorithms


Constructor & Destructor Documentation

TAbstractMDHash::TAbstractMDHash (  )

Creates a Message Digest hash object


Member Function Documentation

void TAbstractMDHash::finishCTX ( TypeMD_CTX rCtx,
IByteArray rOutput 
) [protected]

Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to rOutput.

IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value.

void TAbstractMDHash::freeCTX ( TypeMD_CTX rCTX ) [protected]

Releases the allocated message digest buffer

Retval TAbstractMDHash::generate ( const IByteArray rInput,
IByteArray rOutput 
) [protected, virtual]
virtual Int zeus::TAbstractMDHash::getBlockSize (  ) const [protected, pure virtual]

returns the size of blocks in bytes

Implemented in zeus::TMD4Hash, and zeus::TMD5Hash.

Retval TAbstractMDHash::getHMAC ( const IByteArray rKey,
const IByteArray rInput,
IByteArray rOutput 
) [virtual]

returns the hash-based Message authenication code for MD-based hash algorithms

Parameters:
rKey: secret key
rInput: message to hash
rOutput: out put of the generated authenication code
Return values:
RET_NOERROR: authenication code generated
RET_INTERNAL_ERROR: internal error (block size unknown)
virtual void zeus::TAbstractMDHash::initCTX ( TypeMD_CTX rCTX ) [protected, pure virtual]

initializes the hash generating

Implemented in zeus::TMD4Hash, and zeus::TMD5Hash.

virtual void zeus::TAbstractMDHash::processBlock ( TypeMD_CTX rCtx,
const Uint8 pucBuffer,
Int  iBlockNum 
) [protected, pure virtual]

Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0.

Implemented in zeus::TMD4Hash, and zeus::TMD5Hash.

void TAbstractMDHash::processBytes ( TypeMD_CTX rCtx,
const Uint8 pucBuffer,
Int  iSize 
) [protected]

Processes bytes and updates the hash

bSkip

void zeus::TAbstractMDHash::processBytes ( TypeMD_CTX rCtx,
const IByteArray rInput 
) [inline, protected]

Processes bytes and updates the hash


Member Data Documentation

const Uint8 TAbstractMDHash::m_ucFillBuffer [static, protected]
Initial value:
 { 0x80,
                                                               0 
                                                             }

Fill buffer.

This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1320, 3.1: Step 1)


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:31