-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharing.h
More file actions
32 lines (26 loc) · 875 Bytes
/
sharing.h
File metadata and controls
32 lines (26 loc) · 875 Bytes
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
#ifndef SHARING_H
#define SHARING_H
#include "util.h"
#endif // SHARING_H
class sharing_context{
public:
NetIO * io;
emp::PRG prg; // Pseudo-Random Generator for generating random values
emp::PRP prp; // Pseudo-Random Permutation for secure shuffling and encoding
sharing_context(NetIO *io) : io(io), prg(), prp(emp::zero_block, emp::makeBlock(0, 1)) {}
~sharing_context() {
delete io; // Clean up the NetIO object
}
};
// this class is for two-party secret sharing schemes
class sharing
{
public:
// The sharing type, e.g., "additive", "multiplicative", etc.
std::string type;
// The number of parties involved in the sharing scheme
size_t num_parties;
// Constructor to initialize the sharing scheme
sharing(const std::string &type, size_t num_parties)
: type(type), num_parties(num_parties) {}
};