secp256k1Modinv64DetCheckPow2 static method

int secp256k1Modinv64DetCheckPow2(
  1. Secp256k1ModinvTrans t,
  2. int n,
  3. int abs
)

Implementation

static int secp256k1Modinv64DetCheckPow2(
    Secp256k1ModinvTrans t, int n, int abs) {
  Secp256k1Int128 a = Secp256k1Int128();
  secp256k1I128Det(a, t.u, t.v, t.q, t.r);
  if (secp256k1I128CheckPow2(a, n, 1).toBool) return 1;
  if (abs.toBool && secp256k1I128CheckPow2(a, n, -1).toBool) return 1;
  return 0;
}