The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleSHA256 Class Reference

Inheritance diagram for ModuleSHA256:

Inheritance graph
[legend]
Collaboration diagram for ModuleSHA256:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleSHA256 (InspIRCd *Me)
virtual ~ModuleSHA256 ()
virtual const char * OnRequest (Request *request)
 Called whenever a Request class is sent to your module by another module.
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Member Functions

void SHA256Init (SHA256Context *ctx, const unsigned int *ikey)
void SHA256Transform (SHA256Context *ctx, unsigned char *message, unsigned int block_nb)
void SHA256Update (SHA256Context *ctx, unsigned char *message, unsigned int len)
void SHA256Final (SHA256Context *ctx, unsigned char *digest)
void SHA256 (const char *src, char *dest, int len, const char *hxc, const unsigned int *ikey=NULL)

Private Attributes

unsigned int * key
char * chars

Detailed Description

Definition at line 135 of file m_sha256.cpp.


Constructor & Destructor Documentation

ModuleSHA256::ModuleSHA256 InspIRCd Me  )  [inline]
 

Definition at line 261 of file m_sha256.cpp.

References ModuleManager::Attach(), I_OnRequest, InspIRCd::Modules, ModuleManager::PublishInterface(), and Module::ServerInstance.

virtual ModuleSHA256::~ModuleSHA256  )  [inline, virtual]
 

Definition at line 268 of file m_sha256.cpp.

References InspIRCd::Modules, Module::ServerInstance, and ModuleManager::UnpublishInterface().


Member Function Documentation

virtual Version ModuleSHA256::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 303 of file m_sha256.cpp.

References API_VERSION, VF_SERVICEPROVIDER, and VF_VENDOR.

virtual const char* ModuleSHA256::OnRequest Request request  )  [inline, virtual]
 

Called whenever a Request class is sent to your module by another module.

Please see the documentation of Request::Send() for further information. The Request sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc).

Parameters:
request The Request class being received

Reimplemented from Module.

Definition at line 274 of file m_sha256.cpp.

References chars, HashRequest::GetHashData(), Request::GetId(), HashRequest::GetKeyData(), HashRequest::GetOutputs(), key, MAXBUF, and SHA256().

void ModuleSHA256::SHA256 const char *  src,
char *  dest,
int  len,
const char *  hxc,
const unsigned int *  ikey = NULL
[inline, private]
 

Definition at line 239 of file m_sha256.cpp.

References SHA256_DIGEST_SIZE, SHA256Final(), SHA256Init(), and SHA256Update().

Referenced by OnRequest().

void ModuleSHA256::SHA256Final SHA256Context ctx,
unsigned char *  digest
[inline, private]
 

Definition at line 226 of file m_sha256.cpp.

References SHA256Context::block, SHA256Context::h, SHA256Context::len, SHA256_BLOCK_SIZE, SHA256Transform(), SHA256Context::tot_len, and UNPACK32.

Referenced by SHA256().

void ModuleSHA256::SHA256Init SHA256Context ctx,
const unsigned int *  ikey
[inline, private]
 

Definition at line 137 of file m_sha256.cpp.

References SHA256Context::h, SHA256Context::len, sha256_h0, and SHA256Context::tot_len.

Referenced by SHA256().

void ModuleSHA256::SHA256Transform SHA256Context ctx,
unsigned char *  message,
unsigned int  block_nb
[inline, private]
 

Definition at line 153 of file m_sha256.cpp.

References CH, SHA256Context::h, MAJ, PACK32, SHA256_F1, SHA256_F2, sha256_k, and SHA256_SCR.

Referenced by SHA256Final(), and SHA256Update().

void ModuleSHA256::SHA256Update SHA256Context ctx,
unsigned char *  message,
unsigned int  len
[inline, private]
 

Definition at line 187 of file m_sha256.cpp.

References SHA256Context::block, SHA256Context::len, SHA256_BLOCK_SIZE, SHA256Transform(), and SHA256Context::tot_len.

Referenced by SHA256().


Member Data Documentation

char* ModuleSHA256::chars [private]
 

Definition at line 257 of file m_sha256.cpp.

Referenced by OnRequest().

unsigned int* ModuleSHA256::key [private]
 

Definition at line 256 of file m_sha256.cpp.

Referenced by OnRequest().


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