-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiskMimAttack.h
46 lines (39 loc) · 1.14 KB
/
DiskMimAttack.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* =====================================================================================
*
* Filename: DiskMimAttack.h
*
* Description:
*
* Version: 1.0
* Created: 10/19/2008 08:40:55 PM
* Revision: none
* Compiler: gcc
*
* Author: Bryce Allen (bda), bryce@bda.ath.cx
* Company:
*
* =====================================================================================
*/
#include <tcutil.h>
#include <tchdb.h>
#include <tcbdb.h>
typedef uint32_t UIntType;
/*
inline UIntType hash (mpz_t n) {
return (UIntType) mpz_get_ui (n);
//return x && ((1 << bits) - 1);
}
*/
class DiskMimAttack : public ElgamalAttack {
private:
TCBDB *bdb;
char *fileName;
public:
DiskMimAttack (ElgamalCryptosystem *c, char *fileName, unsigned int bits1, unsigned int bits2);
~DiskMimAttack ();
bool buildTable (gmp_randstate_t rstate);
size_t crackMessage (MpzList *results, const ElgamalCipherText ct,
gmp_randstate_t rstate, size_t maxResults=0);
const char* getAttackName () const { return "diskmim"; }
};