-
Notifications
You must be signed in to change notification settings - Fork 112
/
testing.h
72 lines (63 loc) · 1.81 KB
/
testing.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* MGR_NTL.h
*
* Created on: Mar 29, 2013
* Author: ph4r05
*/
#ifndef MGR_NTL_H_
#define MGR_NTL_H_
//#include <stdio.h>
//#include <stdlib.h>
#include "base.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <set>
#include <map>
// NTL dependencies
#include <NTL/GF2.h>
#include <NTL/GF2X.h>
#include <NTL/vec_GF2.h>
#include <NTL/GF2E.h>
#include <NTL/GF2EX.h>
#include <NTL/mat_GF2.h>
#include <NTL/vec_long.h>
#include <cmath>
#include <vector>
#include "GenericAES.h"
#include "NTLUtils.h"
#include "MixingBijections.h"
#include "WBAES.h"
#include "WBAESGenerator.h"
#include "md5.h"
#include "LinearAffineEq.h"
#include "BGEAttack.h"
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include <boost/foreach.hpp>
// Structure for A1 A2 relations generator
typedef struct _a1a2rec {
unsigned long int id;
int count;
std::vector<unsigned long int> * vec;
} a1a2rec;
typedef boost::unordered_map<std::string, a1a2rec> a1a2map;
// Structure for AES affine rel. finding
typedef struct _AESAffineElement {
int square, multi, type;
} AESAffineElement;
typedef boost::unordered_multimap<std::string, AESAffineElement> AESAffineMap;
typedef std::pair<std::string, AESAffineElement> AESAffineMapElem;
std::string hashLookupTable(NTL::vec_GF2E s);
int MBgen(void);
int dualAESTest(void);
int A1A2relationsGenerator(void);
int AESAffineRelationsVerify(bool inverseSbox = true);
int AffCallbackCorrespondence( wbacr::laeqv::affineEquiv_t * el,
wbacr::laeqv::affineEquivalencesList * lish,
boost::unordered_set<std::string> * hashes,
wbacr::laeqv::LinearAffineEq * eqCheck,
void * usrData);
#endif /* MGR_NTL_H_ */