def select
import bend-collections@1.0.0.0/src/crypto/secp256k1/point.bend as Pointimport Base
import bend-collections@1.0.0.0/src/crypto/secp256k1/field.bend as F
103# b ? p : q, coordinate-wise and branch-free, for b in {0, 1}
104def select(+b: Nat, p: Point, q: Point) -> Point:
105 match p q:
106 case Point{x1, y1, z1} Point{x2, y2, z2}:
107 Point{F.select(b, x1, x2), F.select(b, y1, y2), F.select(b, z1, z2)}