-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashMimAttack4.h
More file actions
31 lines (25 loc) · 853 Bytes
/
HashMimAttack4.h
File metadata and controls
31 lines (25 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Modification to HashMimAttack3 which reduces the size of the hashtable.
*/
#include "include/types.h"
typedef struct {
UIntType value;
UIntType link;
} UIntShortHashTableEntry;
typedef struct {
size_t length;
size_t indexMask;
size_t fullFrom;
UIntShortHashTableEntry *entries;
} UIntShortHashTable;
class HashMimAttack4 : public ElgamalAttack {
private:
UIntShortHashTable table;
char *cacheFilePath;
public:
HashMimAttack4 (ElgamalCryptosystem *c, unsigned int bits1, unsigned int bits2, const char *cacheFile);
~HashMimAttack4 ();
bool buildTable (gmp_randstate_t rstate);
size_t crackMessage (MpzList *results, ElgamalCipherText ct, gmp_randstate_t rstate, size_t maxResults=0);
const char* getAttackName () const { return "hashmim3"; }
};