This class represents the SHA384 wrapper-class. More...
#include <hl_sha384wrapper.h>
Public Member Functions | |
| sha384wrapper () | |
| default constructor | |
| virtual | ~sha384wrapper () |
| default destructor | |
Private Member Functions | |
| virtual std::string | hashIt (void) |
| This method ends the hash process and returns the hash as string. | |
| virtual std::string | convToString (unsigned char *data) |
| This internal member-function convertes the hash-data to a std::string (HEX). | |
| virtual void | updateContext (unsigned char *data, unsigned int len) |
| This method adds the given data to the current hash context. | |
| virtual void | resetContext (void) |
| This method resets the current hash context. In other words: It starts a new hash process. | |
| virtual std::string | getTestHash (void) |
| This method should return the hash of the test-string "The quick brown fox jumps over the lazy
dog". | |
Private Attributes | |
| SHA2ext * | sha384 |
| HL_SHA_384_CTX | context |
This class represents the SHA384 wrapper-class.
You can use this class to easily create a sha384 hash. Just create an instance of sha384wrapper and call the inherited memberfunctions getHashFromString() and getHashFromFile() to create a hash based on a string or a file.
Have a look at the following example:
#include <hl_hashwrapper.h> #include <hl_sha384wrapper.h> #include <string> /* * creating a wrapper object */ hashwrapper *myWrapper = new sha384wrapper(); /* * create a hash from a string */ std::string hash1 = myWrapper->getHashFromString("Hello World"); /* * create a hash based on a file */ std::string hash2 = myWrapper->getHashFromFile("README.TXT"); delete myWrapper;
sha384wrapper implements resetContext(), updateContext() and hashIt() to create a hash.
| std::string sha384wrapper::convToString | ( | unsigned char * | data | ) | [private, virtual] |
This internal member-function convertes the hash-data to a std::string (HEX).
| data | The hash-data to covert into HEX |
Implements hashwrapper.
| std::string sha384wrapper::hashIt | ( | void | ) | [private, virtual] |
This method ends the hash process and returns the hash as string.
Implements hashwrapper.
| void sha384wrapper::updateContext | ( | unsigned char * | data, | |
| unsigned int | len | |||
| ) | [private, virtual] |
This method adds the given data to the current hash context.
| data | The data to add to the current context | |
| len | The length of the data to add |
Implements hashwrapper.
HL_SHA_384_CTX sha384wrapper::context [private] |
SHA384 context
SHA2ext* sha384wrapper::sha384 [private] |
SHA384 access via extended SHA2
1.6.3