Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

HashModule Class Reference

abstract base class for hash functions. More...

#include <cryptlib.h>

Inheritance diagram for HashModule:

Adler32 CRC32 EMSA2DecoratedHashModule IteratedHashBase MD2 MessageAuthenticationCode PKCS_DecoratedHashModule SapphireHash SignatureEncodingMethodWithRecovery List of all members.

Public Methods

virtual ~HashModule ()
virtual void Update (const byte *input,unsigned int length)=0
 process more input.

virtual void Final (byte *digest)=0
virtual unsigned int DigestSize ()const=0
 size of the hash returned by Final().

virtual void CalculateDigest (byte *digest,const byte *input,int length)
 use this if your input is short and you don't want to call Update() and Final() seperately. More...

virtual bool Verify (const byte *digest)
 verify that digest is a valid digest for the current message, then reinitialize the object. More...

virtual bool VerifyDigest (const byte *digest,const byte *input,int length)
 use this if your input is short and you don't want to call Update() and Verify() seperately. More...


Detailed Description

abstract base class for hash functions.

HashModule objects are stateful. They are created in an initial state, change state as Update() is called, and return to the initial state when Final() is called. This interface allows a large message to be hashed in pieces by calling Update() on each piece followed by calling Final().

Definition at line 203 of file cryptlib.h.


Constructor & Destructor Documentation

HashModule::~HashModule ( ) [inline, virtual]
 

Definition at line 207 of file cryptlib.h.


Member Function Documentation

void HashModule::CalculateDigest ( byte * digest,
const byte * input,
int length ) [inline, virtual]
 

use this if your input is short and you don't want to call Update() and Final() seperately.

Definition at line 221 of file cryptlib.h.

bool HashModule::Verify ( const byte * mac ) [virtual]
 

verify that digest is a valid digest for the current message, then reinitialize the object.

Default implementation is to call Final() and do a bitwise comparison between its output and digest.

Reimplemented in PSSR, SignatureEncodingMethodWithRecovery, and XMACC.

Definition at line 57 of file cryptlib.cpp.

Referenced by VerifyDigest().

bool HashModule::VerifyDigest ( const byte * digest,
const byte * input,
int length ) [inline, virtual]
 

use this if your input is short and you don't want to call Update() and Verify() seperately.

Definition at line 230 of file cryptlib.h.


The documentation for this class was generated from the following files:
Generated at Mon Jan 15 01:16:51 2001 for Crypto++ by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000