#include <AbstractMDHash.h>
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. | |
The abstract MDx hash implements the basic methods of the message digest hash algorithms
| TAbstractMDHash::TAbstractMDHash | ( | ) |
Creates a Message Digest hash object
| 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] |
Implements zeus::TAbstractHash.
| 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
| rKey | : secret key |
| rInput | : message to hash |
| rOutput | : out put of the generated authenication code |
| 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
const Uint8 TAbstractMDHash::m_ucFillBuffer [static, protected] |
{ 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)