-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalc_data.h
40 lines (35 loc) · 908 Bytes
/
calc_data.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
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h> //for NID_secp256k1
//??????
//#include "" NOOOO declarate in this header file.....
//#define DATA_FILE "/bin/data.bin"
#define DATA_FILE "data.bin"
#define CountR_CL 256*256*16
#define CountC_CL 8 //segment of table
#define CountKEY 2
#define LengthKEY 32
#define COUNT_PRECOMP_DATA CountR_CL*LengthKEY*CountKEY*CountC_CL
extern EC_KEY* pkey;
extern const EC_GROUP *group;
extern BN_CTX *ctx;
struct ec_point_st {
const EC_METHOD *meth;
BIGNUM X;
BIGNUM Y;
BIGNUM Z;
int Z_is_one;
};
class CCD_
{
private:
unsigned char* cData;
unsigned char* cDataZ;
bool save_data();
bool pre_comp_data();
public:
CCD_();
~CCD_(){delete[] cData; delete[] cDataZ;};
bool load_data();
unsigned char * get_p_precom(){if(load_data()) return cData; else return NULL;};
void init_ECtable(EC_POINT ** MPoint);
};