Skip to content

Commit ab59112

Browse files
authored
Added CiphertextMultiplyInversePowerOfX benchmark (#162)
1 parent e60648c commit ab59112

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Benchmarks/RlweBenchmark/RlweBenchmark.swift

+16
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,19 @@ func ciphertextMultiplyBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void
346346
}
347347
}
348348

349+
func ciphertextMultiplyInversePowerOfXBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void {
350+
{
351+
benchmark("CiphertextMultiplyInversePowerOfX", Scheme.self) { benchmark in
352+
let benchmarkContext: RlweBenchmarkContext<Scheme> = try StaticRlweBenchmarkContext.getBenchmarkContext()
353+
benchmark.startMeasurement()
354+
var ciphertext = try benchmarkContext.ciphertext.convertToCoeffFormat()
355+
for _ in benchmark.scaledIterations {
356+
try blackHole(ciphertext.multiplyInversePowerOfX(power: ciphertext.context.degree / 2))
357+
}
358+
}
359+
}
360+
}
361+
349362
func ciphertextRelinearizeBenchmark<Scheme: HeScheme>(_: Scheme.Type) -> () -> Void {
350363
{
351364
benchmark("CiphertextRelinearize", Scheme.self) { benchmark in
@@ -665,6 +678,9 @@ nonisolated(unsafe) let benchmarks: () -> Void = {
665678
ciphertextSubtractBenchmark(Bfv<UInt32>.self)()
666679
ciphertextSubtractBenchmark(Bfv<UInt64>.self)()
667680

681+
ciphertextMultiplyInversePowerOfXBenchmark(Bfv<UInt32>.self)()
682+
ciphertextMultiplyInversePowerOfXBenchmark(Bfv<UInt64>.self)()
683+
668684
ciphertextMultiplyBenchmark(Bfv<UInt32>.self)()
669685
ciphertextMultiplyBenchmark(Bfv<UInt64>.self)()
670686

0 commit comments

Comments
 (0)