Skip to content

Commit

Permalink
sm9/bn256: fix purego issue
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun committed Jul 7, 2023
1 parent 0e54e68 commit cf1b3da
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sm9/bn256/select_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cf1b3da

Please sign in to comment.