- HashRequest(Module* Me, Module* Target, const std::string &sdata)
- : Request(Me, Target, "HASH"), data(sdata)
- {
- Send();
- }
- inline std::string hex()
- {
- return BinToHex(binresult);
- }
-};
-
-/** Allows the IVs for the hash to be specified. As the choice of initial IV is
- * important for the security of a hash, this should not be used except to
- * maintain backwards compatability. This also allows you to change the hex
- * sequence from its default of "0123456789abcdef", which does not improve the
- * strength of the output, but helps confuse those attempting to implement it.
- *
- * Only m_md5 implements this request; only m_cloaking should use it.
- *
- * Example:
- * \code
- * unsigned int iv[] = { 0xFFFFFFFF, 0x00000000, 0xAAAAAAAA, 0xCCCCCCCC };
- * std::string result = HashRequestIV(this, HashModule, iv, "0123456789abcdef", "data").result;
- * \endcode
- */
-struct HashRequestIV : public Request
-{
- unsigned int* iv;
- const char* map;
- std::string result;
- const std::string data;
- HashRequestIV(Module* Me, Module* Target, unsigned int* IV, const char* HexMap, const std::string &sdata)
- : Request(Me, Target, "HASH-IV"), iv(IV), map(HexMap), data(sdata)
- {
- Send();
- }