-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dealer.h
50 lines (38 loc) · 878 Bytes
/
Dealer.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
#ifndef __DEALER_H__
#define __DEALER_H__
#include <iostream>
#include <vector>
#include <random>
#include "Share.h"
#include "LinearPolynomial.h"
#include "KeyGenerator.h"
using namespace std;
/**
* @brief Represents the dealer who generates and distributes shares.
*
*/
class Dealer : public KeyGenerator{
const int threshold,
totShares;
LinearPolynomial poly;
vector<Share> shares;
vector<int> commitments;
public:
/**
* @brief initalizes commitments respective to each coefficient.
*
* @return true
* @return false
*/
bool initalizeCommitments();
Dealer(int seceret);
/**
* @brief Generates 4.
*
* @return vector<Share>
*/
vector<Share> generateShares();
int reconstructMessage(const vector<Share> &shares);
friend class Share;
};
#endif