diff --git a/Benchmarks/RlweBenchmark/RlweBenchmark.swift b/Benchmarks/RlweBenchmark/RlweBenchmark.swift index 2304d628..600f7d19 100644 --- a/Benchmarks/RlweBenchmark/RlweBenchmark.swift +++ b/Benchmarks/RlweBenchmark/RlweBenchmark.swift @@ -346,6 +346,19 @@ func ciphertextMultiplyBenchmark(_: Scheme.Type) -> () -> Void } } +func ciphertextMultiplyInversePowerOfXBenchmark(_: Scheme.Type) -> () -> Void { + { + benchmark("CiphertextMultiplyInversePowerOfX", Scheme.self) { benchmark in + let benchmarkContext: RlweBenchmarkContext = try StaticRlweBenchmarkContext.getBenchmarkContext() + benchmark.startMeasurement() + var ciphertext = try benchmarkContext.ciphertext.convertToCoeffFormat() + for _ in benchmark.scaledIterations { + try blackHole(ciphertext.multiplyInversePowerOfX(power: ciphertext.context.degree / 2)) + } + } + } +} + func ciphertextRelinearizeBenchmark(_: Scheme.Type) -> () -> Void { { benchmark("CiphertextRelinearize", Scheme.self) { benchmark in @@ -665,6 +678,9 @@ nonisolated(unsafe) let benchmarks: () -> Void = { ciphertextSubtractBenchmark(Bfv.self)() ciphertextSubtractBenchmark(Bfv.self)() + ciphertextMultiplyInversePowerOfXBenchmark(Bfv.self)() + ciphertextMultiplyInversePowerOfXBenchmark(Bfv.self)() + ciphertextMultiplyBenchmark(Bfv.self)() ciphertextMultiplyBenchmark(Bfv.self)()