@@ -43,7 +43,7 @@ func getRandomPlaintextData<T: ScalarType>(count: Int, in range: Range<T>) -> [T
43
43
44
44
struct RlweBenchmarkContext < Scheme: HeScheme > : Sendable {
45
45
var encryptionParameters : EncryptionParameters < Scheme . Scalar >
46
- var context : Context < Scheme >
46
+ var context : Context < Scheme . Scalar >
47
47
48
48
let data : [ Scheme . Scalar ]
49
49
let signedData : [ Scheme . SignedScalar ]
@@ -163,7 +163,7 @@ func contextInitBenchmark<Scheme: HeScheme>(_: Scheme.Type, config: EncryptionPa
163
163
let encryptionParameters = try EncryptionParameters < Scheme . Scalar > ( config: config)
164
164
benchmark. startMeasurement ( )
165
165
for _ in benchmark. scaledIterations {
166
- try blackHole ( _ = Context < Scheme > ( encryptionParameters: encryptionParameters) )
166
+ try blackHole ( _ = Context < Scheme . Scalar > ( encryptionParameters: encryptionParameters) )
167
167
}
168
168
}
169
169
}
@@ -279,8 +279,7 @@ func decodeSignedSimdBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void {
279
279
let benchmarkContext : RlweBenchmarkContext < Scheme > = try StaticRlweBenchmarkContext . getBenchmarkContext ( )
280
280
benchmark. startMeasurement ( )
281
281
for _ in benchmark. scaledIterations {
282
- try blackHole (
283
- benchmarkContext. coeffPlaintext. decode ( format: . simd) as [ Scheme . SignedScalar ] )
282
+ try blackHole ( benchmarkContext. coeffPlaintext. decode ( format: . simd) as [ Scheme . SignedScalar ] )
284
283
}
285
284
}
286
285
}
@@ -292,7 +291,7 @@ func generateSecretKeyBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void
292
291
let benchmarkContext : RlweBenchmarkContext < Scheme > = try StaticRlweBenchmarkContext . getBenchmarkContext ( )
293
292
benchmark. startMeasurement ( )
294
293
for _ in benchmark. scaledIterations {
295
- try blackHole ( benchmarkContext. context. generateSecretKey ( ) )
294
+ try blackHole ( benchmarkContext. context. generateSecretKey ( ) as SecretKey < Scheme > )
296
295
}
297
296
}
298
297
}
@@ -320,8 +319,7 @@ func encryptBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void {
320
319
let benchmarkContext : RlweBenchmarkContext < Scheme > = try StaticRlweBenchmarkContext . getBenchmarkContext ( )
321
320
benchmark. startMeasurement ( )
322
321
for _ in benchmark. scaledIterations {
323
- try blackHole (
324
- benchmarkContext. coeffPlaintext. encrypt ( using: benchmarkContext. secretKey) )
322
+ try blackHole ( benchmarkContext. coeffPlaintext. encrypt ( using: benchmarkContext. secretKey) )
325
323
}
326
324
}
327
325
}
@@ -333,9 +331,7 @@ func decryptBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void {
333
331
let benchmarkContext : RlweBenchmarkContext < Scheme > = try StaticRlweBenchmarkContext . getBenchmarkContext ( )
334
332
benchmark. startMeasurement ( )
335
333
for _ in benchmark. scaledIterations {
336
- try blackHole (
337
- benchmarkContext. evalCiphertext. decrypt (
338
- using: benchmarkContext. secretKey) )
334
+ try blackHole ( benchmarkContext. evalCiphertext. decrypt ( using: benchmarkContext. secretKey) )
339
335
}
340
336
}
341
337
}
0 commit comments