From 278f1b74731358c00cea9910a21f080191a08b3d Mon Sep 17 00:00:00 2001 From: Mamy Ratsimbazafy Date: Mon, 15 Jul 2024 00:37:17 +0200 Subject: [PATCH] fix(bench): forgot declaring var in refactoring --- benchmarks/bench_fields_template.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/benchmarks/bench_fields_template.nim b/benchmarks/bench_fields_template.nim index 8a0acf11..5ad318e2 100644 --- a/benchmarks/bench_fields_template.nim +++ b/benchmarks/bench_fields_template.nim @@ -229,12 +229,13 @@ proc sqrtRatioVartimeBench*(T: typedesc, iters: int) = proc powBench*(T: typedesc, iters: int) = let x = rng.random_unsafe(T) let exponent = rng.random_unsafe(BigInt[Fr[T.Name].bits()]) + var r = x bench("Exp curve order (constant-time) - " & $exponent.bits & "-bit", T, iters): - var r = x r.pow(exponent) proc powVartimeBench*(T: typedesc, iters: int) = let x = rng.random_unsafe(T) let exponent = rng.random_unsafe(BigInt[Fr[T.Name].bits()]) + var r = x bench("Exp by curve order (vartime) - " & $exponent.bits & "-bit", T, iters): r.pow_vartime(exponent)