From 3a4c457131dc196c1b1d6c7dbc7008ce5162912d Mon Sep 17 00:00:00 2001 From: Philippe Laferriere Date: Wed, 13 Mar 2024 12:38:57 -0400 Subject: [PATCH] remove use of `exp_vartime` --- air/src/air/transition/frame.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/air/src/air/transition/frame.rs b/air/src/air/transition/frame.rs index c07a58fa4..d4bb0b9ef 100644 --- a/air/src/air/transition/frame.rs +++ b/air/src/air/transition/frame.rs @@ -115,12 +115,16 @@ impl LagrangeKernelEvaluationFrame { // push c(x) frame.push(polynom::eval(lagrange_kernel_col_poly, z)); - // push `c(gx)`, `c(x * g^2)`, `c(x * g^4)`, ..., `c(x * g^(2^(v-1)))` - for i in 0..log_trace_len { - let x = g.exp_vartime(2_u32.pow(i).into()) * z; + // push c(z * g), c(z * g^2), c(z * g^4), ..., c(z * g^(2^(v-1))) + let mut g_exp = g; + for _ in 0..log_trace_len { + let x = g_exp * z; let lagrange_poly_at_x = polynom::eval(lagrange_kernel_col_poly, x); frame.push(lagrange_poly_at_x); + + // takes on the values `g`, `g^2`, `g^4`, `g^8`, ... + g_exp *= g_exp; } Self { frame }