Skip to content

Commit 780f203

Browse files
committed
Remove commented out code sections
1 parent 91c26b3 commit 780f203

12 files changed

+16
-35
lines changed

data/handle_data.go

-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import (
1616
"go.dedis.ch/onet/v3/log"
1717
)
1818

19-
// Groups identifies all different groups to be added to the test data file
20-
//var Groups [][]int64
21-
2219
// FillInt64Slice fills a slice with the same value v
2320
func FillInt64Slice(s []int64, v int64) {
2421
for i := 0; i < len(s); i++ {
@@ -111,8 +108,6 @@ func GenerateData(numDPs, numEntries, numEntriesFiltered, numGroupsClear, numGro
111108
aggr := make([]int64, numAggrEnc+numAggrClear)
112109

113110
// Toggle random data or not (2 -> just 0's or 1's)
114-
115-
//FillInt64Slice(aggr,int64(1))
116111
randomFillInt64Slice(aggr, 2)
117112

118113
grp := make([]int64, numGroupsClear+numGroupsEnc)

lib/crypto.go

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
const MaxHomomorphicInt int64 = 100000
2121

2222
// PointToInt creates a map between EC points and integers.
23-
//var PointToInt = make(map[string]int64, MaxHomomorphicInt)
2423
var PointToInt = concurrent.NewConcurrentMap()
2524
var currentGreatestM kyber.Point
2625
var currentGreatestInt int64

lib/structs_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func TestAddClientResponse(t *testing.T) {
2929
newCr.AggregatingAttributes = *libunlynx.NewCipherVector(len(cr1.AggregatingAttributes))
3030
newCr.Add(cr1, cr2)
3131

32-
//assert.Equal(t, grouping, lib.UnKey(newCr.GroupingAttributesClear))
3332
assert.Equal(t, sum, libunlynx.DecryptIntVector(secKey, &newCr.AggregatingAttributes))
3433
assert.Equal(t, grouping, libunlynx.DecryptIntVector(secKey, &newCr.GroupByEnc))
3534
}

protocols/collective_aggregation_protocol.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ type ChildAggregatedDataBytesMessage struct {
5959
type CADBLengthMessage struct {
6060
GacbLength int
6161
AabLength int
62-
//PgaebLength int
63-
DtbLength int
62+
DtbLength int
6463
}
6564

6665
// Structs
@@ -308,7 +307,6 @@ func (sm *ChildAggregatedDataMessage) ToBytes() ([]byte, int, int, int) {
308307

309308
var gacbLength int
310309
var aabLength int
311-
//var pgaebLength int
312310
var dtbLength int
313311

314312
wg := libunlynx.StartParallelize(len((*sm).ChildData))

protocols/deterministic_tagging_protocol.go

-2
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ func (dtm *DeterministicTaggingMessage) ToBytes() []byte {
309309

310310
// FromBytes converts a byte array to a DeterministicTaggingMessage. Note that you need to create the (empty) object beforehand.
311311
func (dtm *DeterministicTaggingMessage) FromBytes(data []byte) {
312-
313-
//cvLengths := UnsafeCastBytesToInts(cvLengthsByte)
314312
elementSize := libunlynx.CipherTextByteSize()
315313
(*dtm).Data = make([]libunlynx.CipherText, len(data)/elementSize)
316314

protocols/deterministic_tagging_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestDeterministicTagging(t *testing.T) {
3434

3535
aggregateKey := entityList.Aggregate
3636

37-
//create data for test
37+
// create data for test
3838
testCipherVect := make(libunlynx.CipherVector, 1)
3939
expRes := []int64{1}
4040
for i, p := range expRes {

protocols/key_switching_protocol.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func NewKeySwitchingProtocol(n *onet.TreeNodeInstance) (onet.ProtocolInstance, e
140140
// Start is called at the root to begin the execution of the protocol.
141141
func (p *KeySwitchingProtocol) Start() error {
142142

143-
//keySwitchingStart := libunlynx.StartTimer(p.Name() + "_KeySwitching(START)")
143+
keySwitchingStart := libunlynx.StartTimer(p.Name() + "_KeySwitching(START)")
144144

145145
if p.TargetOfSwitch == nil {
146146
return errors.New("no ciphertext given as key switching target")
@@ -173,7 +173,7 @@ func (p *KeySwitchingProtocol) Start() error {
173173
log.Fatal("Root " + p.ServerIdentity().String() + " failed to broadcast DownMessageBytes")
174174
}
175175

176-
//libunlynx.EndTimer(keySwitchingStart)
176+
libunlynx.EndTimer(keySwitchingStart)
177177

178178
return nil
179179
}
@@ -230,7 +230,7 @@ func (p *KeySwitchingProtocol) announcementKSPhase() (kyber.Point, []kyber.Point
230230
// Results pushing up the tree containing key switching results.
231231
func (p *KeySwitchingProtocol) ascendingKSPhase() *libunlynx.CipherVector {
232232

233-
//keySwitchingAscendingAggregation := libunlynx.StartTimer(p.Name() + "_KeySwitching(ascendingAggregation)")
233+
keySwitchingAscendingAggregation := libunlynx.StartTimer(p.Name() + "_KeySwitching(ascendingAggregation)")
234234

235235
if !p.IsLeaf() {
236236
length := make([]LengthStruct, 0)
@@ -252,7 +252,7 @@ func (p *KeySwitchingProtocol) ascendingKSPhase() *libunlynx.CipherVector {
252252
}
253253
}
254254

255-
//libunlynx.EndTimer(keySwitchingAscendingAggregation)
255+
libunlynx.EndTimer(keySwitchingAscendingAggregation)
256256

257257
if !p.IsRoot() {
258258
if err := p.SendToParent(&LengthMessage{Length: libunlynxtools.UnsafeCastIntsToBytes([]int{len(*p.NodeContribution)})}); err != nil {

protocols/shuffling_protocol.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func NewShufflingProtocol(n *onet.TreeNodeInstance) (onet.ProtocolInstance, erro
122122
// Start is called at the root node and starts the execution of the protocol.
123123
func (p *ShufflingProtocol) Start() error {
124124

125-
//shufflingStart := libunlynx.StartTimer(p.Name() + "_Shuffling(START)")
125+
shufflingStart := libunlynx.StartTimer(p.Name() + "_Shuffling(START)")
126126

127127
if p.ShuffleTarget == nil {
128128
return errors.New("no map given as shuffling target")
@@ -153,14 +153,14 @@ func (p *ShufflingProtocol) Start() error {
153153

154154
libunlynx.EndTimer(shufflingStartNoProof)
155155

156-
//shufflingStartProof := libunlynx.StartTimer(p.Name() + "_Shuffling(START-Proof)")
156+
shufflingStartProof := libunlynx.StartTimer(p.Name() + "_Shuffling(START-Proof)")
157157

158158
if p.Proofs {
159159
p.ProofFunc(shuffleTarget, shuffledData, collectiveKey, beta, pi)
160160
}
161161

162-
//libunlynx.EndTimer(shufflingStartProof)
163-
//libunlynx.EndTimer(shufflingStart)
162+
libunlynx.EndTimer(shufflingStartProof)
163+
libunlynx.EndTimer(shufflingStart)
164164

165165
p.ExecTimeStart += time.Since(timer)
166166

@@ -186,7 +186,7 @@ func (p *ShufflingProtocol) Dispatch() error {
186186
shuffleTarget := sm.Data
187187

188188
timer := time.Now()
189-
//shufflingDispatch := libunlynx.StartTimer(p.Name() + "_Shuffling(DISPATCH)")
189+
shufflingDispatch := libunlynx.StartTimer(p.Name() + "_Shuffling(DISPATCH)")
190190

191191
collectiveKey := p.Roster().Aggregate
192192
// when testing protocol
@@ -203,19 +203,19 @@ func (p *ShufflingProtocol) Dispatch() error {
203203
var beta [][]kyber.Scalar
204204

205205
if !p.IsRoot() {
206-
//shufflingDispatchNoProof := libunlynx.StartTimer(p.Name() + "_Shuffling(DISPATCH-noProof)")
206+
shufflingDispatchNoProof := libunlynx.StartTimer(p.Name() + "_Shuffling(DISPATCH-noProof)")
207207

208208
shuffledData, pi, beta = libunlynxshuffle.ShuffleSequence(shuffleTarget, libunlynx.SuiTe.Point().Base(), collectiveKey, p.Precomputed)
209209

210-
//libunlynx.EndTimer(shufflingDispatchNoProof)
210+
libunlynx.EndTimer(shufflingDispatchNoProof)
211211

212-
//shufflingDispatchProof := libunlynx.StartTimer("_Shuffling(DISPATCH-Proof)")
212+
shufflingDispatchProof := libunlynx.StartTimer("_Shuffling(DISPATCH-Proof)")
213213

214214
if p.Proofs {
215215
p.ProofFunc(shuffleTarget, shuffledData, collectiveKey, beta, pi)
216216
}
217217

218-
//libunlynx.EndTimer(shufflingDispatchProof)
218+
libunlynx.EndTimer(shufflingDispatchProof)
219219

220220
}
221221

@@ -227,7 +227,7 @@ func (p *ShufflingProtocol) Dispatch() error {
227227
log.Lvl1(p.ServerIdentity(), " carried on shuffling.")
228228
}
229229

230-
//libunlynx.EndTimer(shufflingDispatch)
230+
libunlynx.EndTimer(shufflingDispatch)
231231

232232
// If this tree node is the root, then protocol reached the end.
233233
if p.IsRoot() {

services/api.go

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ func (c *API) SendSurveyResultsQuery(surveyID SurveyID) (*[][]int64, *[][]int64,
9191

9292
log.Lvl1(c, " got the survey result from ", c.entryPoint)
9393

94-
//grpClear := make([][]int64, len(resp.Results))
9594
grp := make([][]int64, len(resp.Results))
9695
aggr := make([][]int64, len(resp.Results))
9796
for i, res := range resp.Results {

services/service_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ func TestServiceClearAttr(t *testing.T) {
167167
for j := 0; j < numberAttr; j++ {
168168
aggr["s"+strconv.Itoa(j+1)] = int64(j)
169169
}
170-
171-
//responses:= []lib.DpClearResponse{{WhereClear: sliceWhere, GroupByClear: sliceGrp, AggregatingAttributesEnc: aggr},{WhereClear: sliceWhere, GroupByClear: sliceGrp, AggregatingAttributesEnc: aggr},{WhereClear: sliceWhere, GroupByClear: sliceGrp1, AggregatingAttributesEnc: aggr}}
172170
responses := []libunlynx.DpClearResponse{{WhereClear: sliceWhere, GroupByClear: sliceGrp, AggregatingAttributesEnc: aggr}, {WhereClear: sliceWhere, GroupByClear: sliceGrp, AggregatingAttributesEnc: aggr}}
173171

174172
log.Lvl1(responses)
@@ -179,7 +177,6 @@ func TestServiceClearAttr(t *testing.T) {
179177
}
180178

181179
expectedResults[[3]int64{0, 1, 2}] = []int64{0, 18}
182-
//expectedResults[[3]int64{1,2,3}] = []int64{0,9}
183180
grp, aggr, err := client.SendSurveyResultsQuery(*surveyID)
184181

185182
if err != nil {

simul/proofs_verification_simul.go

-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ func (sim *ProofsVerificationSimulation) Run(config *onet.SimulationConfig) erro
170170
}
171171

172172
//shuffling ****************************************************************************************************
173-
174173
log.Lvl1("Starting shuffling (can take some time)")
175174
responsesToShuffle := make([]libunlynx.ProcessResponse, sim.NbrResponses/sim.NbrServers)
176175
for i := 0; i < sim.NbrResponses/sim.NbrServers; i++ {

simul/unlynx_simul.go

-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ func (sim *SimulationUnLynx) Run(config *onet.SimulationConfig) error {
131131
testData := dataunlynx.GenerateData(int64(sim.NbrDPs), sim.NbrResponsesTot, sim.NbrResponsesFiltered, sim.NbrGroupsClear, sim.NbrGroupsEnc,
132132
sim.NbrWhereClear, sim.NbrWhereEncrypted, sim.NbrAggrClear, sim.NbrAggrEncrypted, sim.NbrGroupAttributes, sim.RandomGroups)
133133

134-
/*log.Lvl1("Saving test data...")
135-
data.WriteDataToFile("unlynx_test_data.txt", testData)*/
136-
137134
/// START SERVICE PROTOCOL
138135
if libunlynx.TIME {
139136
start = monitor.NewTimeMeasure("SendingData")

0 commit comments

Comments
 (0)