ctSelect static method
Branchless select: returns b if choice else a. Built from a
bitmask blend, matching the shape of typical constant-time field code
(this is a helper, not a hardened constant-time guarantee — Dart's
runtime doesn't guarantee branchless codegen).
Implementation
static Uint64 ctSelect(Uint64 a, Uint64 b, bool choice) {
final mask = choice ? Uint64.max : Uint64.zero;
return (b & mask) | (a & ~mask); // Inverted from original
}