-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss.h
75 lines (44 loc) · 2.56 KB
/
rss.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
#ifndef RSS_H
#define RSS_H
#include <stdio.h>
#include "arith.h"
#define N 6
#define N_SHARES 15
#define N_SHARES_P_SERVER 10
#define T 2
#define N_BITS 32
#define N_TRANSMIT 4
unsigned long long factorial(int num);
unsigned long long binomialCoefficient(int n, int k);
void generateTuples(int set[], int tuple[], int tuples[][T], int n, int t, int index, int tupleIndex, int *totalTuples);
void printTuples(int tuples[][2], int t, int totalTuples);
void shareDistribution(int shareDistribution[][N_SHARES], int tuples[][T]);
void printShareDistribution(int shareDistr[][N_SHARES]);
void shareCounting(int shareCount[][N_SHARES], int shareDistribution[][N_SHARES]);
void printShareCounting(int shareCount[][N_SHARES]);
void shareMapping(int shareMap[][N_SHARES_P_SERVER], int shareDistribution[][N_SHARES]);
void printShareMapping(int shareMap[][N_SHARES_P_SERVER]);
void generateFractions(f_elm_t fractionMatrix[][N_SHARES], int shareCount[][N_SHARES]);
void secretSharing(f_elm_t shares[], f_elm_t secret, int n_shares);
void printSecretSharing(f_elm_t secretShares, int n_shares);
void secretOpening(f_elm_t share[], f_elm_t secret, int n_shares);
void secretSharingServers(f_elm_t sharesServer[][N_SHARES_P_SERVER], f_elm_t shares[],
int shareMap[][N_SHARES_P_SERVER]);
void printSecretSharingServers(f_elm_t sharesServer[][N_SHARES_P_SERVER]);
void keySharingServersN(f_elm_t sharesServer[][N_BITS][N_SHARES_P_SERVER], f_elm_t keys[],
int shareMap[][N_SHARES_P_SERVER]);
void shareMultMaskN(f_elm_t multMaskServ[][N_BITS][N_SHARES_P_SERVER * N_SHARES_P_SERVER],
int shareDistr[][N_SHARES]);
void shareElmMaskN(f_elm_t elmMaskServ[][N_BITS][N_SHARES_P_SERVER * N_SHARES_P_SERVER],
int shareDistr[][N_SHARES], int shareCount[][N_SHARES]);
void aggregateResN(f_elm_t resServ[][N_BITS][N_SHARES_P_SERVER * N_SHARES_P_SERVER],
f_elm_t expAggrRes[][N_SHARES * N_SHARES], int shareDistr[][N_SHARES]);
void aggregateVectorN(f_elm_t expAggrRes[][N_SHARES * N_SHARES], f_elm_t res[]);
void mergeHashesN(f_elm_t hashes[][N_BITS][N_SHARES_P_SERVER * N_SHARES_P_SERVER],
f_elm_t mergedHashes[][N_SHARES * N_SHARES], int shareDistr[][N_SHARES]);
void compareHashesN(f_elm_t expAggrRes[][N_SHARES * N_SHARES], f_elm_t mergedHashes[][N_SHARES * N_SHARES],
int checkHash[][N_SHARES * N_SHARES]);
void checkHashesN(int checkHash[][N_SHARES * N_SHARES]);
void printResN(f_elm_t res[]);
void calculateOPRF(f_elm_t resElm[], unsigned char *resOPRF);
#endif