![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cHashBase.h>
Public Member Functions | |
| virtual | ~cHashBase () |
| virtual void | ResetHash ()=0 |
| virtual void | ProcessHashBuffer (const BYTE *pBuffer) |
| virtual void | AddToHash (const void *pInput, size_t nInputSize)=0 |
| Digest update function. More... | |
| virtual size_t | FinalizeHash (OUT BYTE *pOutput)=0 |
| Digest finalization function. More... | |
| size_t | ComputeHash (BYTE *pOutput, const void *pInput, size_t nInputSize) |
| virtual void | InitHmac (const BYTE *pKey, size_t nKeySize) |
| virtual size_t | FinalizeHmac (OUT BYTE *pOutput) |
| HMAC finalization function. More... | |
| virtual void | ResetHmac () |
| size_t | ComputeHmac (BYTE *pOutput, const BYTE *pKey, size_t nKeySize, const void *pInput, size_t nInputSize) |
| void | AddToHashFromBlock (const cHeapBlock &m) |
| Helpers. More... | |
| StrLen_t | AddToHashFromStr (const char *pszStr) |
| HRESULT | AddToHashFromStream (cStreamInput &file, IStreamProgressCallback *pProgress=nullptr) |
| HRESULT | AddToHashFromFile (const FILECHAR_t *pszFileName, IStreamProgressCallback *pProgress=nullptr) |
| HRESULT | ComputeHashFromStream (OUT BYTE *pOutput, cStreamInput &fin, IStreamProgressCallback *pProgress=nullptr) |
| HRESULT | ComputeHashFromFile (OUT BYTE *pOutput, const FILECHAR_t *pszFileName, IStreamProgressCallback *pProgress=nullptr) |
Public Member Functions inherited from Gray::CObject | |
| virtual | ~CObject () |
| virtual bool | isValidCheck () const noexcept |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | AssertValid () const |
| < memory allocation and structure definitions are valid. More... | |
| virtual void | Serialize (cArchive &a) |
Static Public Attributes | |
| static const BYTE | k_Padding [128] |
| 0x80 followed by zeros. More... | |
| static const size_t | k_HashSizeMax = 64 |
| Largest hash k_HashSize that we support. in bytes. More... | |
Base hash builder class for: MD5,SHA1,SHA256,SHA512 Defined by cHashTypeDef
|
inlinevirtual |
allow delete base to work.
|
pure virtual |
Digest update function.
Implemented in GrayLib::cHashSHA512Builder, GrayLib::cHashMD5Builder, GrayLib::cHashSHA1Builder, and GrayLib::cCRC32Builder.
|
inline |
Helpers.
| HRESULT GrayLib::cHashBase::AddToHashFromFile | ( | const FILECHAR_t * | pszFileName, |
| IStreamProgressCallback * | pProgress = nullptr |
||
| ) |
| StrLen_t GrayLib::cHashBase::AddToHashFromStr | ( | const char * | pszStr | ) |
| HRESULT GrayLib::cHashBase::AddToHashFromStream | ( | cStreamInput & | file, |
| IStreamProgressCallback * | pProgress = nullptr |
||
| ) |
|
inline |
Calculate and Finalize in a single step.
| HRESULT GrayLib::cHashBase::ComputeHashFromFile | ( | OUT BYTE * | pOutput, |
| const FILECHAR_t * | pszFileName, | ||
| IStreamProgressCallback * | pProgress = nullptr |
||
| ) |
| HRESULT GrayLib::cHashBase::ComputeHashFromStream | ( | OUT BYTE * | pOutput, |
| cStreamInput & | fin, | ||
| IStreamProgressCallback * | pProgress = nullptr |
||
| ) |
compute a Hash for file contents
|
inline |
computer HMAC as a single action.
|
pure virtual |
Digest finalization function.
Implemented in GrayLib::cCRC32Builder.
|
inlinevirtual |
HMAC finalization function.
|
inlinevirtual |
HMAC Initialization function
Reimplemented in GrayLib::cHashSHA512Builder, GrayLib::cHashSHA1Builder, and GrayLib::cHashMD5Builder.
|
inlinevirtual |
Internal buffer process. TODO GET RID OF THIS ???
|
pure virtual |
Implemented in GrayLib::cHashSHA512Builder, GrayLib::cHashSHA1Builder, GrayLib::cHashMD5Builder, and GrayLib::cCRC32Builder.
|
inlinevirtual |
HMAC context reset function. Will call ResetHash().
Reimplemented in GrayLib::cHashSHA512Builder, GrayLib::cHashSHA1Builder, and GrayLib::cHashMD5Builder.
|
static |
Largest hash k_HashSize that we support. in bytes.
|
static |
0x80 followed by zeros.