A standard SHA1 digest calculator.  
 More...
#include <yateclass.h>
|  | 
|  | SHA1 () | 
|  | 
|  | SHA1 (const SHA1 &original) | 
|  | 
|  | SHA1 (const void *buf, unsigned int len) | 
|  | 
|  | SHA1 (const DataBlock &data) | 
|  | 
|  | SHA1 (const String &str) | 
|  | 
| SHA1 & | operator= (const SHA1 &original) | 
|  | 
| virtual | ~SHA1 () | 
|  | 
| virtual void | clear () | 
|  | 
| virtual void | finalize () | 
|  | 
| virtual const unsigned char * | rawDigest () | 
|  | 
| virtual unsigned int | hashLength () const | 
|  | 
| virtual | ~Hasher () | 
|  | 
| const String & | hexDigest () | 
|  | 
| bool | update (const void *buf, unsigned int len) | 
|  | 
| bool | update (const DataBlock &data) | 
|  | 
| bool | update (const String &str) | 
|  | 
| Hasher & | operator<< (const String &value) | 
|  | 
| Hasher & | operator<< (const DataBlock &data) | 
|  | 
| Hasher & | operator<< (const char *value) | 
|  | 
| bool | hmacStart (DataBlock &opad, const void *key, unsigned int keyLen) | 
|  | 
| bool | hmacStart (DataBlock &opad, const DataBlock &key) | 
|  | 
| bool | hmacStart (DataBlock &opad, const String &key) | 
|  | 
| bool | hmacFinal (const DataBlock &opad) | 
|  | 
| bool | hmac (const void *key, unsigned int keyLen, const void *msg, unsigned int msgLen) | 
|  | 
| bool | hmac (const DataBlock &key, const DataBlock &msg) | 
|  | 
| bool | hmac (const String &key, const String &msg) | 
|  | 
| virtual unsigned int | hmacBlockSize () const | 
|  | 
A standard SHA1 digest calculator. 
A class to compute and check SHA1 digests 
Construct a fresh initialized instance 
 
 
Copy constructor 
- Parameters
- 
  
    | original | SHA1 instance to copy |  
 
 
 
      
        
          | SHA1 | ( | const void * | buf, | 
        
          |  |  | unsigned int | len | 
        
          |  | ) |  |  | 
      
 
Construct a digest from a buffer of data 
- Parameters
- 
  
    | buf | Pointer to the data to be included in digest |  | len | Length of data in the buffer |  
 
 
 
Construct a digest from a binary DataBlock 
- Parameters
- 
  
    | data | Binary data to be included in digest |  
 
 
 
Construct a digest from a String 
- Parameters
- 
  
    | str | String to be included in digest |  
 
 
 
Destroy the instance, free allocated memory 
 
 
Clear the digest and prepare for reuse 
Implements Hasher.
 
 
  
  | 
        
          | virtual void finalize | ( |  | ) |  |  | virtual | 
 
Finalize the digest computation, make result ready. Subsequent calls to update() will fail 
Implements Hasher.
 
 
NIST FIPS 186-2 change notice 1 Pseudo Random Function. Uses a b=160 bits SHA1 based G(t,c) function with no XSEEDj 
- Parameters
- 
  
    | out | Block to fill with pseudo-random data |  | seed | Data to use as RNG seed, must be 1 to 64 octets long |  | len | Desired output length in octets, must be 1 to 512 |  
 
- Returns
- True on success, false on invalid lengths 
 
 
  
  | 
        
          | virtual unsigned int hashLength | ( |  | ) | const |  | inlinevirtual | 
 
Return the length of the raw binary digest 
- Returns
- Length of the digest in octets 
Implements Hasher.
 
 
      
        
          | SHA1& operator= | ( | const SHA1 & | original | ) |  | 
      
 
 
  
  | 
        
          | virtual const unsigned char* rawDigest | ( |  | ) |  |  | virtual | 
 
Returns a pointer to the raw 20-byte binary value of the message digest. The digest is finalized if if wasn't already 
- Returns
- Pointer to the raw digest data or NULL if some error occured 
Implements Hasher.
 
 
  
  | 
        
          | static unsigned int rawLength | ( |  | ) |  |  | inlinestatic | 
 
Return the length of the raw binary digest 
- Returns
- Constant value of 20 
 
 
  
  | 
        
          | bool updateInternal | ( | const void * | buf, |  
          |  |  | unsigned int | len |  
          |  | ) |  |  |  | protectedvirtual | 
 
Update the digest from a buffer of data 
- Parameters
- 
  
    | buf | Pointer to the data to be included in digest |  | len | Length of data in the buffer |  
 
- Returns
- True if success, false if finalize() was already called 
Implements Hasher.
 
 
The documentation for this class was generated from the following file: