-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelium.proto
161 lines (126 loc) · 3.55 KB
/
helium.proto
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
syntax = "proto3";
option go_package = "github.com/ChristianMct/helium/transport/pb";
package helium_proto;
/*
SERVICE DEFINITIONs
*/
/* Helium is a service run helium nodes. In the current implementation, only
the helper node runs this service and acts as a centralized transport/coordinator/
aggregator and evaluator for its peer nodes. */
service Helium {
/* Register registers the caller as a peer node to the helium server */
rpc Register(Void) returns (stream NodeEvent);
/* PutShare pushes the caller's share in the protocol described by the Share.ShareDescriptor
field to the callee. */
rpc PutShare (Share) returns (Void) {}
/* GetShare queries the aggregation output of the protocol described by PrototocolDescriptor */
rpc GetAggregationOutput(ProtocolDescriptor) returns (AggregationOutput) {}
/* GetCiphertext queries the ciphertext with the given ID from the callee */
rpc GetCiphertext(CiphertextID) returns (Ciphertext) {}
/* PutCiphertext pushes the ciphertext to the callee */
rpc PutCiphertext(Ciphertext) returns (CiphertextID) {}
}
/*
MESSAGE DEFINITIONS
The following messages have counterparts in the Go implementation of the Helium service.
See the godoc for more information on these messages.
*/
message Void {
}
message ProtocolID {
string ProtocolID = 1;
}
message SessionID {
string session_id = 1;
}
message NodeID {
string node_id = 1;
}
message CiphertextID {
string ciphertext_id = 1;
}
enum EventType {
Completed = 0;
Started = 1;
Executing = 2;
Failed = 3;
}
message ProtocolEvent {
ProtocolDescriptor Descriptor = 1;
EventType Type = 2;
}
message CircuitEvent {
CircuitDescriptor Descriptor = 1;
EventType Type = 2;
}
message SetupEvent {
ProtocolEvent ProtocolEvent = 1;
}
message ComputeEvent {
CircuitEvent CircuitEvent = 1;
optional ProtocolEvent ProtocolEvent = 2;
}
message NodeEvent {
oneof Event {
SetupEvent SetupEvent = 1;
ComputeEvent ComputeEvent = 2;
}
}
enum ProtocolType {
UNSPECIFIED = 0;
SKG = 1; /* secret-key generation */
CKG = 2; /* public encryption-key generation */
RKG_1 = 3; /* first round of public relinearization-key generation */
RKG = 4; /* second round of public relinearization-key generation */
RTG = 5; /* public rotation-key generation */
CKS = 6; /* collective switching to collective secret-key */
DEC = 7; /* collective decryption */
PCKS = 8; /* collective switching to known public-key */
}
message ProtocolDescriptor {
ProtocolType ProtocolType = 1;
map<string, string> Args = 2;
NodeID Aggregator = 3;
repeated NodeID Participants = 4;
repeated NodeID Receivers = 5;
}
message ShareMetadata {
ProtocolID ProtocolID = 1;
ProtocolType ProtocolType = 2;
repeated NodeID AggregateFor = 3;
}
message Share {
ShareMetadata Metadata = 1;
bytes share = 2;
}
message AggregationOutput {
Share AggregatedShare = 1;
}
message CircuitSignature {
string Name = 1;
map<string, string> Args = 2;
}
message CircuitID {
string CircuitID = 1;
}
message CircuitDescriptor {
CircuitSignature CircuitSignature = 1;
CircuitID CircuitID = 2;
map<string, NodeID> NodeMapping = 3;
NodeID Evaluator = 4;
}
message Ciphertext {
bytes ciphertext = 1;
CiphertextMetadata metadata = 2;
}
enum CiphertextType {
UNSPECIFIED_CT_TYPE = 0;
BFV = 1;
BGV = 2;
CKKS = 3;
RGSW = 4;
}
message CiphertextMetadata {
CiphertextID id = 1;
optional CiphertextType type = 2;
}