conditionalSelectMask static method

Secp256r1Point conditionalSelectMask(
  1. Secp256r1Point a,
  2. Secp256r1Point 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 Secp256r1Point conditionalSelectMask(
  Secp256r1Point a,
  Secp256r1Point b,
  Uint64 bit,
) => Secp256r1Point(
  x: Secp256r1Fp.conditionalSelectMask(a.x, b.x, bit),
  y: Secp256r1Fp.conditionalSelectMask(a.y, b.y, bit),
  z: Secp256r1Fp.conditionalSelectMask(a.z, b.z, bit),
);