]> git.sesse.net Git - freerainbowtables/blob - Common/rt api/ChainWalkSet.h
427689454c9df7b71ae927c9ecb6162225feaecc
[freerainbowtables] / Common / rt api / ChainWalkSet.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 _CHAINWALKSET_H
8 #define _CHAINWALKSET_H
9
10 #include "Public.h"
11
12 struct ChainWalk
13 {
14         unsigned char Hash[MAX_HASH_LEN];
15         //int nHashLen;         // Implied
16         uint64* pIndexE;        // mapStartPosIndexE, Len = nRainbowChainLen - 1
17 };
18
19 class CChainWalkSet
20 {
21 public:
22         CChainWalkSet();
23         virtual ~CChainWalkSet();
24
25 private:
26         string m_sHashRoutineName;              // Discard all if not match
27         string m_sPlainCharsetName;             // Discard all if not match
28         int    m_nPlainLenMin;                  // Discard all if not match
29         int    m_nPlainLenMax;                  // Discard all if not match
30         int    m_nRainbowTableIndex;    // Discard all if not match
31         int    m_nRainbowChainLen;              // Discard all if not match
32         list<ChainWalk> m_lChainWalk;
33
34 private:
35         void DiscardAll();
36
37 public:
38         uint64* RequestWalk(unsigned char* pHash, int nHashLen,
39                                                 string sHashRoutineName,
40                                                 string sPlainCharsetName, int nPlainLenMin, int nPlainLenMax, 
41                                                 int nRainbowTableIndex, 
42                                                 int nRainbowChainLen,
43                                                 bool& fNewlyGenerated);
44         void DiscardWalk(uint64* pIndexE);
45 };
46
47 #endif