secp256k1CtzVar static method

int secp256k1CtzVar(
  1. BigInt x
)

Implementation

static int secp256k1CtzVar(BigInt x) {
  if (x == BigInt.zero) throw CryptoException('x must not be zero.');

  int count = 0;
  while ((x & BigInt.one) == BigInt.zero) {
    x >>= 1;
    count++;
  }
  return count;
}