conditionalSelectMask static method

Secp256k1Point conditionalSelectMask(
  1. Secp256k1Point a,
  2. Secp256k1Point b,
  3. Uint64 bit
)

Mask form of conditionalSelect: bit is a 0/1 Uint64 (never a bool), so point addition and scalar multiplication stay straight-line on secret data.

Implementation

static Secp256k1Point conditionalSelectMask(
  Secp256k1Point a,
  Secp256k1Point b,
  Uint64 bit,
) => Secp256k1Point(
  x: Secp256k1Fp.conditionalSelectMask(a.x, b.x, bit),
  y: Secp256k1Fp.conditionalSelectMask(a.y, b.y, bit),
  z: Secp256k1Fp.conditionalSelectMask(a.z, b.z, bit),
);