From 6cfb77a18f9c82959121380a86e392ed664a31b9 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 5 Dec 2018 16:12:31 +0900 Subject: [PATCH] clear() is reduced --- include/mcl/bn.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/mcl/bn.hpp b/include/mcl/bn.hpp index 7862010..708e97d 100644 --- a/include/mcl/bn.hpp +++ b/include/mcl/bn.hpp @@ -1564,17 +1564,22 @@ inline void mulSparse(Fp12& z, const Fp6& x) } inline void convertFp6toFp12(Fp12& y, const Fp6& x) { - y.clear(); if (BN::param.cp.isMtype) { // (a, b, c) -> (a, c, 0, 0, b, 0) y.a.a = x.a; y.b.b = x.b; y.a.b = x.c; + y.a.c.clear(); + y.b.a.clear(); + y.b.c.clear(); } else { // (a, b, c) -> (b, 0, 0, c, a, 0) y.b.b = x.a; y.a.a = x.b; y.b.a = x.c; + y.a.b.clear(); + y.a.c.clear(); + y.b.c.clear(); } } inline void mulSparse2(Fp12& z, const Fp6& x, const Fp6& y)