From 5e18cadc4ed99018961ec53c9f4444155b7e7c46 Mon Sep 17 00:00:00 2001 From: Youssef El Housni Date: Mon, 6 Feb 2023 10:26:04 +0100 Subject: [PATCH] fix: mimc pow7 --- std/hash/mimc/encrypt.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/std/hash/mimc/encrypt.go b/std/hash/mimc/encrypt.go index 4ea35b33e2..664a5281e2 100644 --- a/std/hash/mimc/encrypt.go +++ b/std/hash/mimc/encrypt.go @@ -128,10 +128,10 @@ func pow5(api frontend.API, x frontend.Variable) frontend.Variable { } func pow7(api frontend.API, x frontend.Variable) frontend.Variable { - r := api.Mul(x, x) - r = api.Mul(r, r) - r = api.Mul(r, r) - return api.DivUnchecked(r, x) + t := api.Mul(x, x) + r := api.Mul(t, t) + r = api.Mul(r, t) + return api.Mul(r, x) } func pow17(api frontend.API, x frontend.Variable) frontend.Variable {