]> git.sesse.net Git - freerainbowtables/blob - Server Applications/rsearchi/HashSet.h
initial
[freerainbowtables] / Server Applications / rsearchi / HashSet.h
1 /*
2    RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
3
4    Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
5 */
6
7 #ifndef _HASHSET_H
8 #define _HASHSET_H
9
10 #include "Public.h"
11 #include <map>
12 using std::map;
13 class CHashSet
14 {
15 public:
16         CHashSet();
17         ~CHashSet();
18
19 private:
20         vector<string> m_vHash;
21         vector<bool>   m_vFound;
22         vector<string> m_vPlain;
23         vector<string> m_vBinary;
24         vector<uint64*> m_vIndices;
25         vector<int>     m_vLookupIDs;
26         typedef vector<FoundRainbowChain> VECTOR_CHAIN;
27         vector<VECTOR_CHAIN> m_vFoundChains;
28 public:
29         
30         void AddHash(string sHash, uint64 *pIndices, int nLookupID);            // lowercase, len % 2 == 0, MIN_HASH_LEN * 2 <= len <= MAX_HASH_LEN * 2
31         bool AnyhashLeft();
32         bool AnyHashLeftWithLen(int nLen);
33         void GetLeftHashWithLen(vector<string>& vHash, vector<uint64 *>& vIndices, int nLen);
34         void AddChain(string sHash, FoundRainbowChain &Chain);
35         void SetPlain(string sHash, string sPlain, string sBinary);
36         bool GetPlain(string sHash, string& sPlain, string& sBinary);
37         int GetLookupID(string sHash);
38         //vector<FoundRainbowChain> CHashSet::GetChains(string sHash);
39         int GetStatHashFound();
40         int GetStatHashTotal();
41         void GetFoundChains(map<string, VECTOR_CHAIN> &mHashList);
42 };
43
44 #endif