From cf1b3da28964716e714c5f95e12b9e94f8ac55e7 Mon Sep 17 00:00:00 2001 From: emmansun Date: Fri, 7 Jul 2023 20:20:15 +0800 Subject: [PATCH] sm9/bn256: fix purego issue --- sm9/bn256/select_generic.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sm9/bn256/select_generic.go b/sm9/bn256/select_generic.go index 6eec8e8..275a34d 100644 --- a/sm9/bn256/select_generic.go +++ b/sm9/bn256/select_generic.go @@ -8,11 +8,18 @@ func gfP12MovCond(res, a, b *gfP12, cond int) { } func curvePointMovCond(res, a, b *curvePoint, cond int) { - res.Select(a, b, cond) + res.x.Select(&a.x, &b.x, cond) + res.y.Select(&a.y, &b.y, cond) + res.z.Select(&a.z, &b.z, cond) + res.t.Select(&a.t, &b.t, cond) } func twistPointMovCond(res, a, b *twistPoint, cond int) { - res.Select(a, b, cond) + // Select sets q to p1 if cond == 1, and to p2 if cond == 0. + res.x.Select(&a.x, &b.x, cond) + res.y.Select(&a.y, &b.y, cond) + res.z.Select(&a.z, &b.z, cond) + res.t.Select(&a.t, &b.t, cond) } func gfpCopy(res, in *gfP) {