|
|
@ -1564,17 +1564,22 @@ inline void mulSparse(Fp12& z, const Fp6& x) |
|
|
|
} |
|
|
|
} |
|
|
|
inline void convertFp6toFp12(Fp12& y, const Fp6& x) |
|
|
|
inline void convertFp6toFp12(Fp12& y, const Fp6& x) |
|
|
|
{ |
|
|
|
{ |
|
|
|
y.clear(); |
|
|
|
|
|
|
|
if (BN::param.cp.isMtype) { |
|
|
|
if (BN::param.cp.isMtype) { |
|
|
|
// (a, b, c) -> (a, c, 0, 0, b, 0)
|
|
|
|
// (a, b, c) -> (a, c, 0, 0, b, 0)
|
|
|
|
y.a.a = x.a; |
|
|
|
y.a.a = x.a; |
|
|
|
y.b.b = x.b; |
|
|
|
y.b.b = x.b; |
|
|
|
y.a.b = x.c; |
|
|
|
y.a.b = x.c; |
|
|
|
|
|
|
|
y.a.c.clear(); |
|
|
|
|
|
|
|
y.b.a.clear(); |
|
|
|
|
|
|
|
y.b.c.clear(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// (a, b, c) -> (b, 0, 0, c, a, 0)
|
|
|
|
// (a, b, c) -> (b, 0, 0, c, a, 0)
|
|
|
|
y.b.b = x.a; |
|
|
|
y.b.b = x.a; |
|
|
|
y.a.a = x.b; |
|
|
|
y.a.a = x.b; |
|
|
|
y.b.a = x.c; |
|
|
|
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) |
|
|
|
inline void mulSparse2(Fp12& z, const Fp6& x, const Fp6& y) |
|
|
|