-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.h
109 lines (90 loc) · 1.73 KB
/
classes.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef HEADER_H
#define HEADER_H
#include <NTL/ZZ_p.h>
#include <NTL/ZZX.h>
#include <NTL/ZZ_pX.h>
#include <NTL/ZZ_pE.h>
#include "parameters.h"
#include "commitment.h"
#include "encryption.h"
#include <vector>
using namespace NTL;
using namespace std;
class DecryptionShares {
public:
Vec<ZZ_pE> t;
DecryptionShares(){
t.SetLength(2);
}
};
class Statement {
public:
Vec<ZZ_pE> messages;
Vec<Ciphertext> ciphertexts;
Statement(){
messages.SetLength(tau);
ciphertexts.SetLength(tau);
}
};
class CommitMessage{
public:
Vec<ZZ_pE> secretShare, errorShare, pubKeyShare;
Vec<Commitment> secretCom, errorCom;
Vec<DecryptionShares> partialDecryptions;
CommitMessage(){
secretShare.SetLength(2);
errorShare.SetLength(2);
pubKeyShare.SetLength(2);
secretCom.SetLength(2);
errorCom.SetLength(2);
partialDecryptions.SetLength(tau);
}
};
class BinaryChallenge {
public:
Vec<bool> beta;
BinaryChallenge(){
beta.SetLength(lambda);
}
};
class TernaryChallenge {
public:
Vec<long> beta;
TernaryChallenge(){
beta.SetLength(mu);
}
};
class Response {
public:
ZZ_pE secretShare, errorShare, pubKeyShare;
ZZ_pE secretCom, errorCom, secretOpen, errorOpen;
Vec<DecryptionShares> partialDecryptions;
Response(){
partialDecryptions.SetLength(tau);
}
};
class ProofMessage {
public:
Vec<ZZ_p> s,t,u,v;
vector<int> phi;
string c1,c2,c3;
ProofMessage(){
s.SetLength(6*N);
t.SetLength(6*N);
u.SetLength(6*N);
v.SetLength(6*N);
vector<int> phi(6*N);
}
};
class Proof {
public:
Vec<ZZ_p> vector1, vector2;
vector<int> perm;
string c1,c2,c3;
Proof(){
vector1.SetLength(6*N);
vector2.SetLength(6*N);
vector<int> perm(6*N);
}
};
#endif