CL_SHA1 Class Reference
[clanCore Crypto]

SHA-1 hash function class. More...

#include <sha1.h>

List of all members.

Public Member Functions

Construction

 CL_SHA1 ()
 Constructs a SHA-1 hash generator.
Operations

void reset ()
 Resets the hash generator.
void set_hmac (const void *key_data, int key_size)
 Enable a HMAC based calculation.
void add (const void *data, int size)
 Adds data to be hashed.
void add (const CL_DataBuffer &data)
 Add.
void calculate ()
 Finalize hash calculation.

Attributes



static const int hash_size = 20
CL_String8 get_hash (bool uppercase=false)
 Returns the calculated hash.
void get_hash (unsigned char out_hash[hash_size])
 Get hash.

Detailed Description

SHA-1 hash function class.


Constructor & Destructor Documentation

CL_SHA1::CL_SHA1 (  ) 

Constructs a SHA-1 hash generator.


Member Function Documentation

void CL_SHA1::add ( const void *  data,
int  size 
)

Adds data to be hashed.

void CL_SHA1::add ( const CL_DataBuffer data  ) 

Add.

Parameters:
data = Data Buffer
void CL_SHA1::calculate (  ) 

Finalize hash calculation.

void CL_SHA1::get_hash ( unsigned char  out_hash[hash_size]  ) 

Get hash.

Parameters:
out_hash = where to write to
CL_String8 CL_SHA1::get_hash ( bool  uppercase = false  ) 

Returns the calculated hash.

void CL_SHA1::reset (  ) 

Resets the hash generator.

void CL_SHA1::set_hmac ( const void *  key_data,
int  key_size 
)

Enable a HMAC based calculation.

Call this function before the initial add(). It is reset by reset()

Parameters:
key_data = The HMAC key
key_size = The size of the key_data

Member Data Documentation

const int CL_SHA1::hash_size = 20 [static]

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