-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashMimAttack3.h
More file actions
33 lines (27 loc) · 864 Bytes
/
HashMimAttack3.h
File metadata and controls
33 lines (27 loc) · 864 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
32
33
/*
* Modification to HashMimAttack2 which replaces the sorted array with
* a hash table.
*/
#include "include/types.h"
typedef struct {
UIntType key;
UIntType value;
UIntType link;
} UIntHashTableEntry;
typedef struct {
size_t length;
size_t indexMask;
size_t fullFrom;
UIntHashTableEntry *entries;
} UIntHashTable;
class HashMimAttack3 : public ElgamalAttack {
private:
UIntHashTable table;
char *cacheFilePath;
public:
HashMimAttack3 (ElgamalCryptosystem *c, unsigned int bits1, unsigned int bits2, const char *cacheFile);
~HashMimAttack3 ();
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"; }
};