-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChallenges.proto
107 lines (91 loc) · 4.21 KB
/
Challenges.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
package crypto.proto.RLWE.challenges;
// proto messages for RLWE/RLWR challenges. NOTE: the challenges released in
// 2016 use the Instance*1 and Secret1 formats.
import "Lol.proto";
import "RLWE.proto";
// run this:
// hprotoc -I ../lol Challenges.proto
// protoc Challenges.proto -I. -I../lol --cpp_out=../chall-cpp --java_out=../chall-java --python_out=../chall-python
message ContParams { // continuous RLWE parameters
required int32 m = 1; // cyclotomic index
required int64 q = 2; // modulus
required double svar = 3; // scaled variance
required double bound = 4; // gSqNorm error bound
required int32 numSamples = 5; // number of samples
}
message DiscParams { // discrete RLWE parameters
required int32 m = 1; // cyclotomic index
required int64 q = 2; // modulus
required double svar = 3; // scaled variance
required int64 bound = 4; // gSqNorm error bound
required int32 numSamples = 5; // number of samples
}
message RLWRParams { // RLWR parameters
required int32 m = 1; // cyclotomic index
required int64 q = 2; // modulus
required int64 p = 3; // rounding modulus p < q
required int32 numSamples = 4; // number of samples
}
message Challenge {
required int32 challengeID = 1; // unique identifier of challenge
required int32 numInstances = 2; // number of instances in challenge
required int64 beaconEpoch = 3; // beacon epoch for suppressing secret
required int32 beaconOffset = 4; // byte of beacon value used
oneof params {
ContParams cparams = 5;
DiscParams dparams = 6;
RLWRParams rparams = 7;
}
}
message InstanceCont { // continuous RLWE instance
required int32 challengeID = 1; // challenge this instance belongs to
required int32 instanceID = 2; // instance within the challenge
required ContParams params = 3; // problem params (self-containment)
repeated crypto.proto.RLWE.SampleCont samples = 4; // the samples
}
message InstanceDisc { // discrete RLWE instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required DiscParams params = 3;
repeated crypto.proto.RLWE.SampleDisc samples = 4;
}
message InstanceRLWR { // RLWR instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required RLWRParams params = 3;
repeated crypto.proto.RLWE.SampleRLWR samples = 4;
}
message InstanceContProduct { // continuous RLWE instance
required int32 challengeID = 1; // challenge this instance belongs to
required int32 instanceID = 2; // instance within the challenge
required ContParams params = 3; // problem params (self-containment)
repeated crypto.proto.RLWE.SampleContProduct samples = 4; // the samples
}
message InstanceDiscProduct { // discrete RLWE instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required DiscParams params = 3;
repeated crypto.proto.RLWE.SampleDiscProduct samples = 4;
}
message InstanceRLWRProduct { // RLWR instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required RLWRParams params = 3;
repeated crypto.proto.RLWE.SampleRLWRProduct samples = 4;
}
message Secret { // a secret for an RLWE/RLWE instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required int32 m = 3;
required int64 q = 4;
required bytes seed = 5;
required crypto.proto.lol.Rq s = 6;
}
message SecretProduct { // a secret for an RLWE/RLWE instance
required int32 challengeID = 1;
required int32 instanceID = 2;
required int32 m = 3;
required int64 q = 4;
required bytes seed = 5;
required crypto.proto.lol.RqProduct s = 6;
}