sha1MessageDigest Class Reference

Inheritance diagram for sha1MessageDigest:
Inheritance graph
[legend]
Collaboration diagram for sha1MessageDigest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 sha1MessageDigest ()
void update (const byte_t b)
void update (const string &s)
void update (const byte_t *buffer, const unsigned long len)
void update (const byte_t *buffer, const unsigned long offset, const unsigned long len)
void finalize ()
void finalize (const string &s)
void finalize (const byte_t *buffer, const unsigned long len)
void finalize (const byte_t *buffer, const unsigned long offset, const unsigned long len)
int getDigestLength () const
const byte_tgetDigest () const
void reset ()

Protected Member Functions

void init ()

Static Protected Member Functions

static void transform (unsigned long state[5], const byte_t buffer[64])

Protected Attributes

unsigned long m_state [5]
unsigned long m_count [2]
byte_t m_buffer [64]
byte_t m_digest [20]

Constructor & Destructor Documentation


Member Function Documentation

void finalize ( const byte_t buffer,
const unsigned long  offset,
const unsigned long  len 
) [virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implements messageDigest.

References sha1MessageDigest::finalize().

void finalize ( const byte_t buffer,
const unsigned long  len 
) [virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implements messageDigest.

References sha1MessageDigest::finalize(), and sha1MessageDigest::update().

void finalize ( const string s  )  [virtual]

Completes the hash computation by performing final operations such as padding.

This is equivalent to calling update() and then finalize().

Implements messageDigest.

References sha1MessageDigest::finalize().

void finalize (  )  [virtual]

Completes the hash computation by performing final operations such as padding.

Implements messageDigest.

References sha1MessageDigest::m_buffer, sha1MessageDigest::m_count, sha1MessageDigest::m_digest, sha1MessageDigest::m_state, and sha1MessageDigest::update().

Referenced by sha1MessageDigest::finalize().

const byte_t * getDigest (  )  const [virtual]

Returns the hash, as computed by the algorithm.

You must call finalize() before using this function, or the hash will not be correct. To get the size of the returned array, call getDigestLength().

Returns:
computed hash

Implements messageDigest.

References sha1MessageDigest::m_digest.

int getDigestLength (  )  const [virtual]

Returns the length of the hash.

This is the length of the array returned by getDigest().

Returns:
length of computed hash

Implements messageDigest.

void init (  )  [protected]
void reset (  )  [virtual]

Resets the algorithm to its initial state, so that you can compute a new hash using the same object.

Implements messageDigest.

References sha1MessageDigest::init().

static void transform ( unsigned long  state[5],
const byte_t  buffer[64] 
) [static, protected]
void update ( const byte_t buffer,
const unsigned long  offset,
const unsigned long  len 
) [virtual]

Updates the digest using the specified array of bytes, starting at the specified offset.

Parameters:
buffer array of bytes
offset offset to start from in the array of bytes
len number of bytes to use, starting at offset

Implements messageDigest.

References sha1MessageDigest::update().

void update ( const byte_t buffer,
const unsigned long  len 
) [virtual]

Updates the digest using the specified array of bytes.

Parameters:
buffer array of bytes
len number of bytes to use in the buffer

Implements messageDigest.

References sha1MessageDigest::m_buffer, sha1MessageDigest::m_count, sha1MessageDigest::m_state, and sha1MessageDigest::transform().

void update ( const string s  )  [virtual]

Updates the digest using the specified string.

Parameters:
s the string with which to update the digest.

Implements messageDigest.

References sha1MessageDigest::update().

void update ( const byte_t  b  )  [virtual]

Updates the digest using the specified byte.

Parameters:
b the byte with which to update the digest.

Implements messageDigest.

Referenced by sha1MessageDigest::finalize(), and sha1MessageDigest::update().


Member Data Documentation

byte_t m_buffer[64] [protected]
unsigned long m_count[2] [protected]
byte_t m_digest[20] [protected]
unsigned long m_state[5] [protected]

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

Generated by  doxygen 1.6.2