Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cHashSHA1 Class Reference

#include <cHashSHA1.h>

Inheritance diagram for GrayLib::cHashSHA1:
GrayLib::cHashCodeT< 20 > Gray::cMemStatic< TYPE_SIZE >

Public Member Functions

 cHashSHA1 ()
 
 cHashSHA1 (const char *pszHexDigest)
 
 UNITTEST_FRIEND (cHashSHA1)
 
- Public Member Functions inherited from GrayLib::cHashCodeT< 20 >
bool isValidHash () const noexcept
 
size_t get_HashSize () const noexcept
 
cHashCode get_HashCode () const
 
StrLen_t GetHexDigest (OUT char *pszHexString) const
 
cStringA get_HexDigest () const
 
HRESULT put_HexDigest (const char *pszInp)
 
- Public Member Functions inherited from Gray::cMemStatic< TYPE_SIZE >
size_t get_DataLength () const noexcept
 
const BYTE * get_DataBytes () const noexcept
 
 operator const BYTE * () const noexcept
 

Static Public Member Functions

static size_t GRAYCALL ComputeHash (BYTE pOutput[20], const void *pInput, size_t nInputSize)
 
static size_t GRAYCALL ComputeHmac (BYTE pOutput[20], const BYTE *pKey, size_t nKeySize, const void *pInput, size_t nInputSize)
 

Friends

class cHashSHA1Builder
 

Additional Inherited Members

- Public Attributes inherited from Gray::cMemStatic< TYPE_SIZE >
BYTE m_Data [TYPE_SIZE]
 All objects of this type are this size. More...
 
- Static Public Attributes inherited from Gray::cMemStatic< TYPE_SIZE >
static const size_t k_Size = TYPE_SIZE
 All hashes of this type are this size (bytes). More...
 
static const size_t k_SizeHexDigest = ((TYPE_SIZE * 2) + 1)
 hold a string with the hex digest of this. (chars). More...
 

Detailed Description

20 byte hash. SSL_Hash_SHA1. Ignore SSL_Hash_SHA224? SHA1 = 160 = Hold a 20-byte SHA1 hash from any source. Similar to cHashMD5 (but SHA1 is better?) RFC 3174: US Secure Hash Algorithm 160 (SHA1).

Note
SHA1 is used by Gnutella for hashing files. declared NOT safe in 2015.

Constructor & Destructor Documentation

◆ cHashSHA1() [1/2]

GrayLib::cHashSHA1::cHashSHA1 ( )
inline

◆ cHashSHA1() [2/2]

GrayLib::cHashSHA1::cHashSHA1 ( const char *  pszHexDigest)
inline

Member Function Documentation

◆ ComputeHash()

size_t GRAYCALL GrayLib::cHashSHA1::ComputeHash ( BYTE  pOutput[20],
const void *  pInput,
size_t  nInputSize 
)
static

◆ ComputeHmac()

size_t GRAYCALL GrayLib::cHashSHA1::ComputeHmac ( BYTE  pOutput[20],
const BYTE *  pKey,
size_t  nKeySize,
const void *  pInput,
size_t  nInputSize 
)
static

◆ UNITTEST_FRIEND()

GrayLib::cHashSHA1::UNITTEST_FRIEND ( cHashSHA1  )

Friends And Related Function Documentation

◆ cHashSHA1Builder

friend class cHashSHA1Builder
friend

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