-/** HashRequest is the base class used to send Hash requests to hashing.so.
- * You should not instantiate classes of type HashRequest directly, instead
- * you should instantiate classes of type HashResetRequest, HashSumRequest,
- * HashKeyRequest and HashHexRequest, shown below.
- */
-class HashRequest : public Request
-{
- /** The keys (IV) to use */
- unsigned int* keys;
- /** The output characters (hex sequence) to use */
- const char* outputs;
- /** The string to hash */
- std::string tohash;
- public:
- /** Initialize HashRequest as an Hash_RESET message */
- HashRequest(const char* req, Module* Me, Module* Target) : Request(Me, Target, req)
- {
- }
-
- /** Initialize HashRequest as an Hash_SUM message */
- HashRequest(Module* Me, Module* Target, const std::string &hashable) : Request(Me, Target, "SUM"), keys(NULL), outputs(NULL), tohash(hashable)
- {
- }
-
- /** Initialize HashRequest as an Hash_KEY message */
- HashRequest(Module* Me, Module* Target, unsigned int* k) : Request(Me, Target, "KEY"), keys(k), outputs(NULL), tohash("")
- {
- }
-
- /** Initialize HashRequest as an Hash_HEX message */
- HashRequest(Module* Me, Module* Target, const char* out) : Request(Me, Target, "HEX"), keys(NULL), outputs(out), tohash("")
- {
- }
-
- /** Get data to be hashed */
- std::string& GetHashData()
- {
- return tohash;
- }
-
- /** Get keys (IVs) to be used */
- unsigned int* GetKeyData()
- {
- return keys;
- }
-
- /** Get output characters (hex sequence) to be used */
- const char* GetOutputs()
- {
- return outputs;
- }
-};
-
-/** Send this class to the hashing module to query for its name.