-
Notifications
You must be signed in to change notification settings - Fork 2
/
protocol_config.proto
291 lines (253 loc) · 10.2 KB
/
protocol_config.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
// Copyright 2021 The Cross-Media Measurement Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package wfa.measurement.api.v2alpha;
import "google/api/field_behavior.proto";
import "wfa/measurement/api/v2alpha/differential_privacy.proto";
option java_package = "org.wfanet.measurement.api.v2alpha";
option java_multiple_files = true;
option java_outer_classname = "ProtocolConfigProto";
// Configuration for computation protocols.
//
// (-- api-linter: core::0123::resource-annotation=disabled
// aip.dev/not-precedent: This is not a resource message. --)
message ProtocolConfig {
// Resource name.
//
// Deprecated: This is not a resource message type.
string name = 1 [deprecated = true];
// Type of measurement.
//
// The values should correspond to the fields in the `measurement_type` Oneof
// in `MeasurementSpec`.
enum MeasurementType {
// Default value used if the type is omitted.
MEASUREMENT_TYPE_UNSPECIFIED = 0;
// Reach and frequency.
REACH_AND_FREQUENCY = 1;
// Number of impressions.
IMPRESSION = 2;
// Watch duration.
DURATION = 3;
// Reach only (no frequency).
REACH = 4;
// Population
POPULATION = 5;
}
// The type of measurement that this protocol computes.
MeasurementType measurement_type = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
// The mechanism used to generate noise in computations.
//
// (-- TODO(@riemanli): Move the noise mechanism to its own file. --)
enum NoiseMechanism {
// Default value used if the mechanism is omitted.
NOISE_MECHANISM_UNSPECIFIED = 0;
// No noise is added.
NONE = 3;
// Geometric, i.e. discrete Laplace.
GEOMETRIC = 1;
// Discrete Gaussian.
DISCRETE_GAUSSIAN = 2;
// Continuous Laplace.
CONTINUOUS_LAPLACE = 4;
// Continuous Gaussian.
CONTINUOUS_GAUSSIAN = 5;
}
// Configuration for the Liquid Legions v2 R/F protocol.
message LiquidLegionsV2 {
// Parameters for sketch.
LiquidLegionsSketchParams sketch_params = 1
[(google.api.field_behavior) = REQUIRED];
// Differential privacy parameters for data provider noise registers.
//
// Each of these registers contains a well-known constant register ID, and
// arbitrary key and count values.
DifferentialPrivacyParams data_provider_noise = 2
[(google.api.field_behavior) = REQUIRED];
// ID of the OpenSSL built-in elliptic curve. For example, 415 for the
// prime256v1 curve.
int32 elliptic_curve_id = 3 [(google.api.field_behavior) = REQUIRED];
// The maximum frequency to reveal in the histogram.
//
// Deprecated: Specified in MeasurementSpec instead except for legacy
// Measurements.
int32 maximum_frequency = 4 [deprecated = true];
// The mechanism to generate noise during computation.
//
// Only discrete types are allowed.
NoiseMechanism noise_mechanism = 5;
}
// Configuration for the Direct protocol.
//
// The `DataProvider` may choose from the specified noise mechanisms and
// methodologies.
message Direct {
// Configuration parameters for custom direct methodology.
message CustomDirectMethodology {}
// Configuration parameters for the deterministic count distinct
// methodology.
message DeterministicCountDistinct {}
// Configuration parameters for the deterministic distribution methodology.
message DeterministicDistribution {}
// Configuration parameters for the deterministic count methodology.
message DeterministicCount {}
// Configuration parameters for the deterministic sum methodology.
message DeterministicSum {}
// Configuration parameters for the direct Liquid Legions distribution
// methodology.
//
// (-- TODO(@riemanli): Add recommended parameter values. --)
message LiquidLegionsDistribution {}
// Configuration parameters for the direct Liquid Legions count distinct
// methodology.
//
// (-- TODO(@riemanli): Add recommended parameter values. --)
message LiquidLegionsCountDistinct {}
// The set of mechanisms that can be used to generate noise during
// computation.
//
// Only continuous types and NONE are allowed.
repeated NoiseMechanism noise_mechanisms = 1;
// Custom direct methodology.
//
// Used when data provider wants to use a methodology that is not listed in
// direct protocol config to compute direct measurements. Data providers who
// use any custom direct methodology must guarantee the independence of the
// result by generating a random seed that is unique for the particular
// measurement and seeding their hash function with it. This guidance only
// applies to direct measurements, not MPC measurements.
CustomDirectMethodology custom_direct_methodology = 2;
// Deterministic count distinct methodology.
//
// Can be used in reach computations.
DeterministicCountDistinct deterministic_count_distinct = 3;
// Deterministic distribution methodology.
//
// Can be used in frequency computations.
DeterministicDistribution deterministic_distribution = 4;
// Deterministic count methodology.
//
// Can be used in impression and population computations.
DeterministicCount deterministic_count = 5;
// Deterministic sum methodology.
//
// Can be used in watch duration computations.
DeterministicSum deterministic_sum = 6;
// Liquid Legions count distinct methodology.
//
// Can be used in reach computations.
LiquidLegionsCountDistinct liquid_legions_count_distinct = 7;
// Liquid Legions distribution methodology.
//
// Can be used in frequency computations.
LiquidLegionsDistribution liquid_legions_distribution = 8;
}
// Configuration for the Reach-Only Liquid Legions v2 protocol.
message ReachOnlyLiquidLegionsV2 {
// Parameters for sketch.
ReachOnlyLiquidLegionsSketchParams sketch_params = 1
[(google.api.field_behavior) = REQUIRED];
// Differential privacy parameters for data provider noise registers.
//
// Each of these registers contains a well-known constant register ID, and
// arbitrary key and count values.
DifferentialPrivacyParams data_provider_noise = 2
[(google.api.field_behavior) = REQUIRED];
// ID of the OpenSSL built-in elliptic curve. For example, 415 for the
// prime256v1 curve.
int32 elliptic_curve_id = 3 [(google.api.field_behavior) = REQUIRED];
// The mechanism to generate noise during computation.
//
// Only discrete types are allowed.
NoiseMechanism noise_mechanism = 4;
}
// Configuration for the Shuffle Based Secret Sharing Protocol.
message ShuffleBasedSecretSharing {
// Parameters for secret sharing sketches.
SecretSharingSketchParams sketch_params = 1
[(google.api.field_behavior) = REQUIRED];
// The maximum frequency to reveal in the histogram. This is also the EDP
// frequency cap.
int32 maximum_frequency = 2;
// The mechanism to generate noise by workers during the computation.
NoiseMechanism noise_mechanism = 3;
}
// Configuration for a specific protocol.
message Protocol {
// Configuration for the specific protocol.
oneof protocol {
// Liquid Legions v2 protocol.
//
// May only be set when the measurement type is REACH_AND_FREQUENCY or
// REACH. `Requisition`s using this protocol can be fulfilled by calling
// RequisitionFulfillment/FulfillRequisition with an encrypted sketch.
LiquidLegionsV2 liquid_legions_v2 = 1;
// Direct protocol.
//
// `Requisition`s using this protocol can be fulfilled by calling
// Requisitions/FulfillDirectRequisition.
Direct direct = 2;
// Reach-Only Liquid Legions v2 protocol.
//
// Must only be set when the measurement type is REACH. `Requisition`s
// using this protocol can be fulfilled by calling
// RequisitionFulfillment/FulfillRequisition with an encrypted sketch.
ReachOnlyLiquidLegionsV2 reach_only_liquid_legions_v2 = 3;
// Shuffle Based Secret Sharing protocol.
//
// Using honest-majority setting.
ShuffleBasedSecretSharing shuffle_based_secret_sharing = 4;
}
}
// Configuration for the specific protocol. Required. Immutable.
oneof protocol {
// Liquid Legions v2 config.
//
// May only be set when `measurement_type` is `REACH_AND_FREQUENCY`.
//
// Deprecated and replace with protocols.
LiquidLegionsV2 liquid_legions_v2 = 3 [deprecated = true];
}
// Set of protocols that may be used for this `Measurement`.
repeated Protocol protocols = 4 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
}
// Parameters for a Liquid Legions sketch.
message LiquidLegionsSketchParams {
// The decay rate of the Liquid Legions sketch.
double decay_rate = 1 [(google.api.field_behavior) = REQUIRED];
// The maximum size of the Liquid Legions sketch.
int64 max_size = 2 [(google.api.field_behavior) = REQUIRED];
// The size of the distribution of the sampling indicator value.
int64 sampling_indicator_size = 3 [(google.api.field_behavior) = REQUIRED];
}
// Parameters for a Reach-Only Liquid Legions sketch.
message ReachOnlyLiquidLegionsSketchParams {
// The decay rate of the Liquid Legions sketch.
double decay_rate = 1 [(google.api.field_behavior) = REQUIRED];
// The maximum size of the Liquid Legions sketch.
int64 max_size = 2 [(google.api.field_behavior) = REQUIRED];
}
message SecretSharingSketchParams {
// The size of the sketch.
int64 sketch_size = 1;
// Length of each item in bits. #_EDPs * max_frequency should be no more than
// 2^bit_per_item.
int32 bit_per_item = 2;
}