-
Notifications
You must be signed in to change notification settings - Fork 1
/
GM.h
49 lines (44 loc) · 878 Bytes
/
GM.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
#pragma once
#include "common.h"
#include <MMX/RsaSignature.h>
#include <vector>
#include "Member.h"
#include "SHA512.h"
namespace group_sig
{
struct member_info
{
string id;
ZZ y;
ZZ z;
};
class GM
{
public:
explicit GM(long lambda)
: lambda(lambda)
{
rsa_.generateKeyPair();
init();
}
void init();
public_para getPublicPara() const;
ZZ verify(string id, string msg);
string open(ZZ gg, ZZ zz);
bool SKLOGver(const ZZ &m, const ZZ &y, const ZZ &g, const cspair &p) const;
void keyExchangeRequest(string id);
void onKeyExchangeResponseRecv(string msg);
string getBroadcastMsg();
private:
RSA::RsaSignature rsa_; // (n b)
ZZ G;
ZZ g; // 循环群G,g为生成元,n为G的阶
ZZ a;
long lambda; //群成员私钥长度
ZZ epsilon;
vector<member_info> info;
vector<ZZ> keyChain;
ZZ groupKey;
ZZ psk;
};
}